< prev index next >
src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h
Print this page
*** 164,178 ****
--- 164,186 ----
} while (0)
#define StoreByteIndexedFrom1IntArgb(pRas, PREFIX, x, argb) \
StoreByteIndexedFrom1IntRgb(pRas, PREFIX, x, argb)
+ /* For colors with 0 or 255 value in R,G,B components
+ * we dont add error value based on dithering indices
+ * as it is not needed.
+ */
#define StoreByteIndexedFrom3ByteRgb(pRas, PREFIX, x, r, g, b) \
do { \
+ if(!(((r == 0) || (r == 255)) && \
+ ((g == 0) || (g == 255)) && \
+ ((b == 0) || (b == 255)))) { \
r += PREFIX ## rerr[PREFIX ## XDither]; \
g += PREFIX ## gerr[PREFIX ## XDither]; \
b += PREFIX ## berr[PREFIX ## XDither]; \
+ } \
ByteClamp3Components(r, g, b); \
(pRas)[x] = SurfaceData_InvColorMap(PREFIX ## InvLut, r, g, b); \
} while (0)
#define StoreByteIndexedFrom4ByteArgb(pRas, PREFIX, x, a, r, g, b) \
< prev index next >