| File: | jdk/src/java.desktop/share/native/libawt/java2d/loops/Index12Gray.c |
| Warning: | line 196, 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 | |
| 28 | #include "AnyShort.h" |
| 29 | #include "Index12Gray.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 "Index8Gray.h" |
| 39 | |
| 40 | /* |
| 41 | * This file declares, registers, and defines the various graphics |
| 42 | * primitive loops to manipulate surfaces of type "Index12Gray". |
| 43 | * |
| 44 | * See also LoopMacros.h |
| 45 | */ |
| 46 | |
| 47 | RegisterFunc RegisterIndex12Gray; |
| 48 | |
| 49 | DECLARE_CONVERT_BLIT(Index12Gray, IntArgb)BlitFunc Index12GrayToIntArgbConvert; |
| 50 | DECLARE_CONVERT_BLIT(IntArgb, Index12Gray)BlitFunc IntArgbToIndex12GrayConvert; |
| 51 | DECLARE_CONVERT_BLIT(ThreeByteBgr, Index12Gray)BlitFunc ThreeByteBgrToIndex12GrayConvert; |
| 52 | DECLARE_CONVERT_BLIT(ByteGray, Index12Gray)BlitFunc ByteGrayToIndex12GrayConvert; |
| 53 | DECLARE_CONVERT_BLIT(Index8Gray, Index12Gray)BlitFunc Index8GrayToIndex12GrayConvert; |
| 54 | DECLARE_CONVERT_BLIT(ByteIndexed, Index12Gray)BlitFunc ByteIndexedToIndex12GrayConvert; |
| 55 | DECLARE_CONVERT_BLIT(Index12Gray, Index12Gray)BlitFunc Index12GrayToIndex12GrayConvert; |
| 56 | |
| 57 | DECLARE_SCALE_BLIT(Index12Gray, Index12Gray)ScaleBlitFunc Index12GrayToIndex12GrayScaleConvert; |
| 58 | DECLARE_SCALE_BLIT(Index12Gray, IntArgb)ScaleBlitFunc Index12GrayToIntArgbScaleConvert; |
| 59 | DECLARE_SCALE_BLIT(IntArgb, Index12Gray)ScaleBlitFunc IntArgbToIndex12GrayScaleConvert; |
| 60 | DECLARE_SCALE_BLIT(ThreeByteBgr, Index12Gray)ScaleBlitFunc ThreeByteBgrToIndex12GrayScaleConvert; |
| 61 | DECLARE_SCALE_BLIT(UshortGray, Index12Gray)ScaleBlitFunc UshortGrayToIndex12GrayScaleConvert; |
| 62 | DECLARE_SCALE_BLIT(ByteIndexed, Index12Gray)ScaleBlitFunc ByteIndexedToIndex12GrayScaleConvert; |
| 63 | DECLARE_SCALE_BLIT(ByteGray, Index12Gray)ScaleBlitFunc ByteGrayToIndex12GrayScaleConvert; |
| 64 | DECLARE_SCALE_BLIT(Index8Gray, Index12Gray)ScaleBlitFunc Index8GrayToIndex12GrayScaleConvert; |
| 65 | |
| 66 | DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, Index12Gray)BlitFunc ByteIndexedBmToIndex12GrayXparOver; |
| 67 | DECLARE_XPAR_BLITBG(ByteIndexedBm, Index12Gray)BlitBgFunc ByteIndexedBmToIndex12GrayXparBgCopy; |
| 68 | |
| 69 | DECLARE_XOR_BLIT(IntArgb, Index12Gray)BlitFunc IntArgbToIndex12GrayXorBlit; |
| 70 | DECLARE_ALPHA_MASKFILL(Index12Gray)MaskFillFunc Index12GrayAlphaMaskFill; |
| 71 | DECLARE_ALPHA_MASKBLIT(IntArgb, Index12Gray)MaskBlitFunc IntArgbToIndex12GrayAlphaMaskBlit; |
| 72 | DECLARE_ALPHA_MASKBLIT(IntArgbPre, Index12Gray)MaskBlitFunc IntArgbPreToIndex12GrayAlphaMaskBlit; |
| 73 | DECLARE_ALPHA_MASKBLIT(IntRgb, Index12Gray)MaskBlitFunc IntRgbToIndex12GrayAlphaMaskBlit; |
| 74 | DECLARE_SRCOVER_MASKFILL(Index12Gray)MaskFillFunc Index12GraySrcOverMaskFill; |
| 75 | DECLARE_SRCOVER_MASKBLIT(IntArgb, Index12Gray)MaskBlitFunc IntArgbToIndex12GraySrcOverMaskBlit; |
| 76 | DECLARE_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray)MaskBlitFunc IntArgbPreToIndex12GraySrcOverMaskBlit; |
| 77 | DECLARE_SOLID_DRAWGLYPHLISTAA(Index12Gray)DrawGlyphListAAFunc Index12GrayDrawGlyphListAA; |
| 78 | |
| 79 | DECLARE_TRANSFORMHELPER_FUNCS(Index12Gray)TransformHelperFunc Index12GrayNrstNbrTransformHelper; TransformHelperFunc Index12GrayBilinearTransformHelper; TransformHelperFunc Index12GrayBicubicTransformHelper ; TransformHelperFuncs Index12GrayTransformHelperFuncs; |
| 80 | |
| 81 | NativePrimitive Index12GrayPrimitives[] = { |
| 82 | REGISTER_CONVERT_BLIT(IntArgb, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GrayConvert }, {IntArgbToIndex12GrayConvert}, 0, 0 }, |
| 83 | REGISTER_CONVERT_BLIT_EQUIV(IntRgb, Index12Gray,{ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GrayConvert }, {IntArgbToIndex12GrayConvert}, 0, 0 } |
| 84 | NAME_CONVERT_BLIT(IntArgb, Index12Gray)){ & PrimitiveTypes.Blit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GrayConvert }, {IntArgbToIndex12GrayConvert}, 0, 0 }, |
| 85 | REGISTER_CONVERT_BLIT(ThreeByteBgr, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ThreeByteBgr, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {ThreeByteBgrToIndex12GrayConvert}, {ThreeByteBgrToIndex12GrayConvert }, 0, 0 }, |
| 86 | REGISTER_CONVERT_BLIT(ByteGray, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteGray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {ByteGrayToIndex12GrayConvert }, {ByteGrayToIndex12GrayConvert}, 0, 0 }, |
| 87 | REGISTER_CONVERT_BLIT(Index8Gray, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.Index8Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {Index8GrayToIndex12GrayConvert }, {Index8GrayToIndex12GrayConvert}, 0, 0 }, |
| 88 | REGISTER_CONVERT_BLIT_FLAGS(Index12Gray, Index12Gray,{ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {Index12GrayToIndex12GrayConvert }, {Index12GrayToIndex12GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), } |
| 89 | SD_LOCK_LUT,{ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {Index12GrayToIndex12GrayConvert }, {Index12GrayToIndex12GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), } |
| 90 | SD_LOCK_LUT | SD_LOCK_INVGRAY){ & PrimitiveTypes.Blit, & SurfaceTypes.Index12Gray, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {Index12GrayToIndex12GrayConvert }, {Index12GrayToIndex12GrayConvert}, (1 << 2), (1 << 2) | (1 << 4), }, |
| 91 | REGISTER_CONVERT_BLIT(ByteIndexed, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexed, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray, {ByteIndexedToIndex12GrayConvert }, {ByteIndexedToIndex12GrayConvert}, 0, 0 }, |
| 92 | |
| 93 | REGISTER_SCALE_BLIT(Index12Gray, IntArgb){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgb, { Index12GrayToIntArgbScaleConvert}, {Index12GrayToIntArgbScaleConvert }, 0, 0 }, |
| 94 | REGISTER_SCALE_BLIT(IntArgb, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntArgb , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {IntArgbToIndex12GrayScaleConvert}, {IntArgbToIndex12GrayScaleConvert }, 0, 0 }, |
| 95 | REGISTER_SCALE_BLIT_EQUIV(IntRgb, Index12Gray,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {IntArgbToIndex12GrayScaleConvert}, {IntArgbToIndex12GrayScaleConvert }, 0, 0 } |
| 96 | NAME_SCALE_BLIT(IntArgb, Index12Gray)){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.IntRgb, & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {IntArgbToIndex12GrayScaleConvert}, {IntArgbToIndex12GrayScaleConvert }, 0, 0 }, |
| 97 | REGISTER_SCALE_BLIT(ThreeByteBgr, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ThreeByteBgr , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {ThreeByteBgrToIndex12GrayScaleConvert}, {ThreeByteBgrToIndex12GrayScaleConvert }, 0, 0 }, |
| 98 | REGISTER_SCALE_BLIT(UshortGray, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.UshortGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {UshortGrayToIndex12GrayScaleConvert}, {UshortGrayToIndex12GrayScaleConvert }, 0, 0 }, |
| 99 | REGISTER_SCALE_BLIT(ByteIndexed, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteIndexed , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {ByteIndexedToIndex12GrayScaleConvert}, {ByteIndexedToIndex12GrayScaleConvert }, 0, 0 }, |
| 100 | REGISTER_SCALE_BLIT(ByteGray, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.ByteGray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {ByteGrayToIndex12GrayScaleConvert}, {ByteGrayToIndex12GrayScaleConvert }, 0, 0 }, |
| 101 | REGISTER_SCALE_BLIT(Index8Gray, Index12Gray){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index8Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {Index8GrayToIndex12GrayScaleConvert}, {Index8GrayToIndex12GrayScaleConvert }, 0, 0 }, |
| 102 | REGISTER_SCALE_BLIT_FLAGS(Index12Gray, Index12Gray, 0,{ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {Index12GrayToIndex12GrayScaleConvert}, {Index12GrayToIndex12GrayScaleConvert }, 0, (1 << 2) | (1 << 4), } |
| 103 | SD_LOCK_LUT | SD_LOCK_INVGRAY){ & PrimitiveTypes.ScaledBlit, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {Index12GrayToIndex12GrayScaleConvert}, {Index12GrayToIndex12GrayScaleConvert }, 0, (1 << 2) | (1 << 4), }, |
| 104 | |
| 105 | REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcOverBmNoEa, & SurfaceTypes.Index12Gray , {ByteIndexedBmToIndex12GrayXparOver}, {ByteIndexedBmToIndex12GrayXparOver }, 0, 0 }, |
| 106 | REGISTER_XPAR_BLITBG(ByteIndexedBm, Index12Gray){ & PrimitiveTypes.BlitBg, & SurfaceTypes.ByteIndexedBm , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {ByteIndexedBmToIndex12GrayXparBgCopy}, {ByteIndexedBmToIndex12GrayXparBgCopy }, 0, 0 }, |
| 107 | |
| 108 | REGISTER_XOR_BLIT(IntArgb, Index12Gray){ & PrimitiveTypes.Blit, & SurfaceTypes.IntArgb, & CompositeTypes.Xor, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GrayXorBlit }, {IntArgbToIndex12GrayXorBlit}, 0, 0 }, |
| 109 | REGISTER_ALPHA_MASKFILL(Index12Gray){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index12Gray , {Index12GrayAlphaMaskFill}, {Index12GrayAlphaMaskFill}, 0, 0 }, |
| 110 | REGISTER_ALPHA_MASKBLIT(IntArgb, Index12Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GrayAlphaMaskBlit }, {IntArgbToIndex12GrayAlphaMaskBlit}, 0, 0 }, |
| 111 | REGISTER_ALPHA_MASKBLIT(IntArgbPre, Index12Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.AnyAlpha, & SurfaceTypes.Index12Gray , {IntArgbPreToIndex12GrayAlphaMaskBlit}, {IntArgbPreToIndex12GrayAlphaMaskBlit }, 0, 0 }, |
| 112 | REGISTER_ALPHA_MASKBLIT(IntRgb, Index12Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntRgb, & CompositeTypes.AnyAlpha, & SurfaceTypes.Index12Gray, {IntRgbToIndex12GrayAlphaMaskBlit }, {IntRgbToIndex12GrayAlphaMaskBlit}, 0, 0 }, |
| 113 | REGISTER_SRCOVER_MASKFILL(Index12Gray){ & PrimitiveTypes.MaskFill, & SurfaceTypes.AnyColor, & CompositeTypes.SrcOver, & SurfaceTypes.Index12Gray , {Index12GraySrcOverMaskFill}, {Index12GraySrcOverMaskFill}, 0, 0 }, |
| 114 | REGISTER_SRCOVER_MASKBLIT(IntArgb, Index12Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgb, & CompositeTypes.SrcOver, & SurfaceTypes.Index12Gray, {IntArgbToIndex12GraySrcOverMaskBlit }, {IntArgbToIndex12GraySrcOverMaskBlit}, 0, 0 }, |
| 115 | REGISTER_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray){ & PrimitiveTypes.MaskBlit, & SurfaceTypes.IntArgbPre , & CompositeTypes.SrcOver, & SurfaceTypes.Index12Gray , {IntArgbPreToIndex12GraySrcOverMaskBlit}, {IntArgbPreToIndex12GraySrcOverMaskBlit }, 0, 0 }, |
| 116 | REGISTER_SOLID_DRAWGLYPHLISTAA(Index12Gray){ & PrimitiveTypes.DrawGlyphListAA, & SurfaceTypes.AnyColor , & CompositeTypes.SrcNoEa, & SurfaceTypes.Index12Gray , {Index12GrayDrawGlyphListAA}, {Index12GrayDrawGlyphListAA}, 0, 0 }, |
| 117 | |
| 118 | REGISTER_TRANSFORMHELPER_FUNCS(Index12Gray){ & PrimitiveTypes.TransformHelper, & SurfaceTypes.Index12Gray , & CompositeTypes.SrcNoEa, & SurfaceTypes.IntArgbPre , {(AnyFunc *) &Index12GrayTransformHelperFuncs}, {(AnyFunc *) &Index12GrayTransformHelperFuncs}, 0, 0 }, |
| 119 | }; |
| 120 | |
| 121 | extern jboolean checkSameLut(jint *SrcReadLut, jint *DstReadLut, |
| 122 | SurfaceDataRasInfo *pSrcInfo, |
| 123 | SurfaceDataRasInfo *pDstInfo); |
| 124 | |
| 125 | jboolean RegisterIndex12Gray(JNIEnv *env) |
| 126 | { |
| 127 | return RegisterPrimitives(env, Index12GrayPrimitives, |
| 128 | ArraySize(Index12GrayPrimitives)(sizeof(Index12GrayPrimitives) / sizeof(Index12GrayPrimitives [0]))); |
| 129 | } |
| 130 | |
| 131 | jint PixelForIndex12Gray(SurfaceDataRasInfo *pRasInfo, jint rgb) |
| 132 | { |
| 133 | jint r, g, b, gray; |
| 134 | ExtractIntDcmComponentsX123(rgb, r, g, b)do { (b) = (rgb) & 0xff; (g) = ((rgb) >> 8) & 0xff ; (r) = ((rgb) >> 16) & 0xff; } while (0); |
| 135 | gray = ComposeByteGrayFrom3ByteRgb(r, g, b)(ByteGrayDataType)(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256 ); |
| 136 | return pRasInfo->invGrayTable[gray]; |
| 137 | } |
| 138 | |
| 139 | DEFINE_CONVERT_BLIT(IntArgb, Index12Gray, 3ByteRgb)void IntArgbToIndex12GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { IntArgbDataType *pSrc = ( IntArgbDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 4; dstScan -= (width ) * 2; 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] = (jushort) (DstWriteInvGrayLut[gray]); } while (0); } while ( 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 140 | |
| 141 | DEFINE_CONVERT_BLIT(ThreeByteBgr, Index12Gray, 3ByteRgb)void ThreeByteBgrToIndex12GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { ThreeByteBgrDataType *pSrc = (ThreeByteBgrDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 3; dstScan -= (width) * 2; 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] = (jushort) (DstWriteInvGrayLut[gray]); } while (0); } while ( 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (3))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 142 | |
| 143 | DEFINE_CONVERT_BLIT(ByteGray, Index12Gray, 1ByteGray)void ByteGrayToIndex12GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *DstWriteInvGrayLut; ; do { ByteGrayDataType *pSrc = ( ByteGrayDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width ) * 2; do { juint w = width; ; do { do { jint gray; (gray) = ( pSrc)[0]; (pDst)[0] = (jushort) (DstWriteInvGrayLut[gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (-- height > 0); } while (0); } |
| 144 | |
| 145 | DEFINE_CONVERT_BLIT(Index8Gray, Index12Gray, 1ByteGray)void Index8GrayToIndex12GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; jint *DstWriteInvGrayLut; SrcReadLut = ( pSrcInfo)->lutBase; do { Index8GrayDataType *pSrc = (Index8GrayDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width ) * 2; do { juint w = width; ; do { do { jint gray; (gray) = ( jubyte)SrcReadLut[pSrc[0]]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 146 | |
| 147 | DEFINE_CONVERT_BLIT(ByteIndexed, Index12Gray, 3ByteRgb)void ByteIndexedToIndex12GrayConvert(void *srcBase, void *dstBase , juint width, juint height, SurfaceDataRasInfo *pSrcInfo, SurfaceDataRasInfo *pDstInfo, NativePrimitive *pPrim, CompositeInfo *pCompInfo) { jint *SrcReadLut; jint *DstWriteInvGrayLut; SrcReadLut = ( pSrcInfo)->lutBase; do { ByteIndexedDataType *pSrc = (ByteIndexedDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width ) * 2; do { juint w = width; ; 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 { int gray = (ByteGrayDataType )(((77*(r)) + (150*(g)) + (29*(b)) + 128) / 256); (pDst)[0] = (jushort) (DstWriteInvGrayLut[gray]); } while (0); } while ( 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 148 | |
| 149 | void NAME_CONVERT_BLIT(Index12Gray, Index12Gray)Index12GrayToIndex12GrayConvert |
| 150 | (void *srcBase, void *dstBase, |
| 151 | juint width, juint height, |
| 152 | SurfaceDataRasInfo *pSrcInfo, |
| 153 | SurfaceDataRasInfo *pDstInfo, |
| 154 | NativePrimitive *pPrim, |
| 155 | CompositeInfo *pCompInfo) |
| 156 | { |
| 157 | DeclareIndex12GrayLoadVars(SrcRead)jint *SrcReadLut; |
| 158 | DeclareIndex12GrayLoadVars(DstRead)jint *DstReadLut; |
| 159 | jint srcScan = pSrcInfo->scanStride; |
| 160 | jint dstScan = pDstInfo->scanStride; |
| 161 | |
| 162 | InitIndex12GrayLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
| 163 | InitIndex12GrayLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
| 164 | |
| 165 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
| 166 | do { |
| 167 | memcpy(dstBase, srcBase, width); |
| 168 | srcBase = PtrAddBytes(srcBase, srcScan)((void *) (((intptr_t) (srcBase)) + (srcScan))); |
| 169 | dstBase = PtrAddBytes(dstBase, dstScan)((void *) (((intptr_t) (dstBase)) + (dstScan))); |
| 170 | } while (--height > 0); |
| 171 | } else { |
| 172 | DeclareIndex12GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut;; |
| 173 | InitIndex12GrayStoreVarsY(DstWrite, pDstInfo)DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; |
| 174 | |
| 175 | BlitLoopWidthHeight(Index12Gray, pSrc, srcBase, pSrcInfo,do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
| 176 | Index12Gray, pDst, dstBase, pDstInfo, DstWrite,do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
| 177 | width, height,do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
| 178 | ConvertVia1ByteGraydo { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
| 179 | (pSrc, Index12Gray, SrcRead,do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0) |
| 180 | pDst, Index12Gray, DstWrite, 0, 0))do { Index12GrayDataType *pSrc = (Index12GrayDataType *) (srcBase ); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase ); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = ( pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)-> invGrayTable;; srcScan -= (width) * 2; dstScan -= (width) * 2 ; do { juint w = width; ; do { do { jint gray; (gray) = (jubyte )SrcReadLut[pSrc[0] & 0xfff]; (pDst)[0] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (2))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | void NAME_SCALE_BLIT(Index12Gray, Index12Gray)Index12GrayToIndex12GrayScaleConvert |
| 185 | (void *srcBase, void *dstBase, |
| 186 | juint width, juint height, |
| 187 | jint sxloc, jint syloc, |
| 188 | jint sxinc, jint syinc, jint shift, |
| 189 | SurfaceDataRasInfo *pSrcInfo, |
| 190 | SurfaceDataRasInfo *pDstInfo, |
| 191 | NativePrimitive *pPrim, |
| 192 | CompositeInfo *pCompInfo) |
| 193 | { |
| 194 | DeclareIndex8GrayLoadVars(SrcRead)jint *SrcReadLut; |
| 195 | DeclareIndex8GrayLoadVars(DstRead)jint *DstReadLut; |
| 196 | jint srcScan = pSrcInfo->scanStride; |
Value stored to 'srcScan' during its initialization is never read | |
| 197 | jint dstScan = pDstInfo->scanStride; |
| 198 | DeclareIndex8GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut; |
| 199 | |
| 200 | InitIndex8GrayLoadVars(SrcRead, pSrcInfo)SrcReadLut = (pSrcInfo)->lutBase; |
| 201 | InitIndex8GrayLoadVars(DstRead, pDstInfo)DstReadLut = (pDstInfo)->lutBase; |
| 202 | |
| 203 | if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) { |
| 204 | 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) |
| 205 | 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) |
| 206 | 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) |
| 207 | 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) |
| 208 | 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); |
| 209 | } else { |
| 210 | DeclareIndex8GrayStoreVars(DstWrite)jint *DstWriteInvGrayLut;; |
| 211 | InitIndex8GrayStoreVarsY(DstWrite, pDstInfo)DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; |
| 212 | 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) |
| 213 | 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) |
| 214 | 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) |
| 215 | 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) |
| 216 | 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) |
| 217 | 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) |
| 218 | 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); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | DEFINE_SCALE_BLIT(Index12Gray, IntArgb, 1IntArgb)void Index12GrayToIntArgbScaleConvert(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; SrcReadLut = (pSrcInfo)->lutBase; do { Index12GrayDataType *pSrc; IntArgbDataType *pDst = (IntArgbDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; ; dstScan -= (width) * 4 ; do { juint w = width; jint tmpsxloc = sxloc; pSrc = ((void * ) (((intptr_t) (srcBase)) + (((intptr_t) ((syloc >> shift ))) * (srcScan)))); ; do { jint x = (tmpsxloc >> shift) ; do { int argb; (argb) = SrcReadLut[pSrc[x] & 0xfff]; (pDst )[0] = (argb); } while (0); pDst = ((void *) (((intptr_t) (pDst )) + (4))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc ; } while (--height > 0); } while (0); } |
| 223 | |
| 224 | DEFINE_SCALE_BLIT(IntArgb, Index12Gray, 3ByteRgb)void IntArgbToIndex12GrayScaleConvert(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; Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; dstScan -= (width) * 2; 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] = (jushort) (DstWriteInvGrayLut[gray ]); } while (0); } while (0); pDst = ((void *) (((intptr_t) ( pDst)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc ; } while (--height > 0); } while (0); } |
| 225 | |
| 226 | DEFINE_SCALE_BLIT(ThreeByteBgr, Index12Gray, 3ByteRgb)void ThreeByteBgrToIndex12GrayScaleConvert(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; Index12GrayDataType *pDst = (Index12GrayDataType *) ( dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo) ->invGrayTable;; dstScan -= (width) * 2; 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] = (jushort ) (DstWriteInvGrayLut[gray]); } while (0); } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
| 227 | |
| 228 | DEFINE_SCALE_BLIT(UshortGray, Index12Gray, 1ByteGray)void UshortGrayToIndex12GrayScaleConvert(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; Index12GrayDataType *pDst = (Index12GrayDataType *) ( dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo) ->invGrayTable;; dstScan -= (width) * 2; 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] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
| 229 | |
| 230 | DEFINE_SCALE_BLIT_LUT8(ByteIndexed, Index12Gray, PreProcessLut)void ByteIndexedToIndex12GrayScaleConvert(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; Index12GrayPixelType 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 { Index12GrayPixelType *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] = (jushort) (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] = (jushort) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } while (0 ); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedDataType *pSrc; Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 2; 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)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t ) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0);} |
| 231 | |
| 232 | DEFINE_SCALE_BLIT(ByteGray, Index12Gray, 1ByteGray)void ByteGrayToIndex12GrayScaleConvert(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; Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; dstScan -= (width) * 2; 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] = (jushort) (DstWriteInvGrayLut [gray]);; } while (0); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0); } |
| 233 | |
| 234 | DEFINE_SCALE_BLIT_LUT8(Index8Gray, Index12Gray, PreProcessLut)void Index8GrayToIndex12GrayScaleConvert(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; Index12GrayPixelType 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 { Index12GrayPixelType *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] = (jushort) (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] = (jushort) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } while (0 ); ; } while (++x < lutSize); } while (0); } while (0); do { Index8GrayDataType *pSrc; Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo )->invGrayTable;; dstScan -= (width) * 2; 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)) + (2))); ; tmpsxloc += sxinc; } while (--w > 0); pDst = ((void *) (((intptr_t ) (pDst)) + (dstScan))); ; syloc += syinc; } while (--height > 0); } while (0);} |
| 235 | |
| 236 | DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, Index12Gray, PreProcessLut)void ByteIndexedBmToIndex12GrayXparOver(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] = (jushort) (PreLutInvGrayLut[gray] ); } while (0); } while (0); } else { pixLut[x] = -1; } } while (0); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedBmDataType *pSrc = (ByteIndexedBmDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType * ) (dstBase); jint srcScan = (pSrcInfo)->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo) ->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width ) * 2; do { juint w = width; ; do { do { jint pix = pixLut[pSrc [0]]; if (! (pix < 0)) { pDst[0] = (Index12GrayPixelType) pix ; } } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1)) ); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while ( --w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan ))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 237 | |
| 238 | DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, Index12Gray, PreProcessLut)void ByteIndexedBmToIndex12GrayXparBgCopy(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] = (jushort) ( PreLutInvGrayLut[gray]); } while (0); } while (0); } else { pixLut [x] = bgpixel; } } while (0); ; } while (++x < lutSize); } while (0); } while (0); do { ByteIndexedBmDataType *pSrc = ( ByteIndexedBmDataType *) (srcBase); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 1; dstScan -= (width) * 2; do { juint w = width; ; do { do { jint pix = pixLut[pSrc[0]]; ((pDst)[0] = (jushort) (pix)); } while (0); pSrc = ((void *) (((intptr_t) (pSrc)) + (1))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 239 | |
| 240 | DEFINE_XOR_BLIT(IntArgb, Index12Gray, AnyShort)void IntArgbToIndex12GrayXorBlit(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); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint srcScan = (pSrcInfo )->scanStride; jint dstScan = (pDstInfo)->scanStride; DstWriteInvGrayLut = (pDstInfo)->invGrayTable;; srcScan -= (width) * 4; dstScan -= (width) * 2; 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)) + (2))); ; } while (--w > 0); pSrc = ((void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } while (0); } |
| 241 | |
| 242 | DEFINE_ALPHA_MASKFILL(Index12Gray, 1ByteGray)void Index12GrayAlphaMaskFill (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; Index12GrayDataType *pRas = (Index12GrayDataType *) (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 * 2; 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)) + (2))); ; 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)) + (2))); ; 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] & 0xfff]; if (dstA != 0xff ) { tmpG = mul8table[dstA][tmpG]; } resG += tmpG; } } if (!(0 ) && resA && resA < 0xff) { resG = div8table [resA][resG]; } (pRas)[0] = (jushort) (DstWriteInvGrayLut[resG ]);; pRas = ((void *) (((intptr_t) (pRas)) + (2))); ; } while (--w > 0); pRas = ((void *) (((intptr_t) (pRas)) + (rasScan ))); ; if (pMask) { pMask = ((void *) (((intptr_t) (pMask)) + (maskScan))); } } while (--height > 0); } |
| 243 | |
| 244 | DEFINE_ALPHA_MASKBLIT(IntArgb, Index12Gray, 1ByteGray)void IntArgbToIndex12GrayAlphaMaskBlit (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); Index12GrayDataType *pDst = ( Index12GrayDataType *) (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 * 2; 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)) + (2))); ; 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)) + (2))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; 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] & 0xfff]; if (dstF != 0xff ) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG; } } if (!(0 ) && resA && resA < 0xff) { resG = div8table [resA][resG]; } (pDst)[0] = (jushort) (DstWriteInvGrayLut[resG ]);; pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = (( void *) (((intptr_t) (pDst)) + (2))); ; } 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); } |
| 245 | |
| 246 | DEFINE_ALPHA_MASKBLIT(IntArgbPre, Index12Gray, 1ByteGray)void IntArgbPreToIndex12GrayAlphaMaskBlit (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); Index12GrayDataType *pDst = (Index12GrayDataType *) (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 * 2; 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)) + (2))); ; 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)) + (2))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; 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] & 0xfff]; if (dstF != 0xff ) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG; } } if (!(0 ) && resA && resA < 0xff) { resG = div8table [resA][resG]; } (pDst)[0] = (jushort) (DstWriteInvGrayLut[resG ]);; pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = (( void *) (((intptr_t) (pDst)) + (2))); ; } 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); } |
| 247 | |
| 248 | DEFINE_ALPHA_MASKBLIT(IntRgb, Index12Gray, 1ByteGray)void IntRgbToIndex12GrayAlphaMaskBlit (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); Index12GrayDataType *pDst = (Index12GrayDataType *) (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 * 2; 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)) + (2))); ; 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)) + (2))); ; continue; } resG = 0; } } else { if (dstF == 0xff) { pSrc = ((void *) (((intptr_t) (pSrc )) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; 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] & 0xfff]; if (dstF != 0xff) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG; } } if (!(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pDst)[0] = (jushort) (DstWriteInvGrayLut [resG]);; pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) (((intptr_t) (pDst)) + (2))); ; } 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); } |
| 249 | |
| 250 | DEFINE_SRCOVER_MASKFILL(Index12Gray, 1ByteGray)void Index12GraySrcOverMaskFill (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; Index12GrayDataType *pRas = (Index12GrayDataType * ) (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 * 2; 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] & 0xfff]; if (dstF != 0xff) { tmpG = mul8table[dstF][tmpG]; } resG += tmpG ; } } if (!(1) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pRas)[0] = (jushort ) (DstWriteInvGrayLut[resG]);; } pRas = ((void *) (((intptr_t ) (pRas)) + (2))); ; } 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] & 0xfff]; resG = mul8table[dstF][resG] + srcG; if (!(1) && !(0) && resA && resA < 0xff) { resG = div8table[resA][resG]; } (pRas)[0] = (jushort ) (DstWriteInvGrayLut[resG]);; pRas = ((void *) (((intptr_t) ( pRas)) + (2))); ; } while (--w > 0); pRas = ((void *) (((intptr_t ) (pRas)) + (rasScan))); ; } while (--height > 0); } } |
| 251 | |
| 252 | DEFINE_SRCOVER_MASKBLIT(IntArgb, Index12Gray, 1ByteGray)void IntArgbToIndex12GraySrcOverMaskBlit (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); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint SrcPix; jint *DstPixLut; jint *DstWriteInvGrayLut ; SrcPix = 0; DstPixLut = (pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 2; 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] & 0xfff]; 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] = (jushort) (DstWriteInvGrayLut[resG]);; } } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (2))); ; } 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] & 0xfff]; 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] = (jushort) (DstWriteInvGrayLut[resG]);; } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ( (void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } } |
| 253 | |
| 254 | DEFINE_SRCOVER_MASKBLIT(IntArgbPre, Index12Gray, 1ByteGray)void IntArgbPreToIndex12GraySrcOverMaskBlit (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); Index12GrayDataType *pDst = (Index12GrayDataType *) (dstBase); jint SrcPix; jint *DstPixLut; jint *DstWriteInvGrayLut ; SrcPix = 0; DstPixLut = (pDstInfo)->lutBase; srcScan -= width * 4; dstScan -= width * 2; 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] & 0xfff]; 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] = (jushort) (DstWriteInvGrayLut[resG]);; } } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (2))); ; } 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] & 0xfff]; 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] = (jushort) (DstWriteInvGrayLut[resG]);; } pSrc = ((void *) (((intptr_t) (pSrc)) + (4))); pDst = ((void *) ( ((intptr_t) (pDst)) + (2))); ; } while (--w > 0); pSrc = ( (void *) (((intptr_t) (pSrc)) + (srcScan))); pDst = ((void *) (((intptr_t) (pDst)) + (dstScan))); ; } while (--height > 0); } } |
| 255 | |
| 256 | DEFINE_SOLID_DRAWGLYPHLISTAA(Index12Gray, 1ByteGray)void Index12GrayDrawGlyphListAA(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; Index12GrayDataType *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))*(2)))); ; 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] & 0xfff]; dstG = mul8table[mixValDst][dstG] + mul8table [mixValSrc][srcG]; (pPix)[x] = (jushort) (pixInvGrayLut[dstG] );; } else { ((pPix)[x] = (jushort) (fgpixel)); } } } while ( 0);; ; } while (++x < width); pPix = ((void *) (((intptr_t ) (pPix)) + (scan))); pixels += rowBytes; ; } while (--height > 0); } } |
| 257 | |
| 258 | DEFINE_TRANSFORMHELPERS(Index12Gray)void Index12GrayNrstNbrTransformHelper(SurfaceDataRasInfo *pSrcInfo , jint *pRGB, jint numpix, jlong xlong, jlong dxlong, jlong ylong , jlong dylong) { jint *SrcReadLut; Index12GrayDataType *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) { Index12GrayDataType *pRow = ((void *) ((( intptr_t) (pBase)) + (((intptr_t) (((jint) ((ylong) >> 32 )))) * (scan)))); (pRGB)[0] = SrcReadLut[(pRow)[((jint) ((xlong ) >> 32))] & 0xfff]; pRGB++; xlong += dxlong; ylong += dylong; } } void Index12GrayBilinearTransformHelper(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; Index12GrayDataType *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] & 0xfff]; (pRGB )[1] = SrcReadLut[(pRow)[xwhole+xdelta] & 0xfff]; pRow = ( (void *) (((intptr_t) (pRow)) + (ydelta))); (pRGB)[2] = SrcReadLut [(pRow)[xwhole] & 0xfff]; (pRGB)[3] = SrcReadLut[(pRow)[xwhole +xdelta] & 0xfff]; pRGB += 4; xlong += dxlong; ylong += dylong ; } } void Index12GrayBicubicTransformHelper(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; Index12GrayDataType *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] & 0xfff]; (pRGB)[1] = SrcReadLut[ (pRow)[xwhole] & 0xfff]; (pRGB)[2] = SrcReadLut[(pRow)[xwhole +xdelta1] & 0xfff]; (pRGB)[3] = SrcReadLut[(pRow)[xwhole+ xdelta2] & 0xfff]; pRow = ((void *) (((intptr_t) (pRow)) + (-ydelta0))); (pRGB)[4] = SrcReadLut[(pRow)[xwhole+xdelta0] & 0xfff]; (pRGB)[5] = SrcReadLut[(pRow)[xwhole] & 0xfff]; ( pRGB)[6] = SrcReadLut[(pRow)[xwhole+xdelta1] & 0xfff]; (pRGB )[7] = SrcReadLut[(pRow)[xwhole+xdelta2] & 0xfff]; pRow = ((void *) (((intptr_t) (pRow)) + (ydelta1))); (pRGB)[8] = SrcReadLut [(pRow)[xwhole+xdelta0] & 0xfff]; (pRGB)[9] = SrcReadLut[ (pRow)[xwhole] & 0xfff]; (pRGB)[10] = SrcReadLut[(pRow)[xwhole +xdelta1] & 0xfff]; (pRGB)[11] = SrcReadLut[(pRow)[xwhole +xdelta2] & 0xfff]; pRow = ((void *) (((intptr_t) (pRow)) + (ydelta2))); (pRGB)[12] = SrcReadLut[(pRow)[xwhole+xdelta0 ] & 0xfff]; (pRGB)[13] = SrcReadLut[(pRow)[xwhole] & 0xfff ]; (pRGB)[14] = SrcReadLut[(pRow)[xwhole+xdelta1] & 0xfff ]; (pRGB)[15] = SrcReadLut[(pRow)[xwhole+xdelta2] & 0xfff ]; pRGB += 16; xlong += dxlong; ylong += dylong; } } TransformHelperFuncs Index12GrayTransformHelperFuncs = { Index12GrayNrstNbrTransformHelper , Index12GrayBilinearTransformHelper, Index12GrayBicubicTransformHelper , }; |