```
1 /*
2 * Copyright (c) 1996, 1998, 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 /*
27 * This file provides some global definitions needed by the image
28 * conversion package.
29 */
30
31 #ifndef IMAGE_GLOBALS_H
32 #define IMAGE_GLOBALS_H
33
34
35 /* Image Conversion function return codes. */
36 #define SCALEFAILURE -1
37 #define SCALENOOP 0
38 #define SCALESUCCESS 1
39
40 /*
41 * The constants needed to choose from among the many variants of image
42 * conversion functions that can be constructed with the standard header
43 * files. The types of input for the image conversion functions are
44 * broken down into 5 different attributes each with 2 to 4 different
45 * variants:
46 *
47 * SCALING: SCALED or UNSCALED
48 * INPUT SIZE: BYTEIN (8-bit) or INTIN (32-bit)
49 * ALPHA: OPAQUE or ALPHA
50 * ORDER: TDLR or RANDOM
51 * COLORMODEL: ICM, DCM, DCM8 (8-bits for each component) or ANY
52 *
53 * For each attribute, a mask is defined with the "BITS" suffix which
``` ```
127 */
128 typedef int ImgConvertFcn(void *colormodel,
129 int srcOX, int srcOY, int srcW, int srcH,
130 void *srcpix, int srcOff, int srcBPP, int srcScan,
131 int srcTotalWidth, int srcTotalHeight,
132 int dstTotalWidth, int dstTotalHeight,
133 ImgConvertData *cvdata, ImgColorData *clrdata);
134
135 /*
136 * The type of the error matrix used in the ordered dithering code.
137 */
138 typedef unsigned char uns_ordered_dither_array[8][8];
139 typedef char sgn_ordered_dither_array[8][8];
140
141 /*
142 * The function provided for constructing the ordered dithering error
143 * matrices based on a given quantum (i.e. the amplitude of the maximum
144 * error values appearing in the matrix which should be the same as the
145 * distance between adjacent allocated component values in the color cube).
146 */
147 extern void make_uns_ordered_dither_array(uns_ordered_dither_array oda,
148 int quantum);
149 extern void make_sgn_ordered_dither_array(char* oda, int errmin, int errmax);
150
151 /*
152 * The function provided for calculating the contents of the ImgCMData
153 * structure which can be attached to ColorModels to simplify the
154 * work of characterizing their data.
155 */
156 extern ImgCMData *img_getCMData(void *cmh);
157
158 #endif /* IMAGE_GLOBALS_H */
``` | 1 /* 2 * Copyright (c) 1996, 2018, 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 /* 27 * This file provides some global definitions needed by the image 28 * conversion package. 29 */ 30 31 #ifndef IMAGE_GLOBALS_H 32 #define IMAGE_GLOBALS_H 33 34 #include "jni.h" 35 36 /* Image Conversion function return codes. */ 37 #define SCALEFAILURE -1 38 #define SCALENOOP 0 39 #define SCALESUCCESS 1 40 41 /* 42 * The constants needed to choose from among the many variants of image 43 * conversion functions that can be constructed with the standard header 44 * files. The types of input for the image conversion functions are 45 * broken down into 5 different attributes each with 2 to 4 different 46 * variants: 47 * 48 * SCALING: SCALED or UNSCALED 49 * INPUT SIZE: BYTEIN (8-bit) or INTIN (32-bit) 50 * ALPHA: OPAQUE or ALPHA 51 * ORDER: TDLR or RANDOM 52 * COLORMODEL: ICM, DCM, DCM8 (8-bits for each component) or ANY 53 * 54 * For each attribute, a mask is defined with the "BITS" suffix which 128 */ 129 typedef int ImgConvertFcn(void *colormodel, 130 int srcOX, int srcOY, int srcW, int srcH, 131 void *srcpix, int srcOff, int srcBPP, int srcScan, 132 int srcTotalWidth, int srcTotalHeight, 133 int dstTotalWidth, int dstTotalHeight, 134 ImgConvertData *cvdata, ImgColorData *clrdata); 135 136 /* 137 * The type of the error matrix used in the ordered dithering code. 138 */ 139 typedef unsigned char uns_ordered_dither_array[8][8]; 140 typedef char sgn_ordered_dither_array[8][8]; 141 142 /* 143 * The function provided for constructing the ordered dithering error 144 * matrices based on a given quantum (i.e. the amplitude of the maximum 145 * error values appearing in the matrix which should be the same as the 146 * distance between adjacent allocated component values in the color cube). 147 */ 148 JNIEXPORT void JNICALL 149 make_uns_ordered_dither_array(uns_ordered_dither_array oda, 150 int quantum); 151 extern void make_sgn_ordered_dither_array(char* oda, int errmin, int errmax); 152 153 /* 154 * The function provided for calculating the contents of the ImgCMData 155 * structure which can be attached to ColorModels to simplify the 156 * work of characterizing their data. 157 */ 158 extern ImgCMData *img_getCMData(void *cmh); 159 160 #endif /* IMAGE_GLOBALS_H */ |