diff --git a/headers/private/print/libprint/Halftone.h b/headers/private/print/libprint/Halftone.h index d782748bba..0b97aad2c6 100644 --- a/headers/private/print/libprint/Halftone.h +++ b/headers/private/print/libprint/Halftone.h @@ -30,7 +30,7 @@ typedef union { } ColorRGB32; class Halftone; -typedef int (Halftone::*PFN_dither)(uchar *dst, const uchar *src, int x, int y, int width); +typedef void (Halftone::*PFN_dither)(uchar *dst, const uchar *src, int x, int y, int width); typedef uint (*PFN_gray)(ColorRGB32 c); class Halftone { @@ -59,7 +59,7 @@ public: ~Halftone(); void setPlanes(Planes planes); void setBlackValue(BlackValue blackValue); - int dither(uchar *dst, const uchar *src, int x, int y, int width); + void dither(uchar *dst, const uchar *src, int x, int y, int width); int getPixelDepth() const; const uchar *getPattern() const; void setPattern(const uchar *pattern); @@ -74,13 +74,13 @@ protected: void initElements(int x, int y, uchar *elements); uint getDensity(ColorRGB32 c) const; uchar convertUsingBlackValue(uchar byte) const; - int ditherRGB32(uchar *dst, const uchar *src, int x, int y, int width); + void ditherRGB32(uchar *dst, const uchar *src, int x, int y, int width); void initFloydSteinberg(); void deleteErrorTables(); void uninitFloydSteinberg(); void setupErrorBuffer(int x, int y, int width); - int ditherFloydSteinberg(uchar *dst, const uchar* src, int x, int y, int width); + void ditherFloydSteinberg(uchar *dst, const uchar* src, int x, int y, int width); Halftone(const Halftone &); Halftone &operator = (const Halftone &); diff --git a/src/add-ons/print/drivers/shared/libprint/Halftone.cpp b/src/add-ons/print/drivers/shared/libprint/Halftone.cpp index 2c8f18e62e..14d982394f 100644 --- a/src/add-ons/print/drivers/shared/libprint/Halftone.cpp +++ b/src/add-ons/print/drivers/shared/libprint/Halftone.cpp @@ -135,15 +135,13 @@ void Halftone::initElements(int x, int y, uchar *elements) } } -int Halftone::dither( +void Halftone::dither( uchar *dst, const uchar *src, int x, int y, int width) { - int result; - if (fPlanes == kPlaneRGB1) { switch (fCurrentPlane) { case 0: @@ -160,14 +158,13 @@ int Halftone::dither( ASSERT(fGray == &gray); } - result = (this->*fDither)(dst, src, x, y, width); + (this->*fDither)(dst, src, x, y, width); // next plane fCurrentPlane ++; if (fCurrentPlane >= fNumberOfPlanes) { fCurrentPlane = 0; } - return result; } void Halftone::setGrayFunction(GrayFunction grayFunction) @@ -186,7 +183,7 @@ void Halftone::setGrayFunction(GrayFunction grayFunction) setGrayFunction(function); } -int Halftone::ditherRGB32( +void Halftone::ditherRGB32( uchar *dst, const uchar *a_src, int x, @@ -249,8 +246,6 @@ int Halftone::ditherRGB32( } *dst++ = convertUsingBlackValue(cur); } - - return widthByte; } // Floyd-Steinberg dithering @@ -288,7 +283,7 @@ void Halftone::setupErrorBuffer(int x, int y, int width) } } -int Halftone::ditherFloydSteinberg(uchar *dst, const uchar* a_src, int x, int y, int width) +void Halftone::ditherFloydSteinberg(uchar *dst, const uchar* a_src, int x, int y, int width) { if (fErrorTables[fCurrentPlane] == NULL || fX != x || fCurrentPlane == 0 && fY != y - 1 || fCurrentPlane > 0 && fY != y || fWidth != width) { setupErrorBuffer(x, y, width);