update dev300-m58
[ooovba.git] / jpeg / jpeg-6b.patch
blobc7c96a3eb736aa04bda3eec0c2d1905c028c1841
1 --- misc/jpeg-6b/jconfig.h 2009-03-19 11:30:46.000000000 +0100
2 +++ misc/build/jpeg-6b/jconfig.h 2009-03-19 11:30:30.000000000 +0100
3 @@ -1 +1,16 @@
4 -dummy
5 +#define HAVE_PROTOTYPES
6 +#define HAVE_UNSIGNED_CHAR
7 +#define HAVE_UNSIGNED_SHORT
8 +#undef CHAR_IS_UNSIGNED
9 +#define HAVE_STDDEF_H
10 +#define HAVE_STDLIB_H
11 +#undef NEED_BSD_STRINGS
12 +#undef NEED_SYS_TYPES_H
13 +#undef NEED_FAR_POINTERS
14 +#undef NEED_SHORT_EXTERNAL_NAMES
15 +#undef INCOMPLETE_TYPES_BROKEN
17 +#ifdef JPEG_INTERNALS
18 +#undef RIGHT_SHIFT_IS_UNSIGNED
19 +#define NO_GETENV
20 +#endif
21 --- misc/jpeg-6b/jdcolor.c 1997-08-04 01:39:16.000000000 +0200
22 +++ misc/build/jpeg-6b/jdcolor.c 2009-03-19 11:30:30.000000000 +0100
23 @@ -284,6 +284,90 @@
27 +METHODDEF(void)
28 +ycck_rgb_convert (j_decompress_ptr cinfo,
29 + JSAMPIMAGE input_buf, JDIMENSION input_row,
30 + JSAMPARRAY output_buf, int num_rows)
32 + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
33 + JDIMENSION num_cols = cinfo->output_width;
34 + long cc, cm, cy, ck;
35 + long y, cb, cr;
36 + register JSAMPROW outptr;
37 + register JSAMPROW inptr0, inptr1, inptr2, inptr3;
38 + register JDIMENSION col;
39 + register JSAMPLE* range_limit = cinfo->sample_range_limit;
40 + register int* Crrtab = cconvert->Cr_r_tab;
41 + register int* Cbbtab = cconvert->Cb_b_tab;
42 + register INT32* Crgtab = cconvert->Cr_g_tab;
43 + register INT32* Cbgtab = cconvert->Cb_g_tab;
44 + SHIFT_TEMPS
46 + while( --num_rows >= 0 )
47 + {
48 + inptr0 = input_buf[0][input_row];
49 + inptr1 = input_buf[1][input_row];
50 + inptr2 = input_buf[2][input_row];
51 + inptr3 = input_buf[3][input_row++];
53 + for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
54 + {
55 + y = GETJSAMPLE(inptr0[col]);
56 + cb = GETJSAMPLE(inptr1[col]);
57 + cr = GETJSAMPLE(inptr2[col]);
59 + // YCCK => CMYK
60 + cc = 255L - range_limit[MAXJSAMPLE - (y + Crrtab[cr])];
61 + cm = 255L - range_limit[MAXJSAMPLE - (y + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS)))];
62 + cy = 255L - range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];
63 + ck = 255L - inptr3[col];
65 + // CMYK => RGB
66 + outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
67 + outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
68 + outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
69 + outptr += RGB_PIXELSIZE;
70 + }
71 + }
74 +METHODDEF(void)
75 +cmyk_rgb_convert (j_decompress_ptr cinfo,
76 + JSAMPIMAGE input_buf, JDIMENSION input_row,
77 + JSAMPARRAY output_buf, int num_rows)
79 + my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
80 + JDIMENSION num_cols = cinfo->output_width;
81 + long cc, cm, cy, ck;
82 + long y, cb, cr;
83 + register JSAMPROW outptr;
84 + register JSAMPROW inptr0, inptr1, inptr2, inptr3;
85 + register JDIMENSION col;
86 + register JSAMPLE* range_limit = cinfo->sample_range_limit;
87 + SHIFT_TEMPS
89 + while( --num_rows >= 0 )
90 + {
91 + inptr0 = input_buf[0][input_row];
92 + inptr1 = input_buf[1][input_row];
93 + inptr2 = input_buf[2][input_row];
94 + inptr3 = input_buf[3][input_row++];
96 + for( col = 0, outptr = *output_buf++; col < num_cols; col++ )
97 + {
98 + cc = 255 - GETJSAMPLE(inptr0[col]);
99 + cm = 255 - GETJSAMPLE(inptr1[col]);
100 + cy = 255 - GETJSAMPLE(inptr2[col]);
101 + ck = 255 - GETJSAMPLE(inptr3[col]);
103 + // CMYK => RGB
104 + outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ];
105 + outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ];
106 + outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ];
107 + outptr += RGB_PIXELSIZE;
113 * Empty method for start_pass.
114 @@ -364,6 +448,11 @@
115 cconvert->pub.color_convert = gray_rgb_convert;
116 } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) {
117 cconvert->pub.color_convert = null_convert;
118 + } else if (cinfo->jpeg_color_space == JCS_YCCK) {
119 + cconvert->pub.color_convert = ycck_rgb_convert;
120 + build_ycc_rgb_table(cinfo);
121 + } else if (cinfo->jpeg_color_space == JCS_CMYK) {
122 + cconvert->pub.color_convert = cmyk_rgb_convert;
123 } else
124 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
125 break;
126 --- misc/jpeg-6b/jmorecfg.h 1997-08-10 01:58:56.000000000 +0200
127 +++ misc/build/jpeg-6b/jmorecfg.h 2009-03-19 11:30:30.000000000 +0100
128 @@ -157,8 +157,8 @@
130 /* INT32 must hold at least signed 32-bit values. */
132 -#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */
133 -typedef long INT32;
134 +#if !defined XMD_H && !defined _SOLAR_H /* X11/xmd.h correctly defines INT32 */
135 +typedef int INT32;
136 #endif
138 /* Datatype used for image dimensions. The JPEG standard only supports
139 @@ -311,9 +311,9 @@
140 * can't use color quantization if you change that value.
143 -#define RGB_RED 0 /* Offset of Red in an RGB scanline element */
144 +#define RGB_RED 2 /* Offset of Red in an RGB scanline element */
145 #define RGB_GREEN 1 /* Offset of Green */
146 -#define RGB_BLUE 2 /* Offset of Blue */
147 +#define RGB_BLUE 0 /* Offset of Blue */
148 #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */
151 --- misc/jpeg-6b/makefile.mk 2009-03-19 11:30:46.000000000 +0100
152 +++ misc/build/jpeg-6b/makefile.mk 2009-03-19 11:30:30.000000000 +0100
153 @@ -1 +1,82 @@
154 -dummy
155 +#*************************************************************************
157 +# $RCSfile: makefile.mk,v $
159 +# $Revision: 1.5 $
161 +# last change: $Author: thb $ $Date: 2001/08/14 12:53:46 $
163 +# Copyright according the GNU Public License.
165 +#*************************************************************************
167 +PRJ=..$/..$/..$/..
169 +PRJNAME=jpeg
170 +TARGET=jpeglib
171 +LIBTARGET=NO
172 +EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
173 +VISIBILITY_HIDDEN=TRUE
175 +# --- Settings -----------------------------------------------------------
177 +.INCLUDE : settings.mk
180 +.IF "$(GUI)$(CPU)"=="WNTP"
181 +CFLAGS=$(CFLAGS) -Od
182 +.ENDIF
184 +# --- Files --------------------------------------------------------
186 +SLOFILES= $(SLO)$/jcapimin.obj \
187 + $(SLO)$/jcapistd.obj \
188 + $(SLO)$/jccoefct.obj \
189 + $(SLO)$/jccolor.obj \
190 + $(SLO)$/jcdctmgr.obj \
191 + $(SLO)$/jcinit.obj \
192 + $(SLO)$/jchuff.obj \
193 + $(SLO)$/jcphuff.obj \
194 + $(SLO)$/jcmainct.obj \
195 + $(SLO)$/jcmarker.obj \
196 + $(SLO)$/jcmaster.obj \
197 + $(SLO)$/jcomapi.obj \
198 + $(SLO)$/jcparam.obj \
199 + $(SLO)$/jcprepct.obj \
200 + $(SLO)$/jcsample.obj \
201 + $(SLO)$/jdhuff.obj \
202 + $(SLO)$/jdinput.obj \
203 + $(SLO)$/jdtrans.obj \
204 + $(SLO)$/jdapimin.obj \
205 + $(SLO)$/jdapistd.obj \
206 + $(SLO)$/jdatadst.obj \
207 + $(SLO)$/jdatasrc.obj \
208 + $(SLO)$/jdcoefct.obj \
209 + $(SLO)$/jdcolor.obj \
210 + $(SLO)$/jddctmgr.obj \
211 + $(SLO)$/jdphuff.obj \
212 + $(SLO)$/jdmainct.obj \
213 + $(SLO)$/jdmarker.obj \
214 + $(SLO)$/jdmaster.obj \
215 + $(SLO)$/jdmerge.obj \
216 + $(SLO)$/jdpostct.obj \
217 + $(SLO)$/jdsample.obj \
218 + $(SLO)$/jerror.obj \
219 + $(SLO)$/jfdctflt.obj \
220 + $(SLO)$/jfdctfst.obj \
221 + $(SLO)$/jfdctint.obj \
222 + $(SLO)$/jidctflt.obj \
223 + $(SLO)$/jidctfst.obj \
224 + $(SLO)$/jidctint.obj \
225 + $(SLO)$/jidctred.obj \
226 + $(SLO)$/jmemmgr.obj \
227 + $(SLO)$/jmemnobs.obj \
228 + $(SLO)$/jquant1.obj \
229 + $(SLO)$/jquant2.obj \
230 + $(SLO)$/jutils.obj
232 +LIB1TARGET=$(SLB)$/$(TARGET).lib
233 +LIB1ARCHIV=$(LB)$/lib$(TARGET).a
234 +LIB1OBJFILES=$(SLOFILES)
236 +.INCLUDE : target.mk