#include <stdio.h>
#include "jpeglib.h"
#include <setjmp.h>
Go to the source code of this file.
◆ my_error_ptr
◆ my_error_exit()
Definition at line 263 of file example.c.
264{
265
267
268
269
270 (*cinfo->err->output_message) (cinfo);
271
272
274}
struct my_error_mgr * my_error_ptr
Referenced by read_JPEG_file().
◆ read_JPEG_file()
read_JPEG_file |
( |
char * |
filename | ) |
|
Definition at line 284 of file example.c.
285{
286
287
288
290
291
292
293
295
298 int row_stride;
299
300
301
302
303
304
305
308 return 0;
309 }
310
311
312
313
316
317 if (
setjmp(jerr.setjmp_buffer)) {
318
319
320
323 return 0;
324 }
325
327
328
329
331
332
333
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349 (
void) jpeg_start_decompress(&cinfo);
350
351
352
353
354
355
356
357
358
359
360
361 row_stride = cinfo.output_width * cinfo.output_components;
362
363 buffer = (*cinfo.mem->alloc_sarray)
365
366
367
368
369
370
371
372 while (cinfo.output_scanline < cinfo.output_height) {
373
374
375
376
378
379 put_scanline_someplace(
buffer[0], row_stride);
380 }
381
382
383
385
386
387
388
389
390
391
393
394
395
396
397
398
400
401
402
403
404
405
406 return 1;
407}
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
jpeg_destroy_decompress(j_decompress_ptr cinfo)
jpeg_finish_decompress(j_decompress_ptr cinfo)
jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION max_lines)
jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile)
jpeg_std_error(struct jpeg_error_mgr *err)
#define jpeg_create_decompress(cinfo)
my_error_exit(j_common_ptr cinfo)
◆ write_JPEG_file()
write_JPEG_file |
( |
char * |
filename, |
|
|
int |
quality |
|
) |
| |
Definition at line 72 of file example.c.
73{
74
75
76
77
78
79
81
82
83
84
85
86
87
88
90
93 int row_stride;
94
95
96
97
98
99
100
101
103
105
106
107
108
109
110
111
112
113
117 }
119
120
121
122
123
124
127 cinfo.input_components = 3;
128 cinfo.in_color_space =
JCS_RGB;
129
130
131
132
134
135
136
138
139
140
141
142
143
145
146
147
148
149
150
151
152
153
155
156 while (cinfo.next_scanline < cinfo.image_height) {
157
158
159
160
161 row_pointer[0] = &
image_buffer[cinfo.next_scanline * row_stride];
163 }
164
165
166
168
170
171
172
173
175
176
177}
jpeg_destroy_compress(j_compress_ptr cinfo)
jpeg_finish_compress(j_compress_ptr cinfo)
jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines)
jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline)
jpeg_set_defaults(j_compress_ptr cinfo)
jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile)
#define jpeg_create_compress(cinfo)
◆ image_buffer
◆ image_height
◆ image_width