/*
* nlivarot
*
* Created by fred on Fri Jul 25 2003.
* public domain
*
*/
#include "AlphaLigne.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
{
}
AlphaLigne::~AlphaLigne(void)
{
}
{
for (int i=0;i<nbStep;i++) {
}
printf("\n");
}
{
// reset to empty line
// doesn't deallocate the steps array, to minimize memory operations
nbStep=0;
}
{
// printf("%f %f -> %f %f / %f\n",spos,sval,epos,eval,tPente);
// compute the footprint of [spos,epos] on the line of pixels
// update curMin and curMax
// we're on the right of the visible portion of the line: bail out!
return 0;
}
// clamp the changed portion to [min,max], no need for bigger
// total amount of change in pixel coverage from before the right to after the run
// the added portion is entirely on the left, so we only have to change the initial coverage for the line
return 0;
}
// add the steps
// the pixels from [curSt..curEn] (included) intersect with [spos;epos]
// since we're dealing with delta in the coverage, there is also a curEn+1 delta, since the curEn pixel intersect
// with [spos;epos] and thus has some delta with respect to its next pixel
// lots of different cases... ugly
} else {
}
nbStep++;
steps[nbStep].delta=needC-stC; // au final, on a toujours le bon delta, meme avec une arete completement verticale
nbStep++;
}
} else {
}
float enC=/*(int)ldexpf(*/tPente-0.5*tPente*((spos-curStF)*(spos-curStF)+(curEnF+1.0-epos)*(curEnF+1.0-epos))/*,24)*/;
nbStep++;
nbStep++;
nbStep++;
}
} else {
}
nbStep++;
}
} else {
}
nbStep++;
}
nbStep++;
nbStep++;
}
} else {
}
nbStep++;
nbStep++;
nbStep++;
}
} else {
}
nbStep++;
nbStep++;
nbStep++;
}
nbStep++;
nbStep++;
}
}
}
return 0;
}
{
// pas de pente dans ce cas; on ajoute le delta au premier pixel
return 0; // en dehors des limites (attention a ne pas faire ca avec curEn)
}
return 0; // en dehors des limites (attention a ne pas faire ca avec curEn)
}
// int curEn=(int)curEnF;
} else {
}
return 0;
}
{
// just sort
}
{
}
}
{
// start by checking if there are actually pixels in need of rasterization
int curStep=0;
// first add all the deltas up to the first pixel in need of rasterization
curStep++;
}
// just in case, if the line bounds are greater than the buffer bounds.
for (;( curStep < nbStep && steps[curStep].x < dest.startPix) ;curStep++) alpSum+=steps[curStep].delta;
}
// raster!
// we're going to change the pixel position curPos, and alpSum is > 0: rasterization needed from
// the last position (curPos) up to the pixel we're moving to (steps[curStep].x)
//Buffer::RasterRun(dest,color,nst,alpSum,nen,alpSum);
}
// add coverage deltas
}
// if we ended the line with alpSum > 0, we need to raster from curPos to the right edge
//Buffer::RasterRun(dest,color,nst,alpSum,nen,alpSum);
}
}