DRIVER_ERROR Pipeline::Execute (RASTERDATA *InputRaster) { err = NO_ERROR; if (Process (InputRaster) // true if output ready; may set err && (err == NO_ERROR)) { if (next) { while ( NextOutputRaster( next->Exec->raster ) ) { err = next->Execute(&(next->Exec->raster)); ERRCHECK; } } } return err; } //Execute
BYTE* Halftoner::NextOutputRaster(COLORTYPE rastercolor) { if (rastercolor == COLORTYPE_COLOR) { if (iRastersReady == 0) { return NULL; } if (iColor == (ColorPlaneCount+StartPlane)) { return NULL; } if (iPlane == ColorDepth[iColor]) { iPlane = 0; iRow++; return NextOutputRaster(rastercolor); } if (iRow == NumRows[iColor]) { iRow = 0; iColor++; return NextOutputRaster(rastercolor); } iRastersDelivered++; iRastersReady--; return ColorPlane[iColor][iRow][iPlane++]; } else { return NULL; } } //NextOutputRaster
DRIVER_ERROR Pipeline::Flush () { err = NO_ERROR; Exec->Flush (); if (next && (err == NO_ERROR)) { while ( NextOutputRaster( next->Exec->raster ) ) { err = next->Execute(&(next->Exec->raster)); ERRCHECK; } // one more to continue flushing downstream err = next->Flush (); } return err; } //Flush