File: | jdk/src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.c |
Warning: | line 209, column 10 Value stored to 'dstScan' during its initialization is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* |
2 | * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | * |
5 | * This code is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 only, as |
7 | * published by the Free Software Foundation. Oracle designates this |
8 | * particular file as subject to the "Classpath" exception as provided |
9 | * by Oracle in the LICENSE file that accompanied this code. |
10 | * |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
14 | * version 2 for more details (a copy is included in the LICENSE file that |
15 | * accompanied this code). |
16 | * |
17 | * You should have received a copy of the GNU General Public License version |
18 | * 2 along with this work; if not, write to the Free Software Foundation, |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
20 | * |
21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 | * or visit www.oracle.com if you need additional information or have any |
23 | * questions. |
24 | */ |
25 | |
26 | #include <string.h> |
27 | |
28 | #include "AnyByte.h" |
29 | #include "ByteIndexed.h" |
30 | #include "AlphaMacros.h" |
31 | |
32 | #include "IntArgb.h" |
33 | #include "IntArgbBm.h" |
34 | #include "IntArgbPre.h" |
35 | #include "IntRgb.h" |
36 | #include "ThreeByteBgr.h" |
37 | #include "ByteGray.h" |
38 | #include "Index12Gray.h" |
39 | |
40 | /* |
41 | * This file declares, registers, and defines the various graphics |
42 | * primitive loops to manipulate surfaces of type "ByteIndexed". |
43 | * |
44 | * See also LoopMacros.h |
45 | */ |
46 | |
47 | RegisterFunc RegisterByteIndexed; |
48 | |
49 | DECLARE_CONVERT_BLIT(IntArgb, ByteIndexed)BlitFunc IntArgbToByteIndexedConvert; |
50 | DECLARE_CONVERT_BLIT(ThreeByteBgr, ByteIndexed)BlitFunc ThreeByteBgrToByteIndexedConvert; |
51 | DECLARE_CONVERT_BLIT(ByteGray, ByteIndexed)BlitFunc ByteGrayToByteIndexedConvert; |
52 | DECLARE_CONVERT_BLIT(ByteIndexed, ByteIndexed)BlitFunc ByteIndexedToByteIndexedConvert; |
53 | DECLARE_CONVERT_BLIT(Index12Gray, ByteIndexed)BlitFunc Index12GrayToByteIndexedConvert; |
54 | DECLARE_SCALE_BLIT(IntArgb, ByteIndexed)ScaleBlitFunc IntArgbToByteIndexedScaleConvert; |
55 | DECLARE_SCALE_BLIT(ThreeByteBgr, ByteIndexed)ScaleBlitFunc ThreeByteBgrToByteIndexedScaleConvert; |
56 | DECLARE_SCALE_BLIT(ByteGray, ByteIndexed)ScaleBlitFunc ByteGrayToByteIndexedScaleConvert; |
57 | DECLARE_SCALE_BLIT(Index12Gray, ByteIndexed)ScaleBlitFunc Index12GrayToByteIndexedScaleConvert; |
58 | DECLARE_SCALE_BLIT(ByteIndexed, ByteIndexed)ScaleBlitFunc ByteIndexedToByteIndexedScaleConvert; |
59 | DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, ByteIndexed)BlitFunc ByteIndexedBmToByteIndexedXparOver; |
60 | DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, ByteIndexed)ScaleBlitFunc ByteIndexedBmToByteIndexedScaleXparOver; |
61 | DECLARE_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed)ScaleBlitFunc IntArgbBmToByteIndexedScaleXparOver; |
62 | DECLARE_XPAR_BLITBG(ByteIndexedBm, ByteIndexed)BlitBgFunc ByteIndexedBmToByteIndexedXparBgCopy; |
63 | DECLARE_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed)BlitFunc IntArgbBmToByteIndexedXparOver; |
64 | DECLARE_XPAR_BLITBG(IntArgbBm, ByteIndexed)BlitBgFunc IntArgbBmToByteIndexedXparBgCopy; |
65 | |
66 | DECLARE_XOR_BLIT(IntArgb, ByteIndexed)BlitFunc IntArgbToByteIndexedXorBlit; |
67 | DECLARE_ALPHA_MASKFILL(ByteIndexed)MaskFillFunc ByteIndexedAlphaMaskFill; |
68 | DECLARE_ALPHA_MASKBLIT(IntArgb, ByteIndexed)MaskBlitFunc IntArgbToByteIndexedAlphaMaskBlit; |
69 | DECLARE_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed)MaskBlitFunc IntArgbPreToByteIndexedAlphaMaskBlit; |
70 | DECLARE_ALPHA_MASKBLIT(IntRgb, ByteIndexed)MaskBlitFunc IntRgbToByteIndexedAlphaMaskBlit; |
71 | DECLARE_SOLID_DRAWGLYPHLISTAA(ByteIndexed)DrawGlyphListAAFunc ByteIndexedDrawGlyphListAA; |
72 | |
73 | DECLARE_TRANSFORMHELPER_FUNCS(ByteIndexed)TransformHelperFunc ByteIndexedNrstNbrTransformHelper; TransformHelperFunc ByteIndexedBilinearTransformHelper; TransformHelperFunc ByteIndexedBicubicTransformHelper ; TransformHelperFuncs ByteIndexedTransformHelperFuncs; |
74 | DECLARE_TRANSFORMHELPER_FUNCS(ByteIndexedBm)TransformHelperFunc ByteIndexedBmNrstNbrTransformHelper; TransformHelperFunc ByteIndexedBmBilinearTransformHelper; TransformHelperFunc ByteIndexedBmBicubicTransformHelper ; TransformHelperFuncs ByteIndexedBmTransformHelperFuncs; |
75 | |
76 | NativePrimitive ByteIndexedPrimitives[] = { |
77 | REGISTER_CONVERT_BLIT(IntArgb, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedConvert }, {IntArgbToByteIndexedConvert}, 0, 0 }, |
78 | REGISTER_CONVERT_BLIT_EQUIV(IntRgb, ByteIndexed,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedConvert }, {IntArgbToByteIndexedConvert}, 0, 0 } |
79 | NAME_CONVERT_BLIT(IntArgb, ByteIndexed)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedConvert }, {IntArgbToByteIndexedConvert}, 0, 0 }, |
80 | REGISTER_CONVERT_BLIT_EQUIV(IntArgbBm, ByteIndexed,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedConvert }, {IntArgbToByteIndexedConvert}, 0, 0 } |
81 | NAME_CONVERT_BLIT(IntArgb, ByteIndexed)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedConvert }, {IntArgbToByteIndexedConvert}, 0, 0 }, |
82 | REGISTER_CONVERT_BLIT(ThreeByteBgr, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ThreeByteBgr, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ThreeByteBgrToByteIndexedConvert}, {ThreeByteBgrToByteIndexedConvert }, 0, 0 }, |
83 | REGISTER_CONVERT_BLIT(ByteGray, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteGray, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {ByteGrayToByteIndexedConvert }, {ByteGrayToByteIndexedConvert}, 0, 0 }, |
84 | REGISTER_CONVERT_BLIT(Index12Gray, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {Index12GrayToByteIndexedConvert }, {Index12GrayToByteIndexedConvert}, 0, 0 }, |
85 | REGISTER_CONVERT_BLIT_FLAGS(ByteIndexed, ByteIndexed, 0, SD_LOCK_LUT){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexed, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {ByteIndexedToByteIndexedConvert }, {ByteIndexedToByteIndexedConvert}, 0, (1 << 2), }, |
86 | REGISTER_SCALE_BLIT(IntArgb, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgb , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {IntArgbToByteIndexedScaleConvert}, {IntArgbToByteIndexedScaleConvert }, 0, 0 }, |
87 | REGISTER_SCALE_BLIT_EQUIV(IntRgb, ByteIndexed,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {IntArgbToByteIndexedScaleConvert}, {IntArgbToByteIndexedScaleConvert }, 0, 0 } |
88 | NAME_SCALE_BLIT(IntArgb, ByteIndexed)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {IntArgbToByteIndexedScaleConvert}, {IntArgbToByteIndexedScaleConvert }, 0, 0 }, |
89 | REGISTER_SCALE_BLIT_EQUIV(IntArgbBm, ByteIndexed,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {IntArgbToByteIndexedScaleConvert}, {IntArgbToByteIndexedScaleConvert }, 0, 0 } |
90 | NAME_SCALE_BLIT(IntArgb, ByteIndexed)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {IntArgbToByteIndexedScaleConvert}, {IntArgbToByteIndexedScaleConvert }, 0, 0 }, |
91 | REGISTER_SCALE_BLIT(ThreeByteBgr, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ThreeByteBgr , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ThreeByteBgrToByteIndexedScaleConvert}, {ThreeByteBgrToByteIndexedScaleConvert }, 0, 0 }, |
92 | REGISTER_SCALE_BLIT(ByteGray, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ByteGrayToByteIndexedScaleConvert}, {ByteGrayToByteIndexedScaleConvert }, 0, 0 }, |
93 | REGISTER_SCALE_BLIT(Index12Gray, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {Index12GrayToByteIndexedScaleConvert}, {Index12GrayToByteIndexedScaleConvert }, 0, 0 }, |
94 | REGISTER_SCALE_BLIT_FLAGS(ByteIndexed, ByteIndexed, 0, SD_LOCK_LUT){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ByteIndexedToByteIndexedScaleConvert}, {ByteIndexedToByteIndexedScaleConvert }, 0, (1 << 2), }, |
95 | REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.ByteIndexed , {ByteIndexedBmToByteIndexedXparOver}, {ByteIndexedBmToByteIndexedXparOver }, 0, 0 }, |
96 | REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.ByteIndexed , {ByteIndexedBmToByteIndexedScaleXparOver}, {ByteIndexedBmToByteIndexedScaleXparOver }, 0, 0 }, |
97 | REGISTER_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgbBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.ByteIndexed , {IntArgbBmToByteIndexedScaleXparOver}, {IntArgbBmToByteIndexedScaleXparOver }, 0, 0 }, |
98 | REGISTER_XPAR_BLITBG(ByteIndexedBm, ByteIndexed){ & PrimitiveTypes.BlitBg, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ByteIndexedBmToByteIndexedXparBgCopy}, {ByteIndexedBmToByteIndexedXparBgCopy }, 0, 0 }, |
99 | REGISTER_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.ByteIndexed , {IntArgbBmToByteIndexedXparOver}, {IntArgbBmToByteIndexedXparOver }, 0, 0 }, |
100 | REGISTER_XPAR_BLITBG(IntArgbBm, ByteIndexed){ & PrimitiveTypes.BlitBg, & SurfaceTypes.IntArgbBm, & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed, {IntArgbBmToByteIndexedXparBgCopy }, {IntArgbBmToByteIndexedXparBgCopy}, 0, 0 }, |
101 | |
102 | REGISTER_XOR_BLIT(IntArgb, ByteIndexed){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.Xor, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedXorBlit }, {IntArgbToByteIndexedXorBlit}, 0, 0 }, |
103 | REGISTER_ALPHA_MASKFILL(ByteIndexed){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.AnyAlpha, & SurfaceTypes.ByteIndexed , {ByteIndexedAlphaMaskFill}, {ByteIndexedAlphaMaskFill}, 0, 0 }, |
104 | REGISTER_ALPHA_MASKBLIT(IntArgb, ByteIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.ByteIndexed, {IntArgbToByteIndexedAlphaMaskBlit }, {IntArgbToByteIndexedAlphaMaskBlit}, 0, 0 }, |
105 | REGISTER_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.AnyAlpha, & SurfaceTypes.ByteIndexed , {IntArgbPreToByteIndexedAlphaMaskBlit}, {IntArgbPreToByteIndexedAlphaMaskBlit }, 0, 0 }, |
106 | REGISTER_ALPHA_MASKBLIT(IntRgb, ByteIndexed){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntRgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.ByteIndexed, {IntRgbToByteIndexedAlphaMaskBlit }, {IntRgbToByteIndexedAlphaMaskBlit}, 0, 0 }, |
107 | REGISTER_SOLID_DRAWGLYPHLISTAA(ByteIndexed){ & PrimitiveTypes.DrawGlyphListAA, & SurfaceTypes.AnyColor , & CompositeTypes.SrcNoEa, & SurfaceTypes.ByteIndexed , {ByteIndexedDrawGlyphListAA}, {ByteIndexedDrawGlyphListAA}, 0, 0 }, |
108 | |
109 | REGISTER_TRANSFORMHELPER_FUNCS(ByteIndexed){ & PrimitiveTypes.TransformHelper, & SurfaceTypes.ByteIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgbPre , {(AnyFunc *) &ByteIndexedTransformHelperFuncs}, {(AnyFunc *) &ByteIndexedTransformHelperFuncs}, 0, 0 }, |
110 | REGISTER_TRANSFORMHELPER_FUNCS(ByteIndexedBm){ & PrimitiveTypes.TransformHelper, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgbPre , {(AnyFunc *) &ByteIndexedBmTransformHelperFuncs}, {(AnyFunc *) &ByteIndexedBmTransformHelperFuncs}, 0, 0 }, |
111 | }; |
112 | |
113 | jboolean RegisterByteIndexed(JNIEnv *env) |
114 | { |
115 | return RegisterPrimitives(env, ByteIndexedPrimitives, |
116 | ArraySize(ByteIndexedPrimitives)(sizeof(ByteIndexedPrimitives) / sizeof(ByteIndexedPrimitives [0]))); |
117 | } |
118 | |
119 | jint PixelForByteIndexed(SurfaceDataRasInfo *pRasInfo, jint rgb) |
120 | { |
121 | jint r, g, b; |
122 | ExtractIntDcmComponentsX123(rgb, r, g, b)do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); |
123 | return SurfaceData_InvColorMap(pRasInfo->invColorTable, r, g, b)(pRasInfo->invColorTable)[((((unsigned char) r) >> 3 )<<10) + ((((unsigned char) g) >> 3)<<5) + ( ((unsigned char) b) >> 3)]; |
124 | } |
125 | |
126 | jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut, |
127 | SurfaceDataRasInfo *pSrcInfo, |
128 | SurfaceDataRasInfo *pDstInfo) |
129 | { |
130 | if (SrcReadLut != DstReadLut) { |
131 | juint lutSize = pSrcInfo->lutSize; |
132 | if (lutSize > pDstInfo->lutSize) { |
133 | return JNI_FALSE0; |
134 | } else { |
135 | juint i; |
136 | for (i = 0; i < lutSize; i++) { |
137 | if (SrcReadLut[i] != DstReadLut[i]) { |
138 | return JNI_FALSE0; |
139 | } |
140 | } |
141 | } |
142 | } |
143 | return JNI_TRUE1; |
144 | } |
145 | |
146 | DEFINE_CONVERT_BLIT(IntArgb, ByteIndexed, 3ByteRgb)void IntArgbToByteIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 4; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint pixel = (pSrc)[0]; do { (b) = (pixel) & 0xff; (g) = ((pixel) >> 8) & 0xff; (r) = ((pixel) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && (( g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
147 | |
148 | DEFINE_CONVERT_BLIT(ThreeByteBgr, ByteIndexed, 3ByteRgb)void ThreeByteBgrToByteIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { ThreeByteBgrDataType *pSrc = (ThreeByteBgrDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 3; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { (b) = (pSrc)[3*(0)+0]; (g ) = (pSrc)[3*(0)+1]; (r) = (pSrc)[3*(0)+2]; } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (3))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
149 | |
150 | DEFINE_CONVERT_BLIT(ByteGray, ByteIndexed, 3ByteRgb)void ByteGrayToByteIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { ByteGrayDataType *pSrc = (ByteGrayDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 1; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; ((r) = (g) = (b) = (pSrc)[0]); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || ( g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
151 | |
152 | DEFINE_CONVERT_BLIT(Index12Gray, ByteIndexed, 3ByteRgb)void Index12GrayToByteIndexedConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; SrcReadLut = (pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 2; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; r = g = b = (jubyte)SrcReadLut [pSrc[0] & 0xfff]; do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (1) )); DstWriteXDither = (DstWriteXDither + 1) & 7; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
153 | |
154 | void NAME_CONVERT_BLIT(ByteIndexed, ByteIndexed)ByteIndexedToByteIndexedConvert |
155 | (void *srcBase, void *dstBase, |
156 | juint width, juint height, |
157 | SurfaceDataRasInfo *pSrcInfo, |
158 | SurfaceDataRasInfo *pDstInfo, |
159 | NativePrimitive *pPrim, |
160 | CompositeInfo *pCompInfo) |
161 | { |
162 | DeclareByteIndexedLoadVars(SrcRead)jint *SrcReadLut; |
163 | DeclareByteIndexedLoadVars(DstRead)jint *DstReadLut; |
164 | jint srcScan = pSrcInfo->scanStride; |
165 | jint dstScan = pDstInfo->scanStride; |
166 | |
167 | InitByteIndexedLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
168 | InitByteIndexedLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
169 | |
170 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
171 | do { |
172 | memcpy(dstBase, srcBase, width); |
173 | srcBase = PtrAddBytes(srcBase, srcScan)((void *) (((intptr_t) (srcBase)) + (srcScan))); |
174 | dstBase = PtrAddBytes(dstBase, dstScan)((void *) (((intptr_t) (dstBase)) + (dstScan))); |
175 | } while (--height > 0); |
176 | } else { |
177 | DeclareByteIndexedStoreVars(DstWrite)int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char * DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ;; |
178 | |
179 | BlitLoopWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
180 | ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
181 | width, height,do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
182 | ConvertVia3ByteRgbdo { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
183 | (pSrc, ByteIndexed, SrcRead,do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0) |
184 | pDst, ByteIndexed, DstWrite, 0, 0))do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); srcScan -= (width) * 1 ; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[0]]; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); |
185 | } |
186 | } |
187 | |
188 | DEFINE_SCALE_BLIT(IntArgb, ByteIndexed, 3ByteRgb)void IntArgbToByteIndexedScaleConvert(void *srcBase, void *dstBase , juint width, juint height, jint sxloc, jint syloc, jint sxinc , jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { IntArgbDataType *pSrc; ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint pixel = (pSrc)[x]; do { (b) = (pixel) & 0xff; (g) = ((pixel) >> 8) & 0xff; (r) = ((pixel) >> 16) & 0xff; } while (0); } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
189 | |
190 | DEFINE_SCALE_BLIT(ThreeByteBgr, ByteIndexed, 3ByteRgb)void ThreeByteBgrToByteIndexedScaleConvert(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { ThreeByteBgrDataType *pSrc; ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { (b) = (pSrc)[3*(x)+0]; (g) = (pSrc)[3*(x)+1]; (r) = (pSrc)[3*(x)+2 ]; } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
191 | |
192 | DEFINE_SCALE_BLIT(ByteGray, ByteIndexed, 3ByteRgb)void ByteGrayToByteIndexedScaleConvert(void *srcBase, void *dstBase , juint width, juint height, jint sxloc, jint syloc, jint sxinc , jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { ByteGrayDataType *pSrc; ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; ((r) = (g) = (b) = (pSrc)[x]); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); } |
193 | |
194 | DEFINE_SCALE_BLIT(Index12Gray, ByteIndexed, 3ByteRgb)void Index12GrayToByteIndexedScaleConvert(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; int DstWriteXDither, DstWriteYDither , DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr ; unsigned char *DstWriteInvLut; SrcReadLut = (pSrcInfo)-> lutBase; do { Index12GrayDataType *pSrc; ByteIndexedDataType * pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; r = g = b = (jubyte)SrcReadLut[pSrc[x] & 0xfff]; do { if (!(((r == 0 ) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) ( pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while ( --height > 0); } while (0); } |
195 | |
196 | void NAME_SCALE_BLIT(ByteIndexed, ByteIndexed)ByteIndexedToByteIndexedScaleConvert |
197 | (void *srcBase, void *dstBase, |
198 | juint width, juint height, |
199 | jint sxloc, jint syloc, |
200 | jint sxinc, jint syinc, jint shift, |
201 | SurfaceDataRasInfo *pSrcInfo, |
202 | SurfaceDataRasInfo *pDstInfo, |
203 | NativePrimitive *pPrim, |
204 | CompositeInfo *pCompInfo) |
205 | { |
206 | DeclareByteIndexedLoadVars(SrcRead)jint *SrcReadLut; |
207 | DeclareByteIndexedLoadVars(DstRead)jint *DstReadLut; |
208 | jint srcScan = pSrcInfo->scanStride; |
209 | jint dstScan = pDstInfo->scanStride; |
Value stored to 'dstScan' during its initialization is never read | |
210 | DeclareByteIndexedStoreVars(DstWrite)int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char * DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut ; |
211 | |
212 | InitByteIndexedLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
213 | InitByteIndexedLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
214 | |
215 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
216 | BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
217 | ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
218 | x, width, height,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
219 | sxloc, syloc, sxinc, syinc, shift,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
220 | pDst[0] = pSrc[x])do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); |
221 | } else { |
222 | BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
223 | ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
224 | x, width, height,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
225 | sxloc, syloc, sxinc, syinc, shift,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
226 | ConvertVia3ByteRgb(pSrc, ByteIndexed, SrcRead,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
227 | pDst, ByteIndexed, DstWrite,do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0) |
228 | x, 0))do { ByteIndexedDataType *pSrc; ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint r, g, b; do { jint rgb = SrcReadLut[pSrc[x]]; do { (b) = (rgb) & 0xff; (g) = (( rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while ( --w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while (--height > 0); } while (0); |
229 | } |
230 | } |
231 | |
232 | DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)void ByteIndexedBmToByteIndexedXparOver(void *srcBase, void * dstBase, juint width, juint height, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint *pixLutLut; pixLutLut = (pSrcInfo)-> lutBase; do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 1; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint argb; (argb) = pixLutLut[pSrc[0]]; if ( argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff ; (g) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff; } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
233 | |
234 | DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)void ByteIndexedBmToByteIndexedScaleXparOver(void *srcBase, void *dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo , SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint *pixLutLut; pixLutLut = (pSrcInfo)-> lutBase; do { ByteIndexedBmDataType *pSrc; ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint argb; (argb) = pixLutLut [pSrc[x]]; if (argb < 0) { do { int r, g, b; do { (b) = (argb ) & 0xff; (g) = ((argb) >> 8) & 0xff; (r) = ((argb ) >> 16) & 0xff; } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ( (b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) ( pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while ( --height > 0); } while (0); } |
235 | |
236 | DEFINE_XPAR_SCALE_BLIT(IntArgbBm, ByteIndexed, 1IntRgb)void IntArgbBmToByteIndexedScaleXparOver(void *srcBase, void * dstBase, juint width, juint height, jint sxloc, jint syloc, jint sxinc, jint syinc, jint shift, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; ; do { IntArgbBmDataType *pSrc; ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t ) ((syloc >> shift))) * (srcScan)))); do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint x = (tmpsxloc >> shift); do { jint XparLoad;; (XparLoad ) = (pSrc)[x]; if (! ((((XparLoad) >> 24) == 0))) { int rgb; (rgb) = (XparLoad); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff; } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) ( pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); syloc += syinc; } while ( --height > 0); } while (0); } |
237 | |
238 | DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, ByteIndexed, ConvertOnTheFly)void ByteIndexedBmToByteIndexedXparBgCopy(void *srcBase, void *dstBase, juint width, juint height, jint bgpixel, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim , CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither , DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr ; unsigned char *DstWriteInvLut; jint *pixLutLut; ; do { pixLutLut = (pSrcInfo)->lutBase; ; } while (0); do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 1; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint argb; (argb) = pixLutLut[pSrc[0]]; if ( argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff ; (g) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff; } while (0); do { if (!(((r == 0) || (r == 255 )) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr [DstWriteXDither]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr [DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255 ; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255; } } while (0); do { if (((b) >> 8) != 0 ) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } else { (pDst)[0] = (jubyte) (bgpixel); } } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
239 | |
240 | DEFINE_XPAR_CONVERT_BLIT(IntArgbBm, ByteIndexed, 1IntRgb)void IntArgbBmToByteIndexedXparOver(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char * DstWriteInvLut; ; do { IntArgbBmDataType *pSrc = (IntArgbBmDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 4; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint XparLoad;; (XparLoad) = (pSrc)[0]; if ( ! ((((XparLoad) >> 24) == 0))) { int rgb; (rgb) = (XparLoad ); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb ) >> 8) & 0xff; (r) = ((rgb) >> 16) & 0xff ; } while (0); do { if (!(((r == 0) || (r == 255)) && ((g == 0) || (g == 255)) && ((b == 0) || (b == 255)) && DstWriteRepPrims)) { r += DstWritererr[DstWriteXDither ]; g += DstWritegerr[DstWriteXDither]; b += DstWriteberr[DstWriteXDither ]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0) {g = (~(g >> 31)) & 255 ; } } while (0); do { if (((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0); } while (0); } } while (0); pSrc = ((void * ) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc )) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
241 | |
242 | DEFINE_XPAR_BLITBG(IntArgbBm, ByteIndexed, 1IntRgb)void IntArgbBmToByteIndexedXparBgCopy(void *srcBase, void *dstBase , juint width, juint height, jint bgpixel, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim , CompositeInfo *pCompInfo) { int DstWriteXDither, DstWriteYDither , DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr ; unsigned char *DstWriteInvLut; ; do { IntArgbBmDataType *pSrc = (IntArgbBmDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 4; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint XparLoad;; (XparLoad) = (pSrc)[0]; if ( (((XparLoad) >> 24) == 0)) { (pDst)[0] = (jubyte) (bgpixel ); } else { int rgb; (rgb) = (XparLoad); do { int r, g, b; do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); do { if ( !(((r == 0) || (r == 255)) && ((g == 0) || (g == 255) ) && ((b == 0) || (b == 255)) && DstWriteRepPrims )) { r += DstWritererr[DstWriteXDither]; g += DstWritegerr[DstWriteXDither ]; b += DstWriteberr[DstWriteXDither]; } do { if (((r|g|b) >> 8) != 0) { do { if (((r) >> 8) != 0) {r = (~(r >> 31)) & 255; } } while (0); do { if (((g) >> 8) != 0 ) {g = (~(g >> 31)) & 255; } } while (0); do { if ( ((b) >> 8) != 0) {b = (~(b >> 31)) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut)[((((unsigned char) r) >> 3)<<10) + ((((unsigned char) g) >> 3)<<5) + (((unsigned char) b) >> 3)]; } while (0 ); } while (0); } } while (0); pSrc = ((void *) (((intptr_t) ( pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))) ; DstWriteXDither = (DstWriteXDither + 1) & 7; } while (-- w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan)) ); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
243 | |
244 | DEFINE_XOR_BLIT(IntArgb, ByteIndexed, AnyByte)void IntArgbToByteIndexedXorBlit(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint xorpixel = pCompInfo->details.xorPixel; juint alphamask = pCompInfo->alphaMask; int DstWriteXDither, DstWriteYDither , DstWriteRepPrims; char *DstWritererr, *DstWritegerr, *DstWriteberr ; unsigned char *DstWriteInvLut; ; ; ; do { IntArgbDataType * pSrc = (IntArgbDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable ; DstWriteRepPrims = (pDstInfo)->representsPrimaries; } while (0); srcScan -= (width) * 4; dstScan -= (width) * 1; do { juint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { do { jint srcpixel; (srcpixel) = (pSrc)[0]; if (( ((jint) srcpixel) >= 0)) { break; } do { jint r, g, b; do { (b) = (srcpixel) & 0xff; (g) = ((srcpixel) >> 8) & 0xff; (r) = ((srcpixel) >> 16) & 0xff; } while (0) ; (srcpixel) = ((pDstInfo)->invColorTable)[((((unsigned char ) r) >> 3)<<10) + ((((unsigned char) g) >> 3 )<<5) + (((unsigned char) b) >> 3)]; } while (0); ; (pDst)[0] ^= (((srcpixel) ^ (xorpixel)) & ~(alphamask) ); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))) ; pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); } while (--height > 0); } while (0); } |
245 | |
246 | DEFINE_ALPHA_MASKFILL(ByteIndexed, 4ByteArgb)void ByteIndexedAlphaMaskFill (void *rasBase, jubyte *pMask, jint maskOff, jint maskScan, jint width, jint height, jint fgColor , SurfaceDataRasInfo *pRasInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA; jint srcR, srcG, srcB; jint dstA = 0; jint dstF; jint dstFbase; jint rasScan = pRasInfo->scanStride; jboolean loaddst; ByteIndexedDataType *pRas = (ByteIndexedDataType *) (rasBase); jint *DstPixLut; jint DstPixrgb; int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd , DstOpXor, DstOpAdd; do { (srcB) = (fgColor) & 0xff; (srcG ) = ((fgColor) >> 8) & 0xff; (srcR) = ((fgColor) >> 16) & 0xff; (srcA) = ((fgColor) >> 24) & 0xff; } while (0); if (srcA != 0xff) { do { srcR = mul8table[srcA] [srcR]; srcG = mul8table[srcA][srcG]; srcB = mul8table[srcA][ srcB]; } while (0); } do { SrcOpAnd = (AlphaRules[pCompInfo-> rule].srcOps).andval; SrcOpXor = (AlphaRules[pCompInfo->rule ].srcOps).xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo-> rule].srcOps).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules[pCompInfo->rule].dstOps).andval; DstOpXor = ( AlphaRules[pCompInfo->rule].dstOps).xorval; DstOpAdd = (jint ) (AlphaRules[pCompInfo->rule].dstOps).addval - DstOpXor; } while (0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); dstFbase = dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd); do { DstPixLut = (pRasInfo)->lutBase ; DstPixrgb = 0; } while (0); rasScan -= width * 1; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pRasInfo)->bounds.y1 & 7) << 3); } while ( 0); DstWriteInvLut = (pRasInfo)->invColorTable; DstWriteRepPrims = (pRasInfo)->representsPrimaries; } while (0); do { jint w = width; do { DstWritererr = (pRasInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pRasInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pRasInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pRasInfo)->bounds.x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB; jint srcF; if ( pMask) { pathA = *pMask++; if (!pathA) { pRas = ((void *) ((( intptr_t) (pRas)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; dstF = dstFbase; } if (loaddst) { do { DstPixrgb = DstPixLut[(pRas)[0]]; dstA = ((juint) DstPixrgb ) >> 24; } while (0); } srcF = ((((dstA) & SrcOpAnd ) ^ SrcOpXor) + SrcOpAdd); if (pathA != 0xff) { srcF = mul8table [pathA][srcF]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { if (srcF == 0xff) { resA = srcA; do { resR = srcR ; resG = srcG; resB = srcB; } while (0); } else { resA = mul8table [srcF][srcA]; do { resR = mul8table[srcF][srcR]; resG = mul8table [srcF][srcG]; resB = mul8table[srcF][srcB]; } while (0); } } else { if (dstF == 0xff) { pRas = ((void *) (((intptr_t) (pRas)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue ; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table [dstF][dstA]; resA += dstA; if (0) { dstA = dstF; } if (dstA) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff; } while (0); if (dstA != 0xff ) { do { tmpR = mul8table[dstA][tmpR]; tmpG = mul8table[dstA] [tmpG]; tmpB = mul8table[dstA][tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!( 0) && resA && resA < 0xff) { do { resR = div8table [resA][resR]; resG = div8table[resA][resG]; resB = div8table[ resA][resB]; } while (0); } do { if (!(((resR == 0) || (resR == 255)) && ((resG == 0) || (resG == 255)) && ( (resB == 0) || (resB == 255)) && DstWriteRepPrims)) { resR += DstWritererr[DstWriteXDither]; resG += DstWritegerr[ DstWriteXDither]; resB += DstWriteberr[DstWriteXDither]; } do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31)) & 255; } } while ( 0); } } while (0); (pRas)[0] = (DstWriteInvLut)[((((unsigned char ) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pRas = ((void *) (((intptr_t) (pRas)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pRas = ((void *) (((intptr_t) (pRas)) + (rasScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan ))); } } while (--height > 0); } |
247 | |
248 | DEFINE_ALPHA_MASKBLIT(IntArgb, ByteIndexed, 4ByteArgb)void IntArgbToByteIndexedAlphaMaskBlit (void *dstBase, void * srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo-> scanStride; jboolean loadsrc, loaddst; IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); ByteIndexedDataType *pDst = ( ByteIndexedDataType *) (dstBase); jint SrcPix; jint *DstPixLut ; jint DstPixrgb; int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd , DstOpXor, DstOpAdd; do { SrcOpAnd = (AlphaRules[pCompInfo-> rule].srcOps).andval; SrcOpXor = (AlphaRules[pCompInfo->rule ].srcOps).xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo-> rule].srcOps).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules[pCompInfo->rule].dstOps).andval; DstOpXor = ( AlphaRules[pCompInfo->rule].dstOps).xorval; DstOpAdd = (jint ) (AlphaRules[pCompInfo->rule].dstOps).addval - DstOpXor; } while (0); loadsrc = !((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || ( SrcOpAnd != 0); SrcPix = 0; do { DstPixLut = (pDstInfo)->lutBase ; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 1; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries ; } while (0); do { jint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { jint resA; jint resR , resG, resB; jint srcF; jint dstF; if (pMask) { pathA = *pMask ++; if (!pathA) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4) )); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc ) { do { SrcPix = (pSrc)[0]; srcA = ((juint) SrcPix) >> 24; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst ) { do { DstPixrgb = DstPixLut[(pDst)[0]]; dstA = ((juint) DstPixrgb ) >> 24; } while (0); } srcF = ((((dstA) & SrcOpAnd ) ^ SrcOpXor) + SrcOpAdd); dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd); if (pathA != 0xff) { srcF = mul8table [pathA][srcF]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table[srcF][srcA]; if (!(0)) { srcF = resA; } else { srcF = mul8table[srcF][extraA]; } if (srcF) { do { resR = (SrcPix >> 16) & 0xff; resG = (SrcPix >> 8) & 0xff; resB = (SrcPix >> 0) & 0xff; } while (0); if (srcF != 0xff) { do { resR = mul8table[srcF][resR]; resG = mul8table[srcF][resG]; resB = mul8table[srcF][resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t ) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1 ))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue ; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff ; } while (0); if (dstF != 0xff) { do { tmpR = mul8table[dstF ][tmpR]; tmpG = mul8table[dstF][tmpG]; tmpB = mul8table[dstF] [tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!(0) && resA && resA < 0xff) { do { resR = div8table[resA][resR]; resG = div8table [resA][resG]; resB = div8table[resA][resB]; } while (0); } do { if (!(((resR == 0) || (resR == 255)) && ((resG == 0 ) || (resG == 255)) && ((resB == 0) || (resB == 255)) && DstWriteRepPrims)) { resR += DstWritererr[DstWriteXDither ]; resG += DstWritegerr[DstWriteXDither]; resB += DstWriteberr [DstWriteXDither]; } do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31) ) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4 ))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (-- height > 0); } |
249 | |
250 | DEFINE_ALPHA_MASKBLIT(IntArgbPre, ByteIndexed, 4ByteArgb)void IntArgbPreToByteIndexedAlphaMaskBlit (void *dstBase, void *srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo-> scanStride; jboolean loadsrc, loaddst; IntArgbPreDataType *pSrc = (IntArgbPreDataType *) (srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint SrcPix; jint *DstPixLut ; jint DstPixrgb; int DstWriteXDither, DstWriteYDither, DstWriteRepPrims ; char *DstWritererr, *DstWritegerr, *DstWriteberr; unsigned char *DstWriteInvLut; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd , DstOpXor, DstOpAdd; do { SrcOpAnd = (AlphaRules[pCompInfo-> rule].srcOps).andval; SrcOpXor = (AlphaRules[pCompInfo->rule ].srcOps).xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo-> rule].srcOps).addval - SrcOpXor; } while (0); do { DstOpAnd = (AlphaRules[pCompInfo->rule].dstOps).andval; DstOpXor = ( AlphaRules[pCompInfo->rule].dstOps).xorval; DstOpAdd = (jint ) (AlphaRules[pCompInfo->rule].dstOps).addval - DstOpXor; } while (0); loadsrc = !((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !((DstOpAnd | DstOpAdd) == 0) || ( SrcOpAnd != 0); SrcPix = 0; do { DstPixLut = (pDstInfo)->lutBase ; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 1; maskScan -= width; if (pMask) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo)->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)-> invColorTable; DstWriteRepPrims = (pDstInfo)->representsPrimaries ; } while (0); do { jint w = width; do { DstWritererr = (pDstInfo )->redErrTable + DstWriteYDither; DstWritegerr = (pDstInfo )->grnErrTable + DstWriteYDither; DstWriteberr = (pDstInfo )->bluErrTable + DstWriteYDither; DstWriteXDither = ((pDstInfo )->bounds.x1 & 7); } while (0);; do { jint resA; jint resR , resG, resB; jint srcF; jint dstF; if (pMask) { pathA = *pMask ++; if (!pathA) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4) )); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc ) { do { SrcPix = (pSrc)[0]; srcA = ((juint) SrcPix) >> 24; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst ) { do { DstPixrgb = DstPixLut[(pDst)[0]]; dstA = ((juint) DstPixrgb ) >> 24; } while (0); } srcF = ((((dstA) & SrcOpAnd ) ^ SrcOpXor) + SrcOpAdd); dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd); if (pathA != 0xff) { srcF = mul8table [pathA][srcF]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table[srcF][srcA]; if (!(1)) { srcF = resA; } else { srcF = mul8table[srcF][extraA]; } if (srcF) { do { do { (resB) = (SrcPix) & 0xff; (resG) = ((SrcPix) >> 8) & 0xff; (resR) = ((SrcPix) >> 16) & 0xff; } while (0); } while (0); if (srcF != 0xff) { do { resR = mul8table [srcF][resR]; resG = mul8table[srcF][resG]; resB = mul8table[ srcF][resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + ( 4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpR , tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff; } while (0); if (dstF != 0xff) { do { tmpR = mul8table [dstF][tmpR]; tmpG = mul8table[dstF][tmpG]; tmpB = mul8table[ dstF][tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!(0) && resA && resA < 0xff) { do { resR = div8table[resA][resR]; resG = div8table [resA][resG]; resB = div8table[resA][resB]; } while (0); } do { if (!(((resR == 0) || (resR == 255)) && ((resG == 0 ) || (resG == 255)) && ((resB == 0) || (resB == 255)) && DstWriteRepPrims)) { resR += DstWritererr[DstWriteXDither ]; resG += DstWritegerr[DstWriteXDither]; resB += DstWriteberr [DstWriteXDither]; } do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31) ) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4 ))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (-- height > 0); } |
251 | |
252 | DEFINE_ALPHA_MASKBLIT(IntRgb, ByteIndexed, 4ByteArgb)void IntRgbToByteIndexedAlphaMaskBlit (void *dstBase, void *srcBase , jubyte *pMask, jint maskOff, jint maskScan, jint width, jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo , NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint pathA = 0xff; jint srcA = 0; jint dstA = 0; jint extraA = (jint)(pCompInfo ->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo ->scanStride; jint dstScan = pDstInfo->scanStride; jboolean loadsrc, loaddst; IntRgbDataType *pSrc = (IntRgbDataType *) ( srcBase); ByteIndexedDataType *pDst = (ByteIndexedDataType *) (dstBase); jint *DstPixLut; jint DstPixrgb; int DstWriteXDither , DstWriteYDither, DstWriteRepPrims; char *DstWritererr, *DstWritegerr , *DstWriteberr; unsigned char *DstWriteInvLut; jint SrcOpAnd , SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd; do { SrcOpAnd = (AlphaRules[pCompInfo->rule].srcOps).andval; SrcOpXor = (AlphaRules[pCompInfo->rule].srcOps).xorval; SrcOpAdd = (jint) (AlphaRules[pCompInfo->rule].srcOps).addval - SrcOpXor ; } while (0); do { DstOpAnd = (AlphaRules[pCompInfo->rule ].dstOps).andval; DstOpXor = (AlphaRules[pCompInfo->rule]. dstOps).xorval; DstOpAdd = (jint) (AlphaRules[pCompInfo->rule ].dstOps).addval - DstOpXor; } while (0); loadsrc = !((SrcOpAnd | SrcOpAdd) == 0) || (DstOpAnd != 0); loaddst = pMask || !(( DstOpAnd | DstOpAdd) == 0) || (SrcOpAnd != 0); ; do { DstPixLut = (pDstInfo)->lutBase; DstPixrgb = 0; } while (0); srcScan -= width * 4; dstScan -= width * 1; maskScan -= width; if (pMask ) { pMask += maskOff; } do { do { DstWriteYDither = (((pDstInfo )->bounds.y1 & 7) << 3); } while (0); DstWriteInvLut = (pDstInfo)->invColorTable; DstWriteRepPrims = (pDstInfo )->representsPrimaries; } while (0); do { jint w = width; do { DstWritererr = (pDstInfo)->redErrTable + DstWriteYDither ; DstWritegerr = (pDstInfo)->grnErrTable + DstWriteYDither ; DstWriteberr = (pDstInfo)->bluErrTable + DstWriteYDither ; DstWriteXDither = ((pDstInfo)->bounds.x1 & 7); } while (0);; do { jint resA; jint resR, resG, resB; jint srcF; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA) { pSrc = (( void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t ) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } ; } if (loadsrc) { srcA = 0xff; srcA = mul8table [extraA][srcA]; } if (loaddst) { do { DstPixrgb = DstPixLut[( pDst)[0]]; dstA = ((juint) DstPixrgb) >> 24; } while (0 ); } srcF = ((((dstA) & SrcOpAnd) ^ SrcOpXor) + SrcOpAdd) ; dstF = ((((srcA) & DstOpAnd) ^ DstOpXor) + DstOpAdd); if (pathA != 0xff) { srcF = mul8table[pathA][srcF]; dstF = 0xff - pathA + mul8table[pathA][dstF]; } if (srcF) { resA = mul8table [srcF][srcA]; if (!(0)) { srcF = resA; } else { srcF = mul8table [srcF][extraA]; } if (srcF) { do { jint pixel = (pSrc)[0]; do { (resB) = (pixel) & 0xff; (resG) = ((pixel) >> 8) & 0xff; (resR) = ((pixel) >> 16) & 0xff; } while (0); } while (0); if (srcF != 0xff) { do { resR = mul8table[ srcF][resR]; resG = mul8table[srcF][resG]; resB = mul8table[srcF ][resB]; } while (0); } } else { if (dstF == 0xff) { pSrc = ( (void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t ) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resR = resG = resB = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; continue; } resA = 0; resR = resG = resB = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpR, tmpG, tmpB; do { tmpR = (DstPixrgb >> 16) & 0xff; tmpG = (DstPixrgb >> 8) & 0xff; tmpB = (DstPixrgb >> 0) & 0xff ; } while (0); if (dstF != 0xff) { do { tmpR = mul8table[dstF ][tmpR]; tmpG = mul8table[dstF][tmpG]; tmpB = mul8table[dstF] [tmpB]; } while (0); } do { resR += tmpR; resG += tmpG; resB += tmpB; } while (0); } } if (!(0) && resA && resA < 0xff) { do { resR = div8table[resA][resR]; resG = div8table [resA][resG]; resB = div8table[resA][resB]; } while (0); } do { if (!(((resR == 0) || (resR == 255)) && ((resG == 0 ) || (resG == 255)) && ((resB == 0) || (resB == 255)) && DstWriteRepPrims)) { resR += DstWritererr[DstWriteXDither ]; resG += DstWritegerr[DstWriteXDither]; resB += DstWriteberr [DstWriteXDither]; } do { if (((resR|resG|resB) >> 8) != 0) { do { if (((resR) >> 8) != 0) {resR = (~(resR >> 31)) & 255; } } while (0); do { if (((resG) >> 8) != 0) {resG = (~(resG >> 31)) & 255; } } while (0); do { if (((resB) >> 8) != 0) {resB = (~(resB >> 31) ) & 255; } } while (0); } } while (0); (pDst)[0] = (DstWriteInvLut )[((((unsigned char) resR) >> 3)<<10) + ((((unsigned char) resG) >> 3)<<5) + (((unsigned char) resB) >> 3)]; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4 ))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); DstWriteXDither = (DstWriteXDither + 1) & 7; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void * ) (((intptr_t) (pDst)) + (dstScan))); DstWriteYDither = (DstWriteYDither + (1 << 3)) & (7 << 3); if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (-- height > 0); } |
253 | |
254 | DEFINE_SOLID_DRAWGLYPHLISTAA(ByteIndexed, 3ByteRgb)void ByteIndexedDrawGlyphListAA(SurfaceDataRasInfo *pRasInfo, ImageRef *glyphs, jint totalGlyphs, jint fgpixel, jint argbcolor , jint clipLeft, jint clipTop, jint clipRight, jint clipBottom , NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint glyphCounter ; jint scan = pRasInfo->scanStride; ByteIndexedDataType *pPix ; jint srcA; jint srcR, srcG, srcB; jint *pixLut; int pixXDither , pixYDither, pixRepPrims; char *pixrerr, *pixgerr, *pixberr; unsigned char *pixInvLut; pixLut = (pRasInfo)->lutBase; do { do { pixYDither = (((pRasInfo)->bounds.y1 & 7) << 3); } while (0); pixInvLut = (pRasInfo)->invColorTable; pixRepPrims = (pRasInfo)->representsPrimaries; } while (0); do { pixrerr = (pRasInfo)->redErrTable + pixYDither; pixgerr = (pRasInfo )->grnErrTable + pixYDither; pixberr = (pRasInfo)->bluErrTable + pixYDither; pixXDither = ((pRasInfo)->bounds.x1 & 7 ); } while (0);; do { (srcB) = (argbcolor) & 0xff; (srcG) = ((argbcolor) >> 8) & 0xff; (srcR) = ((argbcolor) >> 16) & 0xff; (srcA) = ((argbcolor) >> 24) & 0xff; } while (0); ; for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) { const jubyte * pixels; int rowBytes ; int left, top; int width, height; int right, bottom; pixels = (const jubyte *)glyphs[glyphCounter].pixels; if (!pixels) { continue; } rowBytes = glyphs[glyphCounter].rowBytes; left = glyphs[glyphCounter].x; top = glyphs[glyphCounter].y; width = glyphs[glyphCounter].width; height = glyphs[glyphCounter].height ; right = left + width; bottom = top + height; if (left < clipLeft ) { pixels += (clipLeft - left) * 1 ; left = clipLeft; } if ( top < clipTop) { pixels += (clipTop - top) * rowBytes; top = clipTop; } if (right > clipRight) { right = clipRight; } if (bottom > clipBottom) { bottom = clipBottom; } if (right <= left || bottom <= top) { continue; } width = right - left; height = bottom - top; pPix = ((void *) (((intptr_t) ( pRasInfo->rasBase)) + (((ptrdiff_t)(top))*(scan) + ((ptrdiff_t )(left))*(1)))); do { pixYDither = ((top & 7) << 3) ; } while (0); do { int x = 0; do { pixrerr = (pRasInfo)-> redErrTable + pixYDither; pixgerr = (pRasInfo)->grnErrTable + pixYDither; pixberr = (pRasInfo)->bluErrTable + pixYDither ; pixXDither = (left & 7); } while (0); do { do { jint dstR , dstG, dstB; jint mixValSrc = pixels[x]; if (mixValSrc) { if (mixValSrc < 255) { jint mixValDst = 255 - mixValSrc; do { jint rgb = pixLut[pPix[x]]; do { (dstB) = (rgb) & 0xff; ( dstG) = ((rgb) >> 8) & 0xff; (dstR) = ((rgb) >> 16) & 0xff; } while (0); } while (0); do { dstR = mul8table [mixValDst][dstR] + mul8table[mixValSrc][srcR]; dstG = mul8table [mixValDst][dstG] + mul8table[mixValSrc][srcG]; dstB = mul8table [mixValDst][dstB] + mul8table[mixValSrc][srcB]; } while (0); do { if (!(((dstR == 0) || (dstR == 255)) && ((dstG == 0 ) || (dstG == 255)) && ((dstB == 0) || (dstB == 255)) && pixRepPrims)) { dstR += pixrerr[pixXDither]; dstG += pixgerr[pixXDither]; dstB += pixberr[pixXDither]; } do { if (((dstR|dstG|dstB) >> 8) != 0) { do { if (((dstR) >> 8) != 0) {dstR = (~(dstR >> 31)) & 255; } } while ( 0); do { if (((dstG) >> 8) != 0) {dstG = (~(dstG >> 31)) & 255; } } while (0); do { if (((dstB) >> 8) != 0) {dstB = (~(dstB >> 31)) & 255; } } while (0); } } while (0); (pPix)[x] = (pixInvLut)[((((unsigned char) dstR ) >> 3)<<10) + ((((unsigned char) dstG) >> 3 )<<5) + (((unsigned char) dstB) >> 3)]; } while ( 0); } else { (pPix)[x] = (jubyte) (fgpixel); } } } while (0); ; pixXDither = (pixXDither + 1) & 7; } while (++x < width ); pPix = ((void *) (((intptr_t) (pPix)) + (scan))); pixels += rowBytes; pixYDither = (pixYDither + (1 << 3)) & ( 7 << 3); } while (--height > 0); } } |
255 | |
256 | DEFINE_TRANSFORMHELPERS(ByteIndexed)void ByteIndexedNrstNbrTransformHelper(SurfaceDataRasInfo *pSrcInfo , jint *pRGB, jint numpix, jlong xlong, jlong dxlong, jlong ylong , jlong dylong) { jint *SrcReadLut; ByteIndexedDataType *pBase = pSrcInfo->rasBase; jint scan = pSrcInfo->scanStride; jint *pEnd = pRGB + numpix; xlong += (((jlong) (pSrcInfo-> bounds.x1)) << 32); ylong += (((jlong) (pSrcInfo->bounds .y1)) << 32); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd) { ByteIndexedDataType *pRow = ((void *) ((( intptr_t) (pBase)) + (((intptr_t) (((jint) ((ylong) >> 32 )))) * (scan)))); do { jint argb = SrcReadLut[pRow[((jint) (( xlong) >> 32))]]; jint a = (((juint) (argb)) >> ( 24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table [a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | ( r)) << 8) | (g)) << 8) | (b)); } (pRGB)[0] = argb ; } while (0); pRGB++; xlong += dxlong; ylong += dylong; } } void ByteIndexedBilinearTransformHelper(SurfaceDataRasInfo *pSrcInfo , jint *pRGB, jint numpix, jlong xlong, jlong dxlong, jlong ylong , jlong dylong) { jint *SrcReadLut; jint scan = pSrcInfo-> scanStride; jint cx, cy, cw, ch; jint *pEnd = pRGB + numpix*4 ; cx = pSrcInfo->bounds.x1; cw = pSrcInfo->bounds.x2-cx ; cy = pSrcInfo->bounds.y1; ch = pSrcInfo->bounds.y2-cy ; xlong -= (((jlong) 1) << 31); ylong -= (((jlong) 1) << 31); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd ) { jint xwhole = ((jint) ((xlong) >> 32)); jint ywhole = ((jint) ((ylong) >> 32)); jint xdelta, ydelta, isneg ; ByteIndexedDataType *pRow; xdelta = ((juint) (xwhole + 1 - cw )) >> 31; isneg = xwhole >> 31; xwhole -= isneg; xdelta += isneg; ydelta = ((ywhole + 1 - ch) >> 31); isneg = ywhole >> 31; ywhole -= isneg; ydelta -= isneg; ydelta &= scan; xwhole += cx; pRow = ((void *) (((intptr_t) (pSrcInfo-> rasBase)) + (((intptr_t) (ywhole + cy)) * (scan)))); do { jint argb = SrcReadLut[pRow[xwhole]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8 ) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r ]; g = mul8table[a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } ( pRGB)[0] = argb; } while (0); do { jint argb = SrcReadLut[pRow [xwhole+xdelta]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff ; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table [a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | ( r)) << 8) | (g)) << 8) | (b)); } (pRGB)[1] = argb ; } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta ))); do { jint argb = SrcReadLut[pRow[xwhole]]; jint a = (((juint ) (argb)) >> (24)); if (a == 0) { argb = 0; } else if ( a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table[a][b ]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[2] = argb; } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8 ) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r ]; g = mul8table[a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } ( pRGB)[3] = argb; } while (0); pRGB += 4; xlong += dxlong; ylong += dylong; } } void ByteIndexedBicubicTransformHelper(SurfaceDataRasInfo *pSrcInfo, jint *pRGB, jint numpix, jlong xlong, jlong dxlong , jlong ylong, jlong dylong) { jint *SrcReadLut; jint scan = pSrcInfo ->scanStride; jint cx, cy, cw, ch; jint *pEnd = pRGB + numpix *16; cx = pSrcInfo->bounds.x1; cw = pSrcInfo->bounds.x2 -cx; cy = pSrcInfo->bounds.y1; ch = pSrcInfo->bounds.y2 -cy; xlong -= (((jlong) 1) << 31); ylong -= (((jlong) 1 ) << 31); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd) { jint xwhole = ((jint) ((xlong) >> 32)); jint ywhole = ((jint) ((ylong) >> 32)); jint xdelta0, xdelta1 , xdelta2; jint ydelta0, ydelta1, ydelta2; jint isneg; ByteIndexedDataType *pRow; xdelta0 = (-xwhole) >> 31; xdelta1 = ((juint) ( xwhole + 1 - cw)) >> 31; xdelta2 = ((juint) (xwhole + 2 - cw)) >> 31; isneg = xwhole >> 31; xwhole -= isneg ; xdelta1 += isneg; xdelta2 += xdelta1; ydelta0 = ((-ywhole) >> 31) & (-scan); ydelta1 = ((ywhole + 1 - ch) >> 31) & scan; ydelta2 = ((ywhole + 2 - ch) >> 31) & scan ; isneg = ywhole >> 31; ywhole -= isneg; ydelta1 += (isneg & -scan); xwhole += cx; pRow = ((void *) (((intptr_t) (pSrcInfo ->rasBase)) + (((intptr_t) (ywhole + cy)) * (scan)))); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta0))); do { jint argb = SrcReadLut[pRow[xwhole+xdelta0]]; jint a = (((juint) (argb )) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff ) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a] [r]; g = mul8table[a][g]; b = mul8table[a][b]; argb = ((((((( a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[0] = argb; } while (0); do { jint argb = SrcReadLut[pRow [xwhole]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][ g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[1] = argb; } while (0 ); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff ; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table[a][ b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[2] = argb; } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff ) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a] [r]; g = mul8table[a][g]; b = mul8table[a][b]; argb = ((((((( a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[3] = argb; } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (-ydelta0))); do { jint argb = SrcReadLut[pRow[xwhole +xdelta0]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][ g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[4] = argb; } while (0 ); do { jint argb = SrcReadLut[pRow[xwhole]]; jint a = (((juint ) (argb)) >> (24)); if (a == 0) { argb = 0; } else if ( a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table[a][b ]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[5] = argb; } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff ) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a] [r]; g = mul8table[a][g]; b = mul8table[a][b]; argb = ((((((( a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[6] = argb; } while (0); do { jint argb = SrcReadLut[pRow [xwhole+xdelta2]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = ( argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table [a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | ( r)) << 8) | (g)) << 8) | (b)); } (pRGB)[7] = argb ; } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta1 ))); do { jint argb = SrcReadLut[pRow[xwhole+xdelta0]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff ; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table [a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g) ) << 8) | (b)); } (pRGB)[8] = argb; } while (0); do { jint argb = SrcReadLut[pRow[xwhole]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8 ) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r ]; g = mul8table[a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } ( pRGB)[9] = argb; } while (0); do { jint argb = SrcReadLut[pRow [xwhole+xdelta1]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = ( argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table [a][g]; b = mul8table[a][b]; argb = (((((((a) << 8) | ( r)) << 8) | (g)) << 8) | (b)); } (pRGB)[10] = argb ; } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2 ]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table [a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g) ) << 8) | (b)); } (pRGB)[11] = argb; } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta2))); do { jint argb = SrcReadLut[pRow[xwhole+xdelta0]]; jint a = (((juint) (argb )) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff ) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a] [r]; g = mul8table[a][g]; b = mul8table[a][b]; argb = ((((((( a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[12] = argb; } while (0); do { jint argb = SrcReadLut[ pRow[xwhole]]; jint a = (((juint) (argb)) >> (24)); if ( a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][ g]; b = mul8table[a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g)) << 8) | (b)); } (pRGB)[13] = argb; } while ( 0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; jint a = (((juint) (argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff ; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table[a][r]; g = mul8table[a][g]; b = mul8table [a][b]; argb = (((((((a) << 8) | (r)) << 8) | (g) ) << 8) | (b)); } (pRGB)[14] = argb; } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2]]; jint a = (((juint) ( argb)) >> (24)); if (a == 0) { argb = 0; } else if (a < 0xff) { jint r = (argb >> 16) & 0xff; jint g = (argb >> 8) & 0xff; jint b = (argb ) & 0xff; r = mul8table [a][r]; g = mul8table[a][g]; b = mul8table[a][b]; argb = (((( (((a) << 8) | (r)) << 8) | (g)) << 8) | (b) ); } (pRGB)[15] = argb; } while (0); pRGB += 16; xlong += dxlong ; ylong += dylong; } } TransformHelperFuncs ByteIndexedTransformHelperFuncs = { ByteIndexedNrstNbrTransformHelper, ByteIndexedBilinearTransformHelper , ByteIndexedBicubicTransformHelper, }; |
257 | |
258 | DEFINE_TRANSFORMHELPERS(ByteIndexedBm)void ByteIndexedBmNrstNbrTransformHelper(SurfaceDataRasInfo * pSrcInfo, jint *pRGB, jint numpix, jlong xlong, jlong dxlong, jlong ylong, jlong dylong) { jint *SrcReadLut; ByteIndexedBmDataType *pBase = pSrcInfo->rasBase; jint scan = pSrcInfo->scanStride ; jint *pEnd = pRGB + numpix; xlong += (((jlong) (pSrcInfo-> bounds.x1)) << 32); ylong += (((jlong) (pSrcInfo->bounds .y1)) << 32); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd) { ByteIndexedBmDataType *pRow = ((void *) ( ((intptr_t) (pBase)) + (((intptr_t) (((jint) ((ylong) >> 32)))) * (scan)))); do { jint argb = SrcReadLut[pRow[((jint) ((xlong) >> 32))]]; (pRGB)[0] = argb & (argb >> 24); } while (0); pRGB++; xlong += dxlong; ylong += dylong; } } void ByteIndexedBmBilinearTransformHelper(SurfaceDataRasInfo *pSrcInfo, jint *pRGB, jint numpix, jlong xlong, jlong dxlong , jlong ylong, jlong dylong) { jint *SrcReadLut; jint scan = pSrcInfo ->scanStride; jint cx, cy, cw, ch; jint *pEnd = pRGB + numpix *4; cx = pSrcInfo->bounds.x1; cw = pSrcInfo->bounds.x2- cx; cy = pSrcInfo->bounds.y1; ch = pSrcInfo->bounds.y2- cy; xlong -= (((jlong) 1) << 31); ylong -= (((jlong) 1) << 31); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd) { jint xwhole = ((jint) ((xlong) >> 32)); jint ywhole = ((jint) ((ylong) >> 32)); jint xdelta, ydelta , isneg; ByteIndexedBmDataType *pRow; xdelta = ((juint) (xwhole + 1 - cw)) >> 31; isneg = xwhole >> 31; xwhole -= isneg; xdelta += isneg; ydelta = ((ywhole + 1 - ch) >> 31); isneg = ywhole >> 31; ywhole -= isneg; ydelta -= isneg ; ydelta &= scan; xwhole += cx; pRow = ((void *) (((intptr_t ) (pSrcInfo->rasBase)) + (((intptr_t) (ywhole + cy)) * (scan )))); do { jint argb = SrcReadLut[pRow[xwhole]]; (pRGB)[0] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut [pRow[xwhole+xdelta]]; (pRGB)[1] = argb & (argb >> 24 ); } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta ))); do { jint argb = SrcReadLut[pRow[xwhole]]; (pRGB)[2] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut [pRow[xwhole+xdelta]]; (pRGB)[3] = argb & (argb >> 24 ); } while (0); pRGB += 4; xlong += dxlong; ylong += dylong; } } void ByteIndexedBmBicubicTransformHelper(SurfaceDataRasInfo *pSrcInfo, jint *pRGB, jint numpix, jlong xlong, jlong dxlong , jlong ylong, jlong dylong) { jint *SrcReadLut; jint scan = pSrcInfo ->scanStride; jint cx, cy, cw, ch; jint *pEnd = pRGB + numpix *16; cx = pSrcInfo->bounds.x1; cw = pSrcInfo->bounds.x2 -cx; cy = pSrcInfo->bounds.y1; ch = pSrcInfo->bounds.y2 -cy; xlong -= (((jlong) 1) << 31); ylong -= (((jlong) 1 ) << 31); SrcReadLut = (pSrcInfo)->lutBase; while (pRGB < pEnd) { jint xwhole = ((jint) ((xlong) >> 32)); jint ywhole = ((jint) ((ylong) >> 32)); jint xdelta0, xdelta1 , xdelta2; jint ydelta0, ydelta1, ydelta2; jint isneg; ByteIndexedBmDataType *pRow; xdelta0 = (-xwhole) >> 31; xdelta1 = ((juint) ( xwhole + 1 - cw)) >> 31; xdelta2 = ((juint) (xwhole + 2 - cw)) >> 31; isneg = xwhole >> 31; xwhole -= isneg ; xdelta1 += isneg; xdelta2 += xdelta1; ydelta0 = ((-ywhole) >> 31) & (-scan); ydelta1 = ((ywhole + 1 - ch) >> 31) & scan; ydelta2 = ((ywhole + 2 - ch) >> 31) & scan ; isneg = ywhole >> 31; ywhole -= isneg; ydelta1 += (isneg & -scan); xwhole += cx; pRow = ((void *) (((intptr_t) (pSrcInfo ->rasBase)) + (((intptr_t) (ywhole + cy)) * (scan)))); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta0))); do { jint argb = SrcReadLut[pRow[xwhole+xdelta0]]; (pRGB)[0] = argb & ( argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow [xwhole]]; (pRGB)[1] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; (pRGB )[2] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2]]; (pRGB)[3] = argb & ( argb >> 24); } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (-ydelta0))); do { jint argb = SrcReadLut[pRow[xwhole +xdelta0]]; (pRGB)[4] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole]]; (pRGB)[5] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut [pRow[xwhole+xdelta1]]; (pRGB)[6] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2 ]]; (pRGB)[7] = argb & (argb >> 24); } while (0); pRow = ((void *) (((intptr_t) (pRow)) + (ydelta1))); do { jint argb = SrcReadLut[pRow[xwhole+xdelta0]]; (pRGB)[8] = argb & ( argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow [xwhole]]; (pRGB)[9] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; (pRGB )[10] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta2]]; (pRGB)[11] = argb & (argb >> 24); } while (0); pRow = ((void *) (((intptr_t ) (pRow)) + (ydelta2))); do { jint argb = SrcReadLut[pRow[xwhole +xdelta0]]; (pRGB)[12] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole]]; (pRGB)[13] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[xwhole+xdelta1]]; (pRGB)[14] = argb & (argb >> 24); } while (0); do { jint argb = SrcReadLut[pRow[ xwhole+xdelta2]]; (pRGB)[15] = argb & (argb >> 24); } while (0); pRGB += 16; xlong += dxlong; ylong += dylong; } } TransformHelperFuncs ByteIndexedBmTransformHelperFuncs = { ByteIndexedBmNrstNbrTransformHelper, ByteIndexedBmBilinearTransformHelper , ByteIndexedBmBicubicTransformHelper, }; |