Пример #1
0
void NAME_CONVERT_BLIT(Index8Gray, Index8Gray)
    (void *srcBase, void *dstBase,
     juint width, juint height,
     SurfaceDataRasInfo *pSrcInfo,
     SurfaceDataRasInfo *pDstInfo,
     NativePrimitive *pPrim,
     CompositeInfo *pCompInfo)
{
    DeclareIndex8GrayLoadVars(SrcRead)
    DeclareIndex8GrayLoadVars(DstRead)
    jint srcScan = pSrcInfo->scanStride;
    jint dstScan = pDstInfo->scanStride;

    InitIndex8GrayLoadVars(SrcRead, pSrcInfo);
    InitIndex8GrayLoadVars(DstRead, pDstInfo);

    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
        do {
            memcpy(dstBase, srcBase, width);
            srcBase = PtrAddBytes(srcBase, srcScan);
            dstBase = PtrAddBytes(dstBase, dstScan);
        } while (--height > 0);
    } else {
        DeclareIndex8GrayStoreVars(DstWrite);
        InitIndex8GrayStoreVarsY(DstWrite, pDstInfo);

        BlitLoopWidthHeight(Index8Gray, pSrc, srcBase, pSrcInfo,
                            Index8Gray, pDst, dstBase, pDstInfo, DstWrite,
                            width, height,
                            ConvertVia1ByteGray
                                (pSrc, Index8Gray, SrcRead,
                                 pDst, Index8Gray, DstWrite, 0, 0));
    }
}
Пример #2
0
void NAME_SCALE_BLIT(ByteIndexed, ByteIndexed)
    (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)
{
    DeclareByteIndexedLoadVars(SrcRead)
    DeclareByteIndexedLoadVars(DstRead)
    jint srcScan = pSrcInfo->scanStride;
    jint dstScan = pDstInfo->scanStride;
    DeclareByteIndexedStoreVars(DstWrite)

    InitByteIndexedLoadVars(SrcRead, pSrcInfo);
    InitByteIndexedLoadVars(DstRead, pDstInfo);

    if (checkSameLut(SrcReadLut, DstReadLut, pSrcInfo, pDstInfo)) {
	BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,
				 ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,
				 x, width, height,
				 sxloc, syloc, sxinc, syinc, shift,
				 pDst[0] = pSrc[x]);
    } else {
	BlitLoopScaleWidthHeight(ByteIndexed, pSrc, srcBase, pSrcInfo,
				 ByteIndexed, pDst, dstBase, pDstInfo, DstWrite,
				 x, width, height,
				 sxloc, syloc, sxinc, syinc, shift,
				 ConvertVia3ByteRgb(pSrc, ByteIndexed, SrcRead,
						    pDst, ByteIndexed, DstWrite,
						    x, 0));
    }
}