File: | jdk/src/java.desktop/share/native/libawt/java2d/loops/Index8Gray.c |
Warning: | line 193, column 10 Value stored to 'srcScan' during its initialization is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* |
2 | * Copyright (c) 2001, 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 | #include <stdio.h> |
28 | #include "AnyByte.h" |
29 | #include "Index8Gray.h" |
30 | #include "AlphaMacros.h" |
31 | |
32 | #include "IntArgb.h" |
33 | #include "IntArgbPre.h" |
34 | #include "IntRgb.h" |
35 | #include "ThreeByteBgr.h" |
36 | #include "ByteGray.h" |
37 | #include "ByteIndexed.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 "Index8Gray". |
43 | * |
44 | * See also LoopMacros.h |
45 | */ |
46 | |
47 | RegisterFunc RegisterIndex8Gray; |
48 | |
49 | DECLARE_CONVERT_BLIT(IntArgb, Index8Gray)BlitFunc IntArgbToIndex8GrayConvert; |
50 | DECLARE_CONVERT_BLIT(ThreeByteBgr, Index8Gray)BlitFunc ThreeByteBgrToIndex8GrayConvert; |
51 | DECLARE_CONVERT_BLIT(ByteGray, Index8Gray)BlitFunc ByteGrayToIndex8GrayConvert; |
52 | DECLARE_CONVERT_BLIT(Index12Gray, Index8Gray)BlitFunc Index12GrayToIndex8GrayConvert; |
53 | DECLARE_CONVERT_BLIT(ByteIndexed, Index8Gray)BlitFunc ByteIndexedToIndex8GrayConvert; |
54 | DECLARE_CONVERT_BLIT(Index8Gray, Index8Gray)BlitFunc Index8GrayToIndex8GrayConvert; |
55 | |
56 | DECLARE_SCALE_BLIT(Index8Gray, Index8Gray)ScaleBlitFunc Index8GrayToIndex8GrayScaleConvert; |
57 | DECLARE_SCALE_BLIT(IntArgb, Index8Gray)ScaleBlitFunc IntArgbToIndex8GrayScaleConvert; |
58 | DECLARE_SCALE_BLIT(ThreeByteBgr, Index8Gray)ScaleBlitFunc ThreeByteBgrToIndex8GrayScaleConvert; |
59 | DECLARE_SCALE_BLIT(UshortGray, Index8Gray)ScaleBlitFunc UshortGrayToIndex8GrayScaleConvert; |
60 | DECLARE_SCALE_BLIT(ByteIndexed, Index8Gray)ScaleBlitFunc ByteIndexedToIndex8GrayScaleConvert; |
61 | DECLARE_SCALE_BLIT(ByteGray, Index8Gray)ScaleBlitFunc ByteGrayToIndex8GrayScaleConvert; |
62 | DECLARE_SCALE_BLIT(Index12Gray, Index8Gray)ScaleBlitFunc Index12GrayToIndex8GrayScaleConvert; |
63 | |
64 | DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, Index8Gray)BlitFunc ByteIndexedBmToIndex8GrayXparOver; |
65 | DECLARE_XPAR_BLITBG(ByteIndexedBm, Index8Gray)BlitBgFunc ByteIndexedBmToIndex8GrayXparBgCopy; |
66 | |
67 | DECLARE_XOR_BLIT(IntArgb, Index8Gray)BlitFunc IntArgbToIndex8GrayXorBlit; |
68 | DECLARE_ALPHA_MASKFILL(Index8Gray)MaskFillFunc Index8GrayAlphaMaskFill; |
69 | DECLARE_ALPHA_MASKBLIT(IntArgb, Index8Gray)MaskBlitFunc IntArgbToIndex8GrayAlphaMaskBlit; |
70 | DECLARE_ALPHA_MASKBLIT(IntArgbPre, Index8Gray)MaskBlitFunc IntArgbPreToIndex8GrayAlphaMaskBlit; |
71 | DECLARE_ALPHA_MASKBLIT(IntRgb, Index8Gray)MaskBlitFunc IntRgbToIndex8GrayAlphaMaskBlit; |
72 | DECLARE_SRCOVER_MASKFILL(Index8Gray)MaskFillFunc Index8GraySrcOverMaskFill; |
73 | DECLARE_SRCOVER_MASKBLIT(IntArgb, Index8Gray)MaskBlitFunc IntArgbToIndex8GraySrcOverMaskBlit; |
74 | DECLARE_SRCOVER_MASKBLIT(IntArgbPre, Index8Gray)MaskBlitFunc IntArgbPreToIndex8GraySrcOverMaskBlit; |
75 | DECLARE_SOLID_DRAWGLYPHLISTAA(Index8Gray)DrawGlyphListAAFunc Index8GrayDrawGlyphListAA; |
76 | |
77 | DECLARE_TRANSFORMHELPER_FUNCS(Index8Gray)TransformHelperFunc Index8GrayNrstNbrTransformHelper; TransformHelperFunc Index8GrayBilinearTransformHelper; TransformHelperFunc Index8GrayBicubicTransformHelper ; TransformHelperFuncs Index8GrayTransformHelperFuncs; |
78 | |
79 | NativePrimitive Index8GrayPrimitives[] = { |
80 | REGISTER_CONVERT_BLIT(IntArgb, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayConvert }, {IntArgbToIndex8GrayConvert}, 0, 0 }, |
81 | REGISTER_CONVERT_BLIT_EQUIV(IntRgb, Index8Gray,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayConvert }, {IntArgbToIndex8GrayConvert}, 0, 0 } |
82 | NAME_CONVERT_BLIT(IntArgb, Index8Gray)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayConvert }, {IntArgbToIndex8GrayConvert}, 0, 0 }, |
83 | REGISTER_CONVERT_BLIT(ThreeByteBgr, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ThreeByteBgr, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {ThreeByteBgrToIndex8GrayConvert}, {ThreeByteBgrToIndex8GrayConvert }, 0, 0 }, |
84 | REGISTER_CONVERT_BLIT(ByteGray, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteGray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {ByteGrayToIndex8GrayConvert }, {ByteGrayToIndex8GrayConvert}, 0, 0 }, |
85 | REGISTER_CONVERT_BLIT(Index12Gray, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {Index12GrayToIndex8GrayConvert }, {Index12GrayToIndex8GrayConvert}, 0, 0 }, |
86 | REGISTER_CONVERT_BLIT_FLAGS(Index8Gray, Index8Gray,{ & PrimitiveTypes.Blit, & SurfaceTypes.Index8Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {Index8GrayToIndex8GrayConvert }, {Index8GrayToIndex8GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), } |
87 | SD_LOCK_LUT,{ & PrimitiveTypes.Blit, & SurfaceTypes.Index8Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {Index8GrayToIndex8GrayConvert }, {Index8GrayToIndex8GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), } |
88 | SD_LOCK_LUT | SD_LOCK_INVGRAY){ & PrimitiveTypes.Blit, & SurfaceTypes.Index8Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {Index8GrayToIndex8GrayConvert }, {Index8GrayToIndex8GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), }, |
89 | REGISTER_CONVERT_BLIT(ByteIndexed, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexed, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {ByteIndexedToIndex8GrayConvert }, {ByteIndexedToIndex8GrayConvert}, 0, 0 }, |
90 | |
91 | REGISTER_SCALE_BLIT(IntArgb, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgb , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {IntArgbToIndex8GrayScaleConvert}, {IntArgbToIndex8GrayScaleConvert }, 0, 0 }, |
92 | REGISTER_SCALE_BLIT_EQUIV(IntRgb, Index8Gray,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayScaleConvert}, {IntArgbToIndex8GrayScaleConvert }, 0, 0 } |
93 | NAME_SCALE_BLIT(IntArgb, Index8Gray)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayScaleConvert}, {IntArgbToIndex8GrayScaleConvert }, 0, 0 }, |
94 | REGISTER_SCALE_BLIT(ThreeByteBgr, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ThreeByteBgr , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {ThreeByteBgrToIndex8GrayScaleConvert}, {ThreeByteBgrToIndex8GrayScaleConvert }, 0, 0 }, |
95 | REGISTER_SCALE_BLIT(UshortGray, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {UshortGrayToIndex8GrayScaleConvert}, {UshortGrayToIndex8GrayScaleConvert }, 0, 0 }, |
96 | REGISTER_SCALE_BLIT(ByteIndexed, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {ByteIndexedToIndex8GrayScaleConvert}, {ByteIndexedToIndex8GrayScaleConvert }, 0, 0 }, |
97 | REGISTER_SCALE_BLIT(ByteGray, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {ByteGrayToIndex8GrayScaleConvert}, {ByteGrayToIndex8GrayScaleConvert }, 0, 0 }, |
98 | REGISTER_SCALE_BLIT(Index12Gray, Index8Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {Index12GrayToIndex8GrayScaleConvert}, {Index12GrayToIndex8GrayScaleConvert }, 0, 0 }, |
99 | REGISTER_SCALE_BLIT_FLAGS(Index8Gray, Index8Gray, 0,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index8Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {Index8GrayToIndex8GrayScaleConvert}, {Index8GrayToIndex8GrayScaleConvert }, 0, (1 << 2) | (1 << 4), } |
100 | SD_LOCK_LUT | SD_LOCK_INVGRAY){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index8Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {Index8GrayToIndex8GrayScaleConvert}, {Index8GrayToIndex8GrayScaleConvert }, 0, (1 << 2) | (1 << 4), }, |
101 | |
102 | REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.Index8Gray , {ByteIndexedBmToIndex8GrayXparOver}, {ByteIndexedBmToIndex8GrayXparOver }, 0, 0 }, |
103 | REGISTER_XPAR_BLITBG(ByteIndexedBm, Index8Gray){ & PrimitiveTypes.BlitBg, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {ByteIndexedBmToIndex8GrayXparBgCopy}, {ByteIndexedBmToIndex8GrayXparBgCopy }, 0, 0 }, |
104 | |
105 | REGISTER_XOR_BLIT(IntArgb, Index8Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.Xor, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayXorBlit }, {IntArgbToIndex8GrayXorBlit}, 0, 0 }, |
106 | REGISTER_ALPHA_MASKFILL(Index8Gray){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index8Gray , {Index8GrayAlphaMaskFill}, {Index8GrayAlphaMaskFill}, 0, 0 }, |
107 | REGISTER_ALPHA_MASKBLIT(IntArgb, Index8Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GrayAlphaMaskBlit }, {IntArgbToIndex8GrayAlphaMaskBlit}, 0, 0 }, |
108 | REGISTER_ALPHA_MASKBLIT(IntArgbPre, Index8Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.AnyAlpha, & SurfaceTypes.Index8Gray , {IntArgbPreToIndex8GrayAlphaMaskBlit}, {IntArgbPreToIndex8GrayAlphaMaskBlit }, 0, 0 }, |
109 | REGISTER_ALPHA_MASKBLIT(IntRgb, Index8Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntRgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index8Gray, {IntRgbToIndex8GrayAlphaMaskBlit }, {IntRgbToIndex8GrayAlphaMaskBlit}, 0, 0 }, |
110 | REGISTER_SRCOVER_MASKFILL(Index8Gray){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.SrcOver, & SurfaceTypes.Index8Gray, {Index8GraySrcOverMaskFill}, {Index8GraySrcOverMaskFill}, 0, 0 }, |
111 | REGISTER_SRCOVER_MASKBLIT(IntArgb, Index8Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcOver, & SurfaceTypes.Index8Gray, {IntArgbToIndex8GraySrcOverMaskBlit }, {IntArgbToIndex8GraySrcOverMaskBlit}, 0, 0 }, |
112 | REGISTER_SRCOVER_MASKBLIT(IntArgbPre, Index8Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.SrcOver, & SurfaceTypes.Index8Gray , {IntArgbPreToIndex8GraySrcOverMaskBlit}, {IntArgbPreToIndex8GraySrcOverMaskBlit }, 0, 0 }, |
113 | REGISTER_SOLID_DRAWGLYPHLISTAA(Index8Gray){ & PrimitiveTypes.DrawGlyphListAA, & SurfaceTypes.AnyColor , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index8Gray , {Index8GrayDrawGlyphListAA}, {Index8GrayDrawGlyphListAA}, 0 , 0 }, |
114 | |
115 | REGISTER_TRANSFORMHELPER_FUNCS(Index8Gray){ & PrimitiveTypes.TransformHelper, & SurfaceTypes.Index8Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgbPre , {(AnyFunc *) &Index8GrayTransformHelperFuncs}, {(AnyFunc *) &Index8GrayTransformHelperFuncs}, 0, 0 }, |
116 | }; |
117 | |
118 | extern jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut, |
119 | SurfaceDataRasInfo *pSrcInfo, |
120 | SurfaceDataRasInfo *pDstInfo); |
121 | |
122 | jboolean RegisterIndex8Gray(JNIEnv *env) |
123 | { |
124 | return RegisterPrimitives(env, Index8GrayPrimitives, |
125 | ArraySize(Index8GrayPrimitives)(sizeof(Index8GrayPrimitives) / sizeof(Index8GrayPrimitives[0 ]))); |
126 | } |
127 | |
128 | jint PixelForIndex8Gray(SurfaceDataRasInfo *pRasInfo, jint rgb) |
129 | { |
130 | jint r, g, b, gray; |
131 | ExtractIntDcmComponentsX123(rgb, r, g, b)do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); |
132 | gray = ComposeByteGrayFrom3ByteRgb(r, g, b)(ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256 ); |
133 | return pRasInfo->invGrayTable[gray]; |
134 | } |
135 | |
136 | DEFINE_CONVERT_BLIT(IntArgb, Index8Gray, 3ByteRgb)void IntArgbToIndex8GrayConvert(void *srcBase, void *dstBase, juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { IntArgbDataType *pSrc = ( IntArgbDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 4; dstScan -= (width ) * 1; do { juint w = width; ; 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 { int gray = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pDst)[0] = (jubyte) (DstWriteInvGrayLut[gray]); } while (0); } while (0 ); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
137 | |
138 | DEFINE_CONVERT_BLIT(ThreeByteBgr, Index8Gray, 3ByteRgb)void ThreeByteBgrToIndex8GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { ThreeByteBgrDataType *pSrc = (ThreeByteBgrDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 3; dstScan -= (width) * 1; do { juint w = width; ; 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 { int gray = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pDst)[0] = (jubyte) (DstWriteInvGrayLut[gray]); } while (0); } while (0 ); pSrc = ((void *) (((intptr_t) (pSrc)) + (3))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
139 | |
140 | DEFINE_CONVERT_BLIT(ByteGray, Index8Gray, 1ByteGray)void ByteGrayToIndex8GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { ByteGrayDataType *pSrc = ( ByteGrayDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width ) * 1; do { juint w = width; ; do { do { jint gray; (gray) = ( pSrc)[0]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut[gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (-- height > 0); } while (0); } |
141 | |
142 | DEFINE_CONVERT_BLIT(Index12Gray, Index8Gray, 1ByteGray)void Index12GrayToIndex8GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; jint *DstWriteInvGrayLut; SrcReadLut = ( pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 2; dstScan -= (width ) * 1; do { juint w = width; ; do { do { jint gray; (gray) = ( jubyte)SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jubyte) ( DstWriteInvGrayLut[gray]);; } while (0); pSrc = ((void *) ((( intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst )) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); ; } while (--height > 0); } while (0); } |
143 | |
144 | DEFINE_CONVERT_BLIT_LUT8(ByteIndexed, Index8Gray, PreProcessLut)void ByteIndexedToIndex8GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; Index8GrayPixelType pixLut[(1 << 8)]; do { jint *srcLut = (pSrcInfo)->lutBase; juint lutSize = (pSrcInfo)->lutSize; jint *PreLutInvGrayLut; PreLutInvGrayLut = (pDstInfo)->invGrayTable;; if (lutSize >= (1 << 8)) { lutSize = (1 << 8); } else { Index8GrayPixelType *pPIXLUT = &pixLut[lutSize]; do { do { int r, g, b; do { (b) = (0) & 0xff; (g) = ((0) >> 8) & 0xff; (r) = ((0) >> 16) & 0xff; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pPIXLUT)[0] = (jubyte) (PreLutInvGrayLut[gray]); } while (0); } while (0); } while (++pPIXLUT < &pixLut[(1 << 8)]); } do { juint x = 0; ; do { do { jint argb = srcLut[x]; do { int r, g, b; do { (b) = (argb) & 0xff; (g) = ((argb ) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff ; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pixLut)[x] = (jubyte) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } while (0 ); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { pDst[0] = pixLut[pSrc[0]]; pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ( (void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0);} |
145 | |
146 | void NAME_CONVERT_BLIT(Index8Gray, Index8Gray)Index8GrayToIndex8GrayConvert |
147 | (void *srcBase, void *dstBase, |
148 | juint width, juint height, |
149 | SurfaceDataRasInfo *pSrcInfo, |
150 | SurfaceDataRasInfo *pDstInfo, |
151 | NativePrimitive *pPrim, |
152 | CompositeInfo *pCompInfo) |
153 | { |
154 | DeclareIndex8GrayLoadVars(SrcRead)jint *SrcReadLut; |
155 | DeclareIndex8GrayLoadVars(DstRead)jint *DstReadLut; |
156 | jint srcScan = pSrcInfo->scanStride; |
157 | jint dstScan = pDstInfo->scanStride; |
158 | |
159 | InitIndex8GrayLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
160 | InitIndex8GrayLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
161 | |
162 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
163 | do { |
164 | memcpy(dstBase, srcBase, width); |
165 | srcBase = PtrAddBytes(srcBase, srcScan)((void *) (((intptr_t) (srcBase)) + (srcScan))); |
166 | dstBase = PtrAddBytes(dstBase, dstScan)((void *) (((intptr_t) (dstBase)) + (dstScan))); |
167 | } while (--height > 0); |
168 | } else { |
169 | DeclareIndex8GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut;; |
170 | InitIndex8GrayStoreVarsY(DstWrite, pDstInfo)DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; |
171 | |
172 | BlitLoopWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
173 | Index8Gray, pDst, dstBase, pDstInfo, DstWrite,do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
174 | width, height,do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
175 | ConvertVia1ByteGraydo { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
176 | (pSrc, Index8Gray, SrcRead,do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
177 | pDst, Index8Gray, DstWrite, 0, 0))do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase ); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); |
178 | } |
179 | } |
180 | |
181 | void NAME_SCALE_BLIT(Index8Gray, Index8Gray)Index8GrayToIndex8GrayScaleConvert |
182 | (void *srcBase, void *dstBase, |
183 | juint width, juint height, |
184 | jint sxloc, jint syloc, |
185 | jint sxinc, jint syinc, jint shift, |
186 | SurfaceDataRasInfo *pSrcInfo, |
187 | SurfaceDataRasInfo *pDstInfo, |
188 | NativePrimitive *pPrim, |
189 | CompositeInfo *pCompInfo) |
190 | { |
191 | DeclareIndex8GrayLoadVars(SrcRead)jint *SrcReadLut; |
192 | DeclareIndex8GrayLoadVars(DstRead)jint *DstReadLut; |
193 | jint srcScan = pSrcInfo->scanStride; |
Value stored to 'srcScan' during its initialization is never read | |
194 | jint dstScan = pDstInfo->scanStride; |
195 | DeclareIndex8GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut; |
196 | |
197 | InitIndex8GrayLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
198 | InitIndex8GrayLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
199 | |
200 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
201 | BlitLoopScaleWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc ; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
202 | Index8Gray, pDst, dstBase, pDstInfo, DstWrite,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc ; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
203 | x, width, height,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc ; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
204 | sxloc, syloc, sxinc, syinc, shift,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc ; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
205 | pDst[0] = pSrc[x])do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pSrc[x]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc ; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); |
206 | } else { |
207 | DeclareIndex8GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut;; |
208 | InitIndex8GrayStoreVarsY(DstWrite, pDstInfo)DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; |
209 | BlitLoopScaleWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
210 | Index8Gray, pDst, dstBase, pDstInfo, DstWrite,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
211 | x, width, height,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
212 | sxloc, syloc, sxinc, syinc, shift,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
213 | ConvertVia1ByteGray(pSrc, Index8Gray, SrcRead,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
214 | pDst, Index8Gray, DstWrite,do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0) |
215 | x, 0))do { Index8GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray ) = (jubyte)SrcReadLut[pSrc[x]]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); |
216 | } |
217 | } |
218 | |
219 | DEFINE_SCALE_BLIT(IntArgb, Index8Gray, 3ByteRgb)void IntArgbToIndex8GrayScaleConvert(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 *DstWriteInvGrayLut; ; do { IntArgbDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) ((( intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; 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 { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b )) + 128) / 256); (pDst)[0] = (jubyte) (DstWriteInvGrayLut[gray ]); } while (0); } while (0); pDst = ((void *) (((intptr_t) ( pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc ; } while (--height > 0); } while (0); } |
220 | |
221 | DEFINE_SCALE_BLIT(ThreeByteBgr, Index8Gray, 3ByteRgb)void ThreeByteBgrToIndex8GrayScaleConvert(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 *DstWriteInvGrayLut; ; do { ThreeByteBgrDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; 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 { int gray = (ByteGrayDataType)(((77*( r)) + (150*(g)) + (29*(b)) + 128) / 256); (pDst)[0] = (jubyte ) (DstWriteInvGrayLut[gray]); } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
222 | |
223 | DEFINE_SCALE_BLIT(UshortGray, Index8Gray, 1ByteGray)void UshortGrayToIndex8GrayScaleConvert(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 *DstWriteInvGrayLut; ; do { UshortGrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray) = ((pSrc)[x] >> 8); (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
224 | |
225 | DEFINE_SCALE_BLIT_LUT8(ByteIndexed, Index8Gray, PreProcessLut)void ByteIndexedToIndex8GrayScaleConvert(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 *DstWriteInvGrayLut; Index8GrayPixelType pixLut [(1 << 8)]; do { jint *srcLut = (pSrcInfo)->lutBase; juint lutSize = (pSrcInfo)->lutSize; jint *PreLutInvGrayLut ; PreLutInvGrayLut = (pDstInfo)->invGrayTable;; if (lutSize >= (1 << 8)) { lutSize = (1 << 8); } else { Index8GrayPixelType *pPIXLUT = &pixLut[lutSize]; do { do { int r, g, b; do { (b) = (0) & 0xff; (g) = ((0) >> 8) & 0xff; (r) = ((0) >> 16) & 0xff; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pPIXLUT)[0] = (jubyte) (PreLutInvGrayLut[gray]); } while (0); } while (0); } while (++pPIXLUT < &pixLut[(1 << 8)]); } do { juint x = 0; ; do { do { jint argb = srcLut[x]; do { int r, g, b; do { (b) = (argb) & 0xff; (g) = ((argb ) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff ; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pixLut)[x] = (jubyte) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } while (0 ); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 1; do { juint w = width ; jint tmpsxloc = sxloc; pSrc = ((void *) (((intptr_t) (srcBase )) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); pDst[0] = pixLut[pSrc [x]]; pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t ) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0);} |
226 | |
227 | DEFINE_SCALE_BLIT(ByteGray, Index8Gray, 1ByteGray)void ByteGrayToIndex8GrayScaleConvert(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 *DstWriteInvGrayLut; ; do { ByteGrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) ((( intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray) = (pSrc)[x]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
228 | |
229 | DEFINE_SCALE_BLIT(Index12Gray, Index8Gray, 1ByteGray)void Index12GrayToIndex8GrayScaleConvert(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; jint *DstWriteInvGrayLut; SrcReadLut = (pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc; Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; dstScan -= (width) * 1; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void *) ((( intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift); do { jint gray; (gray) = (jubyte)SrcReadLut[pSrc[x] & 0xfff ]; (pDst)[0] = (jubyte) (DstWriteInvGrayLut[gray]);; } while ( 0); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t ) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
230 | |
231 | DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, Index8Gray, PreProcessLut)void ByteIndexedBmToIndex8GrayXparOver(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; jint pixLut[(1 << 8)]; do { jint *srcLut = (pSrcInfo)->lutBase; juint lutSize = (pSrcInfo )->lutSize; jint *PreLutInvGrayLut; PreLutInvGrayLut = (pDstInfo )->invGrayTable;; if (lutSize >= (1 << 8)) { lutSize = (1 << 8); } else { jint *pPIXLUT = &pixLut[lutSize ]; do { pPIXLUT[0] = -1; } while (++pPIXLUT < &pixLut[ (1 << 8)]); } do { juint x = 0; ; do { do { jint argb = srcLut[x]; if (argb < 0) { do { int r, g, b; do { (b) = ( argb) & 0xff; (g) = ((argb) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pixLut)[x] = (jubyte) (PreLutInvGrayLut[gray]); } while (0); } while (0); } else { pixLut[x] = -1; } } while (0); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1; do { juint w = width; ; do { do { jint pix = pixLut[pSrc[0]]; if (! (pix < 0)) { pDst[0] = (Index8GrayPixelType ) pix; } } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
232 | |
233 | DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, Index8Gray, PreProcessLut)void ByteIndexedBmToIndex8GrayXparBgCopy(void *srcBase, void * dstBase, juint width, juint height, jint bgpixel, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim , CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; jint pixLut [(1 << 8)]; do { jint *srcLut = (pSrcInfo)->lutBase; juint lutSize = (pSrcInfo)->lutSize; jint *PreLutInvGrayLut ; PreLutInvGrayLut = (pDstInfo)->invGrayTable;; if (lutSize >= (1 << 8)) { lutSize = (1 << 8); } else { jint *pPIXLUT = &pixLut[lutSize]; do { pPIXLUT[0] = bgpixel; } while (++pPIXLUT < &pixLut[(1 << 8)]); } do { juint x = 0; ; do { do { jint argb = srcLut[x]; if (argb < 0) { do { int r, g, b; do { (b) = (argb) & 0xff; (g) = ((argb ) >> 8) & 0xff; (r) = ((argb) >> 16) & 0xff ; } while (0); do { int gray = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pixLut)[x] = (jubyte) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } else { pixLut [x] = bgpixel; } } while (0); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedBmDataType *pSrc = ( ByteIndexedBmDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)-> scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 1; do { juint w = width; ; do { do { jint pix = pixLut[pSrc[0]]; ((pDst)[0] = (jubyte) (pix)); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ( (void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
234 | |
235 | DEFINE_XOR_BLIT(IntArgb, Index8Gray, AnyByte)void IntArgbToIndex8GrayXorBlit(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; jint *DstWriteInvGrayLut; ; ; ; do { IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 4; dstScan -= (width) * 1; do { juint w = width; ; do { do { jint srcpixel ; (srcpixel) = (pSrc)[0]; if ((((jint) srcpixel) >= 0)) { break ; } do { jint r, g, b, gray; do { (b) = (srcpixel) & 0xff ; (g) = ((srcpixel) >> 8) & 0xff; (r) = ((srcpixel) >> 16) & 0xff; } while (0); gray = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (srcpixel) = (pDstInfo)->invGrayTable[gray]; } while (0); ; (pDst)[0] ^= (((srcpixel) ^ (xorpixel)) & ~(alphamask)); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
236 | |
237 | DEFINE_ALPHA_MASKFILL(Index8Gray, 1ByteGray)void Index8GrayAlphaMaskFill (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 srcG; jint dstA = 0; jint dstF; jint dstFbase; jint rasScan = pRasInfo->scanStride ; jboolean loaddst; Index8GrayDataType *pRas = (Index8GrayDataType *) (rasBase); jint *DstPixLut; jint *DstWriteInvGrayLut; jint SrcOpAnd, SrcOpXor, SrcOpAdd; jint DstOpAnd, DstOpXor, DstOpAdd ; do { int r, g, b; do { (b) = (fgColor) & 0xff; (g) = (( fgColor) >> 8) & 0xff; (r) = ((fgColor) >> 16 ) & 0xff; (srcA) = ((fgColor) >> 24) & 0xff; } while (0); srcG = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*( b)) + 128) / 256); } while (0); if (srcA != 0xff) { srcG = mul8table [srcA][srcG]; } 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); DstPixLut = (pRasInfo)->lutBase; rasScan -= width * 1; maskScan -= width ; if (pMask) { pMask += maskOff; } DstWriteInvGrayLut = (pRasInfo )->invGrayTable;; do { jint w = width; ; do { jint resA; jint resG; jint srcF; if (pMask) { pathA = *pMask++; if (!pathA) { pRas = ((void *) (((intptr_t) (pRas)) + (1))); ; continue; } ; dstF = dstFbase; } if (loaddst) { dstA = 0xff; } 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; resG = srcG; } else { resA = mul8table[srcF][srcA]; resG = mul8table[srcF][srcG]; } } else { if (dstF == 0xff) { pRas = ((void *) (((intptr_t) (pRas)) + (1))); ; continue; } resA = 0; resG = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; resA += dstA; if (0) { dstA = dstF; } if (dstA) { jint tmpG; tmpG = (jubyte)DstPixLut[(pRas)[0]]; if (dstA != 0xff) { tmpG = mul8table [dstA][tmpG]; } resG += tmpG; } } if (!(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pRas)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; pRas = ((void *) (((intptr_t ) (pRas)) + (1))); ; } while (--w > 0); pRas = ((void *) ( ((intptr_t) (pRas)) + (rasScan))); ; if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (--height > 0); } |
238 | |
239 | DEFINE_ALPHA_MASKBLIT(IntArgb, Index8Gray, 1ByteGray)void IntArgbToIndex8GrayAlphaMaskBlit (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); Index8GrayDataType *pDst = (Index8GrayDataType * ) (dstBase); jint SrcPix; jint *DstPixLut; jint *DstWriteInvGrayLut ; 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; DstPixLut = (pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 1; maskScan -= width; if (pMask) { pMask += maskOff; } DstWriteInvGrayLut = (pDstInfo)->invGrayTable; ; do { jint w = width; ; do { jint resA; jint resG; jint srcF ; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (1))); ; continue; } ; } if (loadsrc) { do { SrcPix = (pSrc)[0]; srcA = ((juint) SrcPix) >> 24 ; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst) { dstA = 0xff; } 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 { int r, g , b; do { (b) = (SrcPix) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ((SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*( b)) + 128) / 256); } while (0); if (srcF != 0xff) { resG = mul8table [srcF][resG]; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) ( pDst)) + (1))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue; } resA = 0; resG = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if ( !(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpG; tmpG = (jubyte)DstPixLut[(pDst)[0]]; if (dstF != 0xff) { tmpG = mul8table [dstF][tmpG]; } resG += tmpG; } } if (!(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; pSrc = ((void *) (((intptr_t ) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1 ))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc )) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); ; if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (--height > 0); } |
240 | |
241 | DEFINE_ALPHA_MASKBLIT(IntArgbPre, Index8Gray, 1ByteGray)void IntArgbPreToIndex8GrayAlphaMaskBlit (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); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint SrcPix; jint *DstPixLut ; jint *DstWriteInvGrayLut; 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; DstPixLut = (pDstInfo)->lutBase ; srcScan -= width * 4; dstScan -= width * 1; maskScan -= width ; if (pMask) { pMask += maskOff; } DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; do { jint w = width; ; do { jint resA; jint resG; jint srcF; jint dstF; if (pMask) { pathA = *pMask++; if (!pathA) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue; } ; } if (loadsrc) { do { SrcPix = (pSrc)[0]; srcA = ((juint) SrcPix) >> 24; } while (0); srcA = mul8table[extraA][srcA]; } if (loaddst) { dstA = 0xff; } 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 { int r, g , b; do { (b) = (SrcPix) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ((SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*( b)) + 128) / 256); } while (0); if (srcF != 0xff) { resG = mul8table [srcF][resG]; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) ( pDst)) + (1))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue; } resA = 0; resG = 0; } if (dstF) { dstA = mul8table[dstF][dstA]; if ( !(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpG; tmpG = (jubyte)DstPixLut[(pDst)[0]]; if (dstF != 0xff) { tmpG = mul8table [dstF][tmpG]; } resG += tmpG; } } if (!(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; pSrc = ((void *) (((intptr_t ) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1 ))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc )) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan ))); ; if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (--height > 0); } |
242 | |
243 | DEFINE_ALPHA_MASKBLIT(IntRgb, Index8Gray, 1ByteGray)void IntRgbToIndex8GrayAlphaMaskBlit (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); Index8GrayDataType *pDst = (Index8GrayDataType *) ( dstBase); jint *DstPixLut; jint *DstWriteInvGrayLut; 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); ; DstPixLut = ( pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 1; maskScan -= width; if (pMask) { pMask += maskOff; } DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; do { jint w = width; ; do { jint resA; jint resG; jint srcF; jint dstF; if (pMask) { pathA = * pMask++; if (!pathA) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue ; } ; } if (loadsrc) { srcA = 0xff; srcA = mul8table[extraA][ srcA]; } if (loaddst) { dstA = 0xff; } 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 { int r, g, b; do { (b) = (pSrc[0]) & 0xff; (g) = ((pSrc [0]) >> 8) & 0xff; (r) = ((pSrc[0]) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType)(((77*(r)) + (150 *(g)) + (29*(b)) + 128) / 256); } while (0); if (srcF != 0xff ) { resG = mul8table[srcF][resG]; } } else { if (dstF == 0xff ) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc )) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; continue ; } resA = 0; resG = 0; } if (dstF) { dstA = mul8table[dstF][ dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpG; tmpG = (jubyte)DstPixLut[(pDst)[0]]; if (dstF != 0xff) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG; } } if (!(0) && resA && resA < 0xff) { resG = div8table [resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut[resG ]);; pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = (( void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ( (void *) (((intptr_t) (pDst)) + (dstScan))); ; if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while ( --height > 0); } |
244 | |
245 | DEFINE_SRCOVER_MASKFILL(Index8Gray, 1ByteGray)void Index8GraySrcOverMaskFill (void *rasBase, jubyte *pMask, jint maskOff, jint maskScan, jint width, jint height, jint fgColor , SurfaceDataRasInfo *pRasInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint srcA; jint srcG; jint rasScan = pRasInfo-> scanStride; Index8GrayDataType *pRas = (Index8GrayDataType *) (rasBase); jint *DstPixLut; jint *DstWriteInvGrayLut; do { int r, g, b; do { (b) = (fgColor) & 0xff; (g) = ((fgColor) >> 8) & 0xff; (r) = ((fgColor) >> 16) & 0xff; (srcA ) = ((fgColor) >> 24) & 0xff; } while (0); srcG = ( ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256 ); } while (0); if (srcA != 0xff) { if (srcA == 0) { return; } srcG = mul8table[srcA][srcG]; } DstPixLut = (pRasInfo)->lutBase ; DstWriteInvGrayLut = (pRasInfo)->invGrayTable;; rasScan -= width * 1; if (pMask) { pMask += maskOff; maskScan -= width; do { jint w = width; ; do { jint resA; jint resG; jint pathA = *pMask++; if (pathA > 0) { if (pathA != 0xff) { ; resA = mul8table[pathA][srcA]; resG = mul8table[pathA][srcG]; } else { resA = srcA; resG = srcG; } if (resA != 0xff) { jint dstF = 0xff - resA; jint dstA = 0; dstA = 0xff; dstA = mul8table[dstF ][dstA]; if (!(0)) { dstF = dstA; } resA += dstA; if (dstF) { jint tmpG; tmpG = (jubyte)DstPixLut[(pRas)[0]]; if (dstF != 0xff ) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG; } } if (!(1 ) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pRas)[0] = (jubyte) (DstWriteInvGrayLut [resG]);; } pRas = ((void *) (((intptr_t) (pRas)) + (1))); ; } while (--w > 0); pRas = ((void *) (((intptr_t) (pRas)) + ( rasScan))); ; pMask = ((void *) (((intptr_t) (pMask)) + (maskScan ))); } while (--height > 0); } else { do { jint w = width; ; do { jint resA; jint resG; jint dstF = 0xff - srcA; resA = 0xff; resA = mul8table[dstF][resA]; if (!(0)) { dstF = resA; } resA += srcA; resG = (jubyte)DstPixLut[(pRas)[0]]; resG = mul8table [dstF][resG] + srcG; if (!(1) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pRas)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; pRas = ((void *) (((intptr_t) (pRas)) + (1))); ; } while (--w > 0); pRas = ((void *) (((intptr_t) (pRas)) + (rasScan))); ; } while (-- height > 0); } } |
246 | |
247 | DEFINE_SRCOVER_MASKBLIT(IntArgb, Index8Gray, 1ByteGray)void IntArgbToIndex8GraySrcOverMaskBlit (void *dstBase, void * srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo->scanStride; IntArgbDataType *pSrc = (IntArgbDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint SrcPix; jint *DstPixLut; jint *DstWriteInvGrayLut ; SrcPix = 0; DstPixLut = (pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 1; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; if (pMask) { pMask += maskOff; maskScan -= width ; do { jint w = width; ; do { jint pathA = *pMask++; if (pathA ) { jint resA; jint resG; jint srcF; ; pathA = mul8table[pathA ][extraA]; do { SrcPix = (pSrc)[0]; resA = ((juint) SrcPix) >> 24; } while (0); resA = mul8table[pathA][resA]; if (resA) { if (0) { srcF = pathA; } else { srcF = resA; } do { int r, g, b ; do { (b) = (SrcPix) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ((SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*( b)) + 128) / 256); } while (0); if (resA < 0xff) { jint dstA ; jint dstG; jint dstF = 0xff - resA; dstA = 0xff; dstA = mul8table [dstF][dstA]; if (!(0)) { dstF = dstA; } dstG = (jubyte)DstPixLut [(pDst)[0]]; resA += dstA; resG = mul8table[dstF][dstG] + mul8table [srcF][resG]; } else if (srcF < 0xff) { resG = mul8table[srcF ][resG]; } if (!(1) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; } } pSrc = ((void *) ( ((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst )) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); ; pMask = ((void *) (((intptr_t) (pMask)) + ( maskScan))); } while (--height > 0); } else { do { jint w = width; ; do { jint resA; jint resG; jint srcF; do { SrcPix = (pSrc)[0]; resA = ((juint) SrcPix) >> 24; } while (0); resA = mul8table[extraA][resA]; if (resA) { if (0) { srcF = extraA ; } else { srcF = resA; } do { int r, g, b; do { (b) = (SrcPix ) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ( (SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); } while (0) ; if (resA < 0xff) { jint dstA; jint dstG; jint dstF = 0xff - resA; dstA = 0xff; dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } dstG = (jubyte)DstPixLut[(pDst)[0]]; resA += dstA; resG = mul8table[dstF][dstG] + mul8table[srcF][resG]; } else if (srcF < 0xff) { resG = mul8table[srcF][resG]; } if (!(1) && !(0) && resA && resA < 0xff ) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut [resG]);; } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (-- height > 0); } } |
248 | |
249 | DEFINE_SRCOVER_MASKBLIT(IntArgbPre, Index8Gray, 1ByteGray)void IntArgbPreToIndex8GraySrcOverMaskBlit (void *dstBase, void *srcBase, jubyte *pMask, jint maskOff, jint maskScan, jint width , jint height, SurfaceDataRasInfo *pDstInfo, SurfaceDataRasInfo *pSrcInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint extraA = (jint)(pCompInfo->details.extraAlpha * 255.0 + 0.5); jint srcScan = pSrcInfo->scanStride; jint dstScan = pDstInfo->scanStride; IntArgbPreDataType *pSrc = (IntArgbPreDataType *) (srcBase); Index8GrayDataType *pDst = (Index8GrayDataType *) (dstBase); jint SrcPix; jint *DstPixLut; jint *DstWriteInvGrayLut ; SrcPix = 0; DstPixLut = (pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 1; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; if (pMask) { pMask += maskOff; maskScan -= width ; do { jint w = width; ; do { jint pathA = *pMask++; if (pathA ) { jint resA; jint resG; jint srcF; ; pathA = mul8table[pathA ][extraA]; do { SrcPix = (pSrc)[0]; resA = ((juint) SrcPix) >> 24; } while (0); resA = mul8table[pathA][resA]; if (resA) { if (1) { srcF = pathA; } else { srcF = resA; } do { int r, g, b ; do { (b) = (SrcPix) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ((SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*( b)) + 128) / 256); } while (0); if (resA < 0xff) { jint dstA ; jint dstG; jint dstF = 0xff - resA; dstA = 0xff; dstA = mul8table [dstF][dstA]; if (!(0)) { dstF = dstA; } dstG = (jubyte)DstPixLut [(pDst)[0]]; resA += dstA; resG = mul8table[dstF][dstG] + mul8table [srcF][resG]; } else if (srcF < 0xff) { resG = mul8table[srcF ][resG]; } if (!(1) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut[resG]);; } } pSrc = ((void *) ( ((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst )) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t ) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst) ) + (dstScan))); ; pMask = ((void *) (((intptr_t) (pMask)) + ( maskScan))); } while (--height > 0); } else { do { jint w = width; ; do { jint resA; jint resG; jint srcF; do { SrcPix = (pSrc)[0]; resA = ((juint) SrcPix) >> 24; } while (0); resA = mul8table[extraA][resA]; if (resA) { if (1) { srcF = extraA ; } else { srcF = resA; } do { int r, g, b; do { (b) = (SrcPix ) & 0xff; (g) = ((SrcPix) >> 8) & 0xff; (r) = ( (SrcPix) >> 16) & 0xff; } while (0); resG = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); } while (0) ; if (resA < 0xff) { jint dstA; jint dstG; jint dstF = 0xff - resA; dstA = 0xff; dstA = mul8table[dstF][dstA]; if (!(0)) { dstF = dstA; } dstG = (jubyte)DstPixLut[(pDst)[0]]; resA += dstA; resG = mul8table[dstF][dstG] + mul8table[srcF][resG]; } else if (srcF < 0xff) { resG = mul8table[srcF][resG]; } if (!(1) && !(0) && resA && resA < 0xff ) { resG = div8table[resA][resG]; } (pDst)[0] = (jubyte) (DstWriteInvGrayLut [resG]);; } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (1))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (-- height > 0); } } |
250 | |
251 | DEFINE_SOLID_DRAWGLYPHLISTAA(Index8Gray, 1ByteGray)void Index8GrayDrawGlyphListAA(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; Index8GrayDataType *pPix; jint srcA ; jint srcG; jint *pixLut; jint *pixInvGrayLut; pixLut = (pRasInfo )->lutBase; pixInvGrayLut = (pRasInfo)->invGrayTable;; ; do { int r, g, b; do { (b) = (argbcolor) & 0xff; (g) = ( (argbcolor) >> 8) & 0xff; (r) = ((argbcolor) >> 16) & 0xff; (srcA) = ((argbcolor) >> 24) & 0xff ; } while (0); srcG = (ByteGrayDataType)(((77*(r)) + (150*(g) ) + (29*(b)) + 128) / 256); } 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 { int x = 0; ; do { do { jint dstG; jint mixValSrc = pixels[x]; if (mixValSrc) { if (mixValSrc < 255 ) { jint mixValDst = 255 - mixValSrc; (dstG) = (jubyte)pixLut [pPix[x]]; dstG = mul8table[mixValDst][dstG] + mul8table[mixValSrc ][srcG]; (pPix)[x] = (jubyte) (pixInvGrayLut[dstG]);; } else { ((pPix)[x] = (jubyte)(fgpixel)); } } } while (0);; ; } while (++x < width); pPix = ((void *) (((intptr_t) (pPix)) + (scan ))); pixels += rowBytes; ; } while (--height > 0); } } |
252 | |
253 | DEFINE_TRANSFORMHELPERS(Index8Gray)void Index8GrayNrstNbrTransformHelper(SurfaceDataRasInfo *pSrcInfo , jint *pRGB, jint numpix, jlong xlong, jlong dxlong, jlong ylong , jlong dylong) { jint *SrcReadLut; Index8GrayDataType *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) { Index8GrayDataType *pRow = ((void *) (((intptr_t ) (pBase)) + (((intptr_t) (((jint) ((ylong) >> 32)))) * (scan)))); (pRGB)[0] = SrcReadLut[pRow[((jint) ((xlong) >> 32))]]; pRGB++; xlong += dxlong; ylong += dylong; } } void Index8GrayBilinearTransformHelper (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; Index8GrayDataType *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 )))); (pRGB)[0] = SrcReadLut[pRow[xwhole]]; (pRGB)[1] = SrcReadLut [pRow[xwhole+xdelta]]; pRow = ((void *) (((intptr_t) (pRow)) + (ydelta))); (pRGB)[2] = SrcReadLut[pRow[xwhole]]; (pRGB)[3] = SrcReadLut[pRow[xwhole+xdelta]]; pRGB += 4; xlong += dxlong; ylong += dylong; } } void Index8GrayBicubicTransformHelper(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; Index8GrayDataType *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))); (pRGB)[0] = SrcReadLut [pRow[xwhole+xdelta0]]; (pRGB)[1] = SrcReadLut[pRow[xwhole]]; (pRGB)[2] = SrcReadLut[pRow[xwhole+xdelta1]]; (pRGB)[3] = SrcReadLut [pRow[xwhole+xdelta2]]; pRow = ((void *) (((intptr_t) (pRow)) + (-ydelta0))); (pRGB)[4] = SrcReadLut[pRow[xwhole+xdelta0]] ; (pRGB)[5] = SrcReadLut[pRow[xwhole]]; (pRGB)[6] = SrcReadLut [pRow[xwhole+xdelta1]]; (pRGB)[7] = SrcReadLut[pRow[xwhole+xdelta2 ]]; pRow = ((void *) (((intptr_t) (pRow)) + (ydelta1))); (pRGB )[8] = SrcReadLut[pRow[xwhole+xdelta0]]; (pRGB)[9] = SrcReadLut [pRow[xwhole]]; (pRGB)[10] = SrcReadLut[pRow[xwhole+xdelta1]] ; (pRGB)[11] = SrcReadLut[pRow[xwhole+xdelta2]]; pRow = ((void *) (((intptr_t) (pRow)) + (ydelta2))); (pRGB)[12] = SrcReadLut [pRow[xwhole+xdelta0]]; (pRGB)[13] = SrcReadLut[pRow[xwhole]] ; (pRGB)[14] = SrcReadLut[pRow[xwhole+xdelta1]]; (pRGB)[15] = SrcReadLut[pRow[xwhole+xdelta2]]; pRGB += 16; xlong += dxlong ; ylong += dylong; } } TransformHelperFuncs Index8GrayTransformHelperFuncs = { Index8GrayNrstNbrTransformHelper, Index8GrayBilinearTransformHelper , Index8GrayBicubicTransformHelper, }; |