Logo Search packages:      
Sourcecode: inkscape version File versions

void IntLigne::Raster ( raster_info &  dest,
void *  color,
RasterInRunFunc  worker 
)

Rasterization.

The parameters have the same meaning as in the AlphaLigne class.

Definition at line 999 of file int-line.cpp.

References int_ligne_run::en, int_ligne_run::st, int_ligne_run::ven, and int_ligne_run::vst.

{
    if ( nbRun <= 0 ) {
        return;
    }
    
    int min = runs[0].st;
    int max = runs[nbRun-1].en;
    if ( dest.endPix <= min || dest.startPix >= max ) {
        return;
    }

    int curRun = -1;
    for (curRun = 0; curRun < nbRun; curRun++) {
        if ( runs[curRun].en > dest.startPix ) {
            break;
        }
    }
  
    if ( curRun >= nbRun ) {
        return;
    }
  
    if ( runs[curRun].st < dest.startPix ) {
        int nst = runs[curRun].st;
        int nen = runs[curRun].en;
        float vst = runs[curRun].vst;
        float ven = runs[curRun].ven;
        float nvst = (vst * (nen - dest.startPix) + ven * (dest.startPix - nst)) / ((float) (nen - nst));
        if ( runs[curRun].en <= dest.endPix ) {
            (worker)(dest, color, dest.startPix, nvst, runs[curRun].en, runs[curRun].ven);
        } else {
            float nven = (vst * (nen - dest.endPix) + ven * (dest.endPix - nst)) / ((float)(nen - nst));
            (worker)(dest, color, dest.startPix, nvst, dest.endPix, nven);
            return;
        }
        curRun++;
    }

    for (; (curRun < nbRun && runs[curRun].en <= dest.endPix); curRun++) {
        (worker)(dest, color, runs[curRun].st, runs[curRun].vst, runs[curRun].en, runs[curRun].ven);
//Buffer::RasterRun(*dest,color,runs[curRun].st,runs[curRun].vst,runs[curRun].en,runs[curRun].ven);
    }
    
    if ( curRun >= nbRun ) {
        return;
    }
    
    if ( runs[curRun].st < dest.endPix && runs[curRun].en > dest.endPix ) {
        int const nst = runs[curRun].st;
        int const nen = runs[curRun].en;
        float const vst = runs[curRun].vst;
        float const ven = runs[curRun].ven;
        float const nven = (vst * (nen - dest.endPix) + ven * (dest.endPix - nst)) / ((float)(nen - nst));
        
        (worker)(dest,color,runs[curRun].st,runs[curRun].vst,dest.endPix,nven);
        curRun++;
    }
}


Generated by  Doxygen 1.6.0   Back to index