FourByteAbgr.c revision 2362
7568150a58e78021968b6c22bc28e9787b33496agwr/*
7568150a58e78021968b6c22bc28e9787b33496agwr * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
7568150a58e78021968b6c22bc28e9787b33496agwr * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7568150a58e78021968b6c22bc28e9787b33496agwr *
7568150a58e78021968b6c22bc28e9787b33496agwr * This code is free software; you can redistribute it and/or modify it
7568150a58e78021968b6c22bc28e9787b33496agwr * under the terms of the GNU General Public License version 2 only, as
7568150a58e78021968b6c22bc28e9787b33496agwr * published by the Free Software Foundation. Oracle designates this
7568150a58e78021968b6c22bc28e9787b33496agwr * particular file as subject to the "Classpath" exception as provided
7568150a58e78021968b6c22bc28e9787b33496agwr * by Oracle in the LICENSE file that accompanied this code.
7568150a58e78021968b6c22bc28e9787b33496agwr *
7568150a58e78021968b6c22bc28e9787b33496agwr * This code is distributed in the hope that it will be useful, but WITHOUT
7568150a58e78021968b6c22bc28e9787b33496agwr * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7568150a58e78021968b6c22bc28e9787b33496agwr * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7568150a58e78021968b6c22bc28e9787b33496agwr * version 2 for more details (a copy is included in the LICENSE file that
7568150a58e78021968b6c22bc28e9787b33496agwr * accompanied this code).
7568150a58e78021968b6c22bc28e9787b33496agwr *
7568150a58e78021968b6c22bc28e9787b33496agwr * You should have received a copy of the GNU General Public License version
7568150a58e78021968b6c22bc28e9787b33496agwr * 2 along with this work; if not, write to the Free Software Foundation,
7568150a58e78021968b6c22bc28e9787b33496agwr * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7568150a58e78021968b6c22bc28e9787b33496agwr *
7568150a58e78021968b6c22bc28e9787b33496agwr * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * or visit www.oracle.com if you need additional information or have any
7568150a58e78021968b6c22bc28e9787b33496agwr * questions.
7568150a58e78021968b6c22bc28e9787b33496agwr */
7568150a58e78021968b6c22bc28e9787b33496agwr
7568150a58e78021968b6c22bc28e9787b33496agwr#include "Any4Byte.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "FourByteAbgr.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "AlphaMacros.h"
7568150a58e78021968b6c22bc28e9787b33496agwr
7568150a58e78021968b6c22bc28e9787b33496agwr#include "IntArgb.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "IntArgbBm.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "IntArgbPre.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "IntRgb.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "ThreeByteBgr.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "ByteGray.h"
7568150a58e78021968b6c22bc28e9787b33496agwr#include "ByteIndexed.h"
7568150a58e78021968b6c22bc28e9787b33496agwr
7568150a58e78021968b6c22bc28e9787b33496agwr/*
7568150a58e78021968b6c22bc28e9787b33496agwr * This file declares, registers, and defines the various graphics
7568150a58e78021968b6c22bc28e9787b33496agwr * primitive loops to manipulate surfaces of type "FourByteAbgr".
7568150a58e78021968b6c22bc28e9787b33496agwr *
7568150a58e78021968b6c22bc28e9787b33496agwr * See also LoopMacros.h
7568150a58e78021968b6c22bc28e9787b33496agwr */
7568150a58e78021968b6c22bc28e9787b33496agwr
7568150a58e78021968b6c22bc28e9787b33496agwrRegisterFunc RegisterFourByteAbgr;
7568150a58e78021968b6c22bc28e9787b33496agwr
7568150a58e78021968b6c22bc28e9787b33496agwrDECLARE_CONVERT_BLIT(FourByteAbgr, IntArgb);
7568150a58e78021968b6c22bc28e9787b33496agwrDECLARE_CONVERT_BLIT(IntArgb, FourByteAbgr);
7568150a58e78021968b6c22bc28e9787b33496agwrDECLARE_CONVERT_BLIT(IntRgb, FourByteAbgr);
7568150a58e78021968b6c22bc28e9787b33496agwrDECLARE_CONVERT_BLIT(ThreeByteBgr, FourByteAbgr);
7568150a58e78021968b6c22bc28e9787b33496agwrDECLARE_CONVERT_BLIT(ByteGray, FourByteAbgr);
DECLARE_CONVERT_BLIT(ByteIndexed, FourByteAbgr);
DECLARE_SCALE_BLIT(FourByteAbgr, IntArgb);
DECLARE_SCALE_BLIT(IntArgb, FourByteAbgr);
DECLARE_SCALE_BLIT(IntRgb, FourByteAbgr);
DECLARE_SCALE_BLIT(ThreeByteBgr, FourByteAbgr);
DECLARE_SCALE_BLIT(ByteGray, FourByteAbgr);
DECLARE_SCALE_BLIT(ByteIndexed, FourByteAbgr);
DECLARE_XPAR_CONVERT_BLIT(ByteIndexedBm, FourByteAbgr);
DECLARE_XPAR_SCALE_BLIT(ByteIndexedBm, FourByteAbgr);
DECLARE_XPAR_SCALE_BLIT(IntArgbBm, FourByteAbgr);
DECLARE_XPAR_BLITBG(ByteIndexedBm, FourByteAbgr);
DECLARE_XOR_BLIT(IntArgb, FourByteAbgr);
DECLARE_SRC_MASKFILL(FourByteAbgr);
DECLARE_SRCOVER_MASKFILL(FourByteAbgr);
DECLARE_ALPHA_MASKFILL(FourByteAbgr);
DECLARE_SRCOVER_MASKBLIT(IntArgb, FourByteAbgr);
DECLARE_ALPHA_MASKBLIT(IntArgb, FourByteAbgr);
DECLARE_SRCOVER_MASKBLIT(IntArgbPre, FourByteAbgr);
DECLARE_ALPHA_MASKBLIT(IntArgbPre, FourByteAbgr);
DECLARE_ALPHA_MASKBLIT(IntRgb, FourByteAbgr);
DECLARE_SOLID_DRAWGLYPHLISTAA(FourByteAbgr);
DECLARE_SOLID_DRAWGLYPHLISTLCD(FourByteAbgr);
DECLARE_TRANSFORMHELPER_FUNCS(FourByteAbgr);
NativePrimitive FourByteAbgrPrimitives[] = {
REGISTER_ANY4BYTE_ISOCOPY_BLIT(FourByteAbgr),
REGISTER_ANY4BYTE_ISOSCALE_BLIT(FourByteAbgr),
REGISTER_CONVERT_BLIT(FourByteAbgr, IntArgb),
REGISTER_CONVERT_BLIT(IntArgb, FourByteAbgr),
REGISTER_CONVERT_BLIT(IntRgb, FourByteAbgr),
REGISTER_CONVERT_BLIT(ThreeByteBgr, FourByteAbgr),
REGISTER_CONVERT_BLIT(ByteGray, FourByteAbgr),
REGISTER_CONVERT_BLIT(ByteIndexed, FourByteAbgr),
REGISTER_SCALE_BLIT(FourByteAbgr, IntArgb),
REGISTER_SCALE_BLIT(IntArgb, FourByteAbgr),
REGISTER_SCALE_BLIT(IntRgb, FourByteAbgr),
REGISTER_SCALE_BLIT(ThreeByteBgr, FourByteAbgr),
REGISTER_SCALE_BLIT(ByteGray, FourByteAbgr),
REGISTER_SCALE_BLIT(ByteIndexed, FourByteAbgr),
REGISTER_XPAR_CONVERT_BLIT(ByteIndexedBm, FourByteAbgr),
REGISTER_XPAR_SCALE_BLIT(ByteIndexedBm, FourByteAbgr),
REGISTER_XPAR_SCALE_BLIT(IntArgbBm, FourByteAbgr),
REGISTER_XPAR_BLITBG(ByteIndexedBm, FourByteAbgr),
REGISTER_XOR_BLIT(IntArgb, FourByteAbgr),
REGISTER_SRC_MASKFILL(FourByteAbgr),
REGISTER_SRCOVER_MASKFILL(FourByteAbgr),
REGISTER_ALPHA_MASKFILL(FourByteAbgr),
REGISTER_SRCOVER_MASKBLIT(IntArgb, FourByteAbgr),
REGISTER_ALPHA_MASKBLIT(IntArgb, FourByteAbgr),
REGISTER_SRCOVER_MASKBLIT(IntArgbPre, FourByteAbgr),
REGISTER_ALPHA_MASKBLIT(IntArgbPre, FourByteAbgr),
REGISTER_ALPHA_MASKBLIT(IntRgb, FourByteAbgr),
REGISTER_SOLID_DRAWGLYPHLISTAA(FourByteAbgr),
REGISTER_SOLID_DRAWGLYPHLISTLCD(FourByteAbgr),
REGISTER_TRANSFORMHELPER_FUNCS(FourByteAbgr),
};
jboolean RegisterFourByteAbgr(JNIEnv *env)
{
return RegisterPrimitives(env, FourByteAbgrPrimitives,
ArraySize(FourByteAbgrPrimitives));
}
jint PixelForFourByteAbgr(SurfaceDataRasInfo *pRasInfo, jint rgb)
{
return ((rgb << 8) | (((juint) rgb) >> 24));
}
DEFINE_CONVERT_BLIT(FourByteAbgr, IntArgb, 1IntArgb)
DEFINE_CONVERT_BLIT(IntArgb, FourByteAbgr, 4ByteArgb)
DEFINE_CONVERT_BLIT(IntRgb, FourByteAbgr, 3ByteRgb)
DEFINE_CONVERT_BLIT(ThreeByteBgr, FourByteAbgr, 3ByteRgb)
DEFINE_CONVERT_BLIT(ByteGray, FourByteAbgr, 3ByteRgb)
DEFINE_CONVERT_BLIT_LUT8(ByteIndexed, FourByteAbgr, ConvertOnTheFly)
DEFINE_SCALE_BLIT(FourByteAbgr, IntArgb, 1IntArgb)
DEFINE_SCALE_BLIT(IntArgb, FourByteAbgr, 4ByteArgb)
DEFINE_SCALE_BLIT(IntRgb, FourByteAbgr, 3ByteRgb)
DEFINE_SCALE_BLIT(ThreeByteBgr, FourByteAbgr, 3ByteRgb)
DEFINE_SCALE_BLIT(ByteGray, FourByteAbgr, 3ByteRgb)
DEFINE_SCALE_BLIT_LUT8(ByteIndexed, FourByteAbgr, ConvertOnTheFly)
DEFINE_XPAR_CONVERT_BLIT_LUT8(ByteIndexedBm, FourByteAbgr, ConvertOnTheFly)
DEFINE_XPAR_SCALE_BLIT_LUT8(ByteIndexedBm, FourByteAbgr, ConvertOnTheFly)
DEFINE_XPAR_SCALE_BLIT(IntArgbBm, FourByteAbgr, 1IntRgb)
DEFINE_XPAR_BLITBG_LUT8(ByteIndexedBm, FourByteAbgr, ConvertOnTheFly)
DEFINE_XOR_BLIT(IntArgb, FourByteAbgr, Any4Byte)
DEFINE_SRC_MASKFILL(FourByteAbgr, 4ByteArgb)
DEFINE_SRCOVER_MASKFILL(FourByteAbgr, 4ByteArgb)
DEFINE_ALPHA_MASKFILL(FourByteAbgr, 4ByteArgb)
DEFINE_SRCOVER_MASKBLIT(IntArgb, FourByteAbgr, 4ByteArgb)
DEFINE_ALPHA_MASKBLIT(IntArgb, FourByteAbgr, 4ByteArgb)
DEFINE_SRCOVER_MASKBLIT(IntArgbPre, FourByteAbgr, 4ByteArgb)
DEFINE_ALPHA_MASKBLIT(IntArgbPre, FourByteAbgr, 4ByteArgb)
DEFINE_ALPHA_MASKBLIT(IntRgb, FourByteAbgr, 4ByteArgb)
DEFINE_SOLID_DRAWGLYPHLISTAA(FourByteAbgr, 4ByteArgb)
DEFINE_SOLID_DRAWGLYPHLISTLCD(FourByteAbgr, 4ByteArgb)
DEFINE_TRANSFORMHELPERS(FourByteAbgr)