Path: blob/master/src/java.desktop/share/native/libawt/java2d/loops/ByteBinary1Bit.c
41159 views
/*1* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include "ByteBinary1Bit.h"2627#include "IntArgb.h"2829/*30* This file declares, registers, and defines the various graphics31* primitive loops to manipulate surfaces of type "ByteBinary1Bit".32*33* See also LoopMacros.h34*/3536RegisterFunc RegisterByteBinary1Bit;3738DECLARE_SOLID_FILLRECT(ByteBinary1Bit);39DECLARE_SOLID_FILLSPANS(ByteBinary1Bit);40DECLARE_SOLID_DRAWLINE(ByteBinary1Bit);41DECLARE_XOR_FILLRECT(ByteBinary1Bit);42DECLARE_XOR_FILLSPANS(ByteBinary1Bit);43DECLARE_XOR_DRAWLINE(ByteBinary1Bit);44DECLARE_SOLID_DRAWGLYPHLIST(ByteBinary1Bit);45DECLARE_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit);46DECLARE_XOR_DRAWGLYPHLIST(ByteBinary1Bit);4748DECLARE_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit);49DECLARE_CONVERT_BLIT(ByteBinary1Bit, IntArgb);50DECLARE_CONVERT_BLIT(IntArgb, ByteBinary1Bit);51DECLARE_XOR_BLIT(IntArgb, ByteBinary1Bit);5253DECLARE_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb);54DECLARE_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit);55DECLARE_ALPHA_MASKFILL(ByteBinary1Bit);5657NativePrimitive ByteBinary1BitPrimitives[] = {58REGISTER_SOLID_FILLRECT(ByteBinary1Bit),59REGISTER_SOLID_FILLSPANS(ByteBinary1Bit),60REGISTER_SOLID_LINE_PRIMITIVES(ByteBinary1Bit),61REGISTER_XOR_FILLRECT(ByteBinary1Bit),62REGISTER_XOR_FILLSPANS(ByteBinary1Bit),63REGISTER_XOR_LINE_PRIMITIVES(ByteBinary1Bit),64REGISTER_SOLID_DRAWGLYPHLIST(ByteBinary1Bit),65REGISTER_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit),66REGISTER_XOR_DRAWGLYPHLIST(ByteBinary1Bit),6768REGISTER_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit),69REGISTER_CONVERT_BLIT(ByteBinary1Bit, IntArgb),70REGISTER_CONVERT_BLIT(IntArgb, ByteBinary1Bit),71REGISTER_XOR_BLIT(IntArgb, ByteBinary1Bit),7273REGISTER_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb),74REGISTER_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit),75REGISTER_ALPHA_MASKFILL(ByteBinary1Bit),76};7778jboolean RegisterByteBinary1Bit(JNIEnv *env)79{80return RegisterPrimitives(env, ByteBinary1BitPrimitives,81ArraySize(ByteBinary1BitPrimitives));82}8384jint PixelForByteBinary(SurfaceDataRasInfo *pRasInfo, jint rgb)85{86jint r, g, b;87ExtractIntDcmComponentsX123(rgb, r, g, b);88return SurfaceData_InvColorMap(pRasInfo->invColorTable, r, g, b);89}9091DEFINE_BYTE_BINARY_SOLID_FILLRECT(ByteBinary1Bit)9293DEFINE_BYTE_BINARY_SOLID_FILLSPANS(ByteBinary1Bit)9495DEFINE_BYTE_BINARY_SOLID_DRAWLINE(ByteBinary1Bit)9697DEFINE_BYTE_BINARY_XOR_FILLRECT(ByteBinary1Bit)9899DEFINE_BYTE_BINARY_XOR_FILLSPANS(ByteBinary1Bit)100101DEFINE_BYTE_BINARY_XOR_DRAWLINE(ByteBinary1Bit)102103DEFINE_BYTE_BINARY_SOLID_DRAWGLYPHLIST(ByteBinary1Bit)104105DEFINE_BYTE_BINARY_SOLID_DRAWGLYPHLISTAA(ByteBinary1Bit, 3ByteRgb)106107DEFINE_BYTE_BINARY_XOR_DRAWGLYPHLIST(ByteBinary1Bit)108109DEFINE_BYTE_BINARY_CONVERT_BLIT(ByteBinary1Bit, ByteBinary1Bit, 1IntRgb)110111DEFINE_BYTE_BINARY_CONVERT_BLIT(ByteBinary1Bit, IntArgb, 1IntArgb)112113DEFINE_BYTE_BINARY_CONVERT_BLIT(IntArgb, ByteBinary1Bit, 1IntRgb)114115DEFINE_BYTE_BINARY_XOR_BLIT(IntArgb, ByteBinary1Bit)116117DEFINE_BYTE_BINARY_ALPHA_MASKBLIT(ByteBinary1Bit, IntArgb, 4ByteArgb)118119DEFINE_BYTE_BINARY_ALPHA_MASKBLIT(IntArgb, ByteBinary1Bit, 4ByteArgb)120121DEFINE_BYTE_BINARY_ALPHA_MASKFILL(ByteBinary1Bit, 4ByteArgb)122123124