@img/sharp-libvips-dev 1.2.3 → 1.2.4-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/include/jpeglib.h CHANGED
@@ -4,10 +4,12 @@
4
4
  * This file was part of the Independent JPEG Group's software:
5
5
  * Copyright (C) 1991-1998, Thomas G. Lane.
6
6
  * Modified 2002-2009 by Guido Vollbeding.
7
+ * Lossless JPEG Modifications:
8
+ * Copyright (C) 1999, Ken Murchison.
7
9
  * libjpeg-turbo Modifications:
8
- * Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, 2023, D. R. Commander.
10
+ * Copyright (C) 2009-2011, 2013-2014, 2016-2017, 2020, 2022-2024,
11
+ D. R. Commander.
9
12
  * Copyright (C) 2015, Google, Inc.
10
- * mozjpeg Modifications:
11
13
  * Copyright (C) 2014, Mozilla Corporation.
12
14
  * For conditions of distribution and use, see the accompanying README.ijg
13
15
  * file.
@@ -17,6 +19,16 @@
17
19
  * and perhaps jerror.h if they want to know the exact error codes.
18
20
  */
19
21
 
22
+ /* NOTE: This header file does not include stdio.h, despite the fact that it
23
+ * uses FILE and size_t. That is by design, since the libjpeg API predates the
24
+ * widespread adoption of ANSI/ISO C. Referring to libjpeg.txt, it is a
25
+ * documented requirement that calling programs "include system headers that
26
+ * define at least the typedefs FILE and size_t" before including jpeglib.h.
27
+ * Technically speaking, changing that requirement by including stdio.h here
28
+ * would break backward API compatibility. Please do not file bug reports,
29
+ * feature requests, or pull requests regarding this.
30
+ */
31
+
20
32
  #ifndef JPEGLIB_H
21
33
  #define JPEGLIB_H
22
34
 
@@ -45,6 +57,13 @@ extern "C" {
45
57
  * if you want to be compatible.
46
58
  */
47
59
 
60
+ /* NOTE: In lossless mode, an MCU contains one or more samples rather than one
61
+ * or more 8x8 DCT blocks, so the term "data unit" is used to generically
62
+ * describe a sample in lossless mode or an 8x8 DCT block in lossy mode. To
63
+ * preserve backward API/ABI compatibility, the field and macro names retain
64
+ * the "block" terminology.
65
+ */
66
+
48
67
  #define DCTSIZE 8 /* The basic DCT block is 8x8 samples */
49
68
  #define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
50
69
  #define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
@@ -59,9 +78,9 @@ extern "C" {
59
78
  * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
60
79
  * sometimes emits noncompliant files doesn't mean you should too.
61
80
  */
62
- #define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
81
+ #define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on data units/MCU */
63
82
  #ifndef D_MAX_BLOCKS_IN_MCU
64
- #define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
83
+ #define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on data units/MCU */
65
84
  #endif
66
85
 
67
86
 
@@ -72,6 +91,20 @@ typedef JSAMPLE *JSAMPROW; /* ptr to one image row of pixel samples. */
72
91
  typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
73
92
  typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
74
93
 
94
+ typedef J12SAMPLE *J12SAMPROW; /* ptr to one image row of 12-bit pixel
95
+ samples. */
96
+ typedef J12SAMPROW *J12SAMPARRAY; /* ptr to some 12-bit sample rows (a 2-D
97
+ 12-bit sample array) */
98
+ typedef J12SAMPARRAY *J12SAMPIMAGE; /* a 3-D 12-bit sample array: top index is
99
+ color */
100
+
101
+ typedef J16SAMPLE *J16SAMPROW; /* ptr to one image row of 16-bit pixel
102
+ samples. */
103
+ typedef J16SAMPROW *J16SAMPARRAY; /* ptr to some 16-bit sample rows (a 2-D
104
+ 16-bit sample array) */
105
+ typedef J16SAMPARRAY *J16SAMPIMAGE; /* a 3-D 16-bit sample array: top index is
106
+ color */
107
+
75
108
  typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
76
109
  typedef JBLOCK *JBLOCKROW; /* pointer to one row of coefficient blocks */
77
110
  typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
@@ -137,17 +170,20 @@ typedef struct {
137
170
  /* Remaining fields should be treated as private by applications. */
138
171
 
139
172
  /* These values are computed during compression or decompression startup: */
140
- /* Component's size in DCT blocks.
141
- * Any dummy blocks added to complete an MCU are not counted; therefore
142
- * these values do not depend on whether a scan is interleaved or not.
173
+ /* Component's size in data units.
174
+ * In lossy mode, any dummy blocks added to complete an MCU are not counted;
175
+ * therefore these values do not depend on whether a scan is interleaved or
176
+ * not. In lossless mode, these are always equal to the image width and
177
+ * height.
143
178
  */
144
179
  JDIMENSION width_in_blocks;
145
180
  JDIMENSION height_in_blocks;
146
- /* Size of a DCT block in samples. Always DCTSIZE for compression.
147
- * For decompression this is the size of the output from one DCT block,
181
+ /* Size of a data unit in samples. Always DCTSIZE for lossy compression.
182
+ * For lossy decompression this is the size of the output from one DCT block,
148
183
  * reflecting any scaling we choose to apply during the IDCT step.
149
- * Values from 1 to 16 are supported.
150
- * Note that different components may receive different IDCT scalings.
184
+ * Values from 1 to 16 are supported. Note that different components may
185
+ * receive different IDCT scalings. In lossless mode, this is always equal
186
+ * to 1.
151
187
  */
152
188
  #if JPEG_LIB_VERSION >= 70
153
189
  int DCT_h_scaled_size;
@@ -158,8 +194,10 @@ typedef struct {
158
194
  /* The downsampled dimensions are the component's actual, unpadded number
159
195
  * of samples at the main buffer (preprocessing/compression interface), thus
160
196
  * downsampled_width = ceil(image_width * Hi/Hmax)
161
- * and similarly for height. For decompression, IDCT scaling is included, so
197
+ * and similarly for height. For lossy decompression, IDCT scaling is
198
+ * included, so
162
199
  * downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE)
200
+ * In lossless mode, these are always equal to the image width and height.
163
201
  */
164
202
  JDIMENSION downsampled_width; /* actual width in samples */
165
203
  JDIMENSION downsampled_height; /* actual height in samples */
@@ -171,12 +209,12 @@ typedef struct {
171
209
 
172
210
  /* These values are computed before starting a scan of the component. */
173
211
  /* The decompressor output side may not use these variables. */
174
- int MCU_width; /* number of blocks per MCU, horizontally */
175
- int MCU_height; /* number of blocks per MCU, vertically */
212
+ int MCU_width; /* number of data units per MCU, horizontally */
213
+ int MCU_height; /* number of data units per MCU, vertically */
176
214
  int MCU_blocks; /* MCU_width * MCU_height */
177
215
  int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_[h_]scaled_size */
178
- int last_col_width; /* # of non-dummy blocks across in last MCU */
179
- int last_row_height; /* # of non-dummy blocks down in last MCU */
216
+ int last_col_width; /* # of non-dummy data units across in last MCU */
217
+ int last_row_height; /* # of non-dummy data units down in last MCU */
180
218
 
181
219
  /* Saved quantization table for component; NULL if none yet saved.
182
220
  * See jdinput.c comments about the need for this information.
@@ -194,8 +232,12 @@ typedef struct {
194
232
  typedef struct {
195
233
  int comps_in_scan; /* number of components encoded in this scan */
196
234
  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
197
- int Ss, Se; /* progressive JPEG spectral selection parms */
198
- int Ah, Al; /* progressive JPEG successive approx. parms */
235
+ int Ss, Se; /* progressive JPEG spectral selection parms
236
+ (Ss is the predictor selection value in
237
+ lossless mode) */
238
+ int Ah, Al; /* progressive JPEG successive approx. parms
239
+ (Al is the point transform value in lossless
240
+ mode) */
199
241
  } jpeg_scan_info;
200
242
 
201
243
  /* The decompressor can save APPn and COM markers in a list of these: */
@@ -213,8 +255,8 @@ struct jpeg_marker_struct {
213
255
 
214
256
  /* Known color spaces. */
215
257
 
216
- #define JCS_EXTENSIONS 1
217
- #define JCS_ALPHA_EXTENSIONS 1
258
+ #define JCS_EXTENSIONS 1
259
+ #define JCS_ALPHA_EXTENSIONS 1
218
260
 
219
261
  typedef enum {
220
262
  JCS_UNKNOWN, /* error/unspecified */
@@ -317,11 +359,11 @@ enum {
317
359
  /* Common fields between JPEG compression and decompression master structs. */
318
360
 
319
361
  #define jpeg_common_fields \
320
- struct jpeg_error_mgr *err; /* Error handler module */\
321
- struct jpeg_memory_mgr *mem; /* Memory manager module */\
322
- struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */\
323
- void *client_data; /* Available for use by application */\
324
- boolean is_decompressor; /* So common code can tell which is which */\
362
+ struct jpeg_error_mgr *err; /* Error handler module */ \
363
+ struct jpeg_memory_mgr *mem; /* Memory manager module */ \
364
+ struct jpeg_progress_mgr *progress; /* Progress monitor, or NULL if none */ \
365
+ void *client_data; /* Available for use by application */ \
366
+ boolean is_decompressor; /* So common code can tell which is which */ \
325
367
  int global_state /* For checking call sequence validity */
326
368
 
327
369
  /* Routines that are to be used by both halves of the library are declared
@@ -468,11 +510,13 @@ struct jpeg_compress_struct {
468
510
  int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
469
511
  #endif
470
512
 
471
- JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
472
- /* The coefficient controller receives data in units of MCU rows as defined
473
- * for fully interleaved scans (whether the JPEG file is interleaved or not).
474
- * There are v_samp_factor * DCTSIZE sample rows of each component in an
475
- * "iMCU" (interleaved MCU) row.
513
+ JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coefficient or
514
+ difference controller */
515
+ /* The coefficient or difference controller receives data in units of MCU
516
+ * rows as defined for fully interleaved scans (whether the JPEG file is
517
+ * interleaved or not). In lossy mode, there are v_samp_factor * DCTSIZE
518
+ * sample rows of each component in an "iMCU" (interleaved MCU) row. In
519
+ * lossless mode, total_iMCU_rows is always equal to the image height.
476
520
  */
477
521
 
478
522
  /*
@@ -486,12 +530,13 @@ struct jpeg_compress_struct {
486
530
  JDIMENSION MCUs_per_row; /* # of MCUs across the image */
487
531
  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
488
532
 
489
- int blocks_in_MCU; /* # of DCT blocks per MCU */
533
+ int blocks_in_MCU; /* # of data units per MCU */
490
534
  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
491
535
  /* MCU_membership[i] is index in cur_comp_info of component owning */
492
- /* i'th block in an MCU */
536
+ /* i'th data unit in an MCU */
493
537
 
494
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
538
+ int Ss, Se, Ah, Al; /* progressive/lossless JPEG parameters for
539
+ scan */
495
540
 
496
541
  #if JPEG_LIB_VERSION >= 80
497
542
  int block_size; /* the basic DCT block size: 1..16 */
@@ -588,7 +633,11 @@ struct jpeg_decompress_struct {
588
633
  * The map has out_color_components rows and actual_number_of_colors columns.
589
634
  */
590
635
  int actual_number_of_colors; /* number of entries in use */
591
- JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
636
+ JSAMPARRAY colormap; /* The color map as a 2-D pixel array
637
+ If data_precision is 12, then this is
638
+ actually a J12SAMPARRAY, so callers must
639
+ type-cast it in order to read/write 12-bit
640
+ samples from/to the array. */
592
641
 
593
642
  /* State variables: these variables indicate the progress of decompression.
594
643
  * The application may examine these but must not modify them.
@@ -698,15 +747,21 @@ struct jpeg_decompress_struct {
698
747
  #endif
699
748
 
700
749
  JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
701
- /* The coefficient controller's input and output progress is measured in
702
- * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
703
- * in fully interleaved JPEG scans, but are used whether the scan is
704
- * interleaved or not. We define an iMCU row as v_samp_factor DCT block
705
- * rows of each component. Therefore, the IDCT output contains
750
+ /* The coefficient or difference controller's input and output progress is
751
+ * measured in units of "iMCU" (interleaved MCU) rows. These are the same as
752
+ * MCU rows in fully interleaved JPEG scans, but are used whether the scan is
753
+ * interleaved or not. In lossy mode, we define an iMCU row as v_samp_factor
754
+ * DCT block rows of each component. Therefore, the IDCT output contains
706
755
  * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row.
756
+ * In lossless mode, total_iMCU_rows is always equal to the image height.
707
757
  */
708
758
 
709
- JSAMPLE *sample_range_limit; /* table for fast range-limiting */
759
+ JSAMPLE *sample_range_limit; /* table for fast range-limiting
760
+ If data_precision is 12 or 16, then this is
761
+ actually a J12SAMPLE pointer or a J16SAMPLE
762
+ pointer, so callers must type-cast it in
763
+ order to read 12-bit or 16-bit samples from
764
+ the array. */
710
765
 
711
766
  /*
712
767
  * These fields are valid during any one scan.
@@ -720,12 +775,13 @@ struct jpeg_decompress_struct {
720
775
  JDIMENSION MCUs_per_row; /* # of MCUs across the image */
721
776
  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
722
777
 
723
- int blocks_in_MCU; /* # of DCT blocks per MCU */
778
+ int blocks_in_MCU; /* # of data units per MCU */
724
779
  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
725
780
  /* MCU_membership[i] is index in cur_comp_info of component owning */
726
- /* i'th block in an MCU */
781
+ /* i'th data unit in an MCU */
727
782
 
728
- int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
783
+ int Ss, Se, Ah, Al; /* progressive/lossless JPEG parameters for
784
+ scan */
729
785
 
730
786
  #if JPEG_LIB_VERSION >= 80
731
787
  /* These fields are derived from Se of first SOS marker.
@@ -873,9 +929,9 @@ struct jpeg_source_mgr {
873
929
  * successful.
874
930
  */
875
931
 
876
- #define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
877
- #define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
878
- #define JPOOL_NUMPOOLS 2
932
+ #define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
933
+ #define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
934
+ #define JPOOL_NUMPOOLS 2
879
935
 
880
936
  typedef struct jvirt_sarray_control *jvirt_sarray_ptr;
881
937
  typedef struct jvirt_barray_control *jvirt_barray_ptr;
@@ -886,6 +942,11 @@ struct jpeg_memory_mgr {
886
942
  void *(*alloc_small) (j_common_ptr cinfo, int pool_id, size_t sizeofobject);
887
943
  void *(*alloc_large) (j_common_ptr cinfo, int pool_id,
888
944
  size_t sizeofobject);
945
+ /* If cinfo->data_precision is 12 or 16, then this method and the
946
+ * access_virt_sarray method actually return a J12SAMPARRAY or a
947
+ * J16SAMPARRAY, so callers must type-cast the return value in order to
948
+ * read/write 12-bit or 16-bit samples from/to the array.
949
+ */
889
950
  JSAMPARRAY (*alloc_sarray) (j_common_ptr cinfo, int pool_id,
890
951
  JDIMENSION samplesperrow, JDIMENSION numrows);
891
952
  JBLOCKARRAY (*alloc_barray) (j_common_ptr cinfo, int pool_id,
@@ -939,7 +1000,7 @@ typedef boolean (*jpeg_marker_parser_method) (j_decompress_ptr cinfo);
939
1000
 
940
1001
 
941
1002
  /* Default error-management setup */
942
- EXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr *err);
1003
+ EXTERN(struct jpeg_error_mgr *) jpeg_std_error(struct jpeg_error_mgr *err);
943
1004
 
944
1005
  /* Initialization of JPEG compression objects.
945
1006
  * jpeg_create_compress() and jpeg_create_decompress() are the exported
@@ -949,83 +1010,93 @@ EXTERN(struct jpeg_error_mgr *) jpeg_std_error (struct jpeg_error_mgr *err);
949
1010
  * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
950
1011
  */
951
1012
  #define jpeg_create_compress(cinfo) \
952
- jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
953
- (size_t) sizeof(struct jpeg_compress_struct))
1013
+ jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
1014
+ (size_t)sizeof(struct jpeg_compress_struct))
954
1015
  #define jpeg_create_decompress(cinfo) \
955
- jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
956
- (size_t) sizeof(struct jpeg_decompress_struct))
957
- EXTERN(void) jpeg_CreateCompress (j_compress_ptr cinfo, int version,
958
- size_t structsize);
959
- EXTERN(void) jpeg_CreateDecompress (j_decompress_ptr cinfo, int version,
960
- size_t structsize);
1016
+ jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
1017
+ (size_t)sizeof(struct jpeg_decompress_struct))
1018
+ EXTERN(void) jpeg_CreateCompress(j_compress_ptr cinfo, int version,
1019
+ size_t structsize);
1020
+ EXTERN(void) jpeg_CreateDecompress(j_decompress_ptr cinfo, int version,
1021
+ size_t structsize);
961
1022
  /* Destruction of JPEG compression objects */
962
- EXTERN(void) jpeg_destroy_compress (j_compress_ptr cinfo);
963
- EXTERN(void) jpeg_destroy_decompress (j_decompress_ptr cinfo);
1023
+ EXTERN(void) jpeg_destroy_compress(j_compress_ptr cinfo);
1024
+ EXTERN(void) jpeg_destroy_decompress(j_decompress_ptr cinfo);
964
1025
 
965
1026
  /* Standard data source and destination managers: stdio streams. */
966
1027
  /* Caller is responsible for opening the file before and closing after. */
967
- EXTERN(void) jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile);
968
- EXTERN(void) jpeg_stdio_src (j_decompress_ptr cinfo, FILE *infile);
1028
+ EXTERN(void) jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile);
1029
+ EXTERN(void) jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile);
969
1030
 
970
- #if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
971
1031
  /* Data source and destination managers: memory buffers. */
972
- EXTERN(void) jpeg_mem_dest (j_compress_ptr cinfo, unsigned char **outbuffer,
973
- unsigned long *outsize);
974
- EXTERN(void) jpeg_mem_src (j_decompress_ptr cinfo,
1032
+ EXTERN(void) jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
1033
+ unsigned long *outsize);
1034
+ EXTERN(void) jpeg_mem_src(j_decompress_ptr cinfo,
975
1035
  const unsigned char *inbuffer, unsigned long insize);
976
- #endif
977
1036
 
978
1037
  /* Default parameter setup for compression */
979
- EXTERN(void) jpeg_set_defaults (j_compress_ptr cinfo);
1038
+ EXTERN(void) jpeg_set_defaults(j_compress_ptr cinfo);
980
1039
  /* Compression parameter setup aids */
981
- EXTERN(void) jpeg_set_colorspace (j_compress_ptr cinfo,
982
- J_COLOR_SPACE colorspace);
983
- EXTERN(void) jpeg_default_colorspace (j_compress_ptr cinfo);
984
- EXTERN(void) jpeg_set_quality (j_compress_ptr cinfo, int quality,
985
- boolean force_baseline);
986
- EXTERN(void) jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
987
- boolean force_baseline);
1040
+ EXTERN(void) jpeg_set_colorspace(j_compress_ptr cinfo,
1041
+ J_COLOR_SPACE colorspace);
1042
+ EXTERN(void) jpeg_default_colorspace(j_compress_ptr cinfo);
1043
+ EXTERN(void) jpeg_set_quality(j_compress_ptr cinfo, int quality,
1044
+ boolean force_baseline);
1045
+ EXTERN(void) jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor,
1046
+ boolean force_baseline);
988
1047
  #if JPEG_LIB_VERSION >= 70
989
- EXTERN(void) jpeg_default_qtables (j_compress_ptr cinfo,
990
- boolean force_baseline);
1048
+ EXTERN(void) jpeg_default_qtables(j_compress_ptr cinfo,
1049
+ boolean force_baseline);
991
1050
  #endif
992
- EXTERN(void) jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
993
- const unsigned int *basic_table,
994
- int scale_factor, boolean force_baseline);
995
- EXTERN(int) jpeg_quality_scaling (int quality);
1051
+ EXTERN(void) jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl,
1052
+ const unsigned int *basic_table,
1053
+ int scale_factor, boolean force_baseline);
1054
+ EXTERN(int) jpeg_quality_scaling(int quality);
996
1055
  EXTERN(float) jpeg_float_quality_scaling (float quality);
997
- EXTERN(void) jpeg_simple_progression (j_compress_ptr cinfo);
998
- EXTERN(void) jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress);
999
- EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table (j_common_ptr cinfo);
1000
- EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table (j_common_ptr cinfo);
1056
+ EXTERN(void) jpeg_enable_lossless(j_compress_ptr cinfo,
1057
+ int predictor_selection_value,
1058
+ int point_transform);
1059
+ EXTERN(void) jpeg_simple_progression(j_compress_ptr cinfo);
1060
+ EXTERN(void) jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress);
1061
+ EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table(j_common_ptr cinfo);
1062
+ EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table(j_common_ptr cinfo);
1001
1063
 
1002
1064
  /* Main entry points for compression */
1003
- EXTERN(void) jpeg_start_compress (j_compress_ptr cinfo,
1004
- boolean write_all_tables);
1005
- EXTERN(JDIMENSION) jpeg_write_scanlines (j_compress_ptr cinfo,
1006
- JSAMPARRAY scanlines,
1007
- JDIMENSION num_lines);
1008
- EXTERN(void) jpeg_finish_compress (j_compress_ptr cinfo);
1065
+ EXTERN(void) jpeg_start_compress(j_compress_ptr cinfo,
1066
+ boolean write_all_tables);
1067
+ EXTERN(JDIMENSION) jpeg_write_scanlines(j_compress_ptr cinfo,
1068
+ JSAMPARRAY scanlines,
1069
+ JDIMENSION num_lines);
1070
+ EXTERN(JDIMENSION) jpeg12_write_scanlines(j_compress_ptr cinfo,
1071
+ J12SAMPARRAY scanlines,
1072
+ JDIMENSION num_lines);
1073
+ EXTERN(JDIMENSION) jpeg16_write_scanlines(j_compress_ptr cinfo,
1074
+ J16SAMPARRAY scanlines,
1075
+ JDIMENSION num_lines);
1076
+ EXTERN(void) jpeg_finish_compress(j_compress_ptr cinfo);
1009
1077
 
1010
1078
  #if JPEG_LIB_VERSION >= 70
1011
1079
  /* Precalculate JPEG dimensions for current compression parameters. */
1012
- EXTERN(void) jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo);
1080
+ EXTERN(void) jpeg_calc_jpeg_dimensions(j_compress_ptr cinfo);
1013
1081
  #endif
1014
1082
 
1015
1083
  /* Replaces jpeg_write_scanlines when writing raw downsampled data. */
1016
- EXTERN(JDIMENSION) jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
1017
- JDIMENSION num_lines);
1084
+ EXTERN(JDIMENSION) jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data,
1085
+ JDIMENSION num_lines);
1086
+ EXTERN(JDIMENSION) jpeg12_write_raw_data(j_compress_ptr cinfo,
1087
+ J12SAMPIMAGE data,
1088
+ JDIMENSION num_lines);
1018
1089
 
1019
1090
  /* Write a special marker. See libjpeg.txt concerning safe usage. */
1020
- EXTERN(void) jpeg_write_marker (j_compress_ptr cinfo, int marker,
1021
- const JOCTET *dataptr, unsigned int datalen);
1091
+ EXTERN(void) jpeg_write_marker(j_compress_ptr cinfo, int marker,
1092
+ const JOCTET *dataptr, unsigned int datalen);
1022
1093
  /* Same, but piecemeal. */
1023
- EXTERN(void) jpeg_write_m_header (j_compress_ptr cinfo, int marker,
1024
- unsigned int datalen);
1025
- EXTERN(void) jpeg_write_m_byte (j_compress_ptr cinfo, int val);
1094
+ EXTERN(void) jpeg_write_m_header(j_compress_ptr cinfo, int marker,
1095
+ unsigned int datalen);
1096
+ EXTERN(void) jpeg_write_m_byte(j_compress_ptr cinfo, int val);
1026
1097
 
1027
1098
  /* Alternate compression function: just write an abbreviated table file */
1028
- EXTERN(void) jpeg_write_tables (j_compress_ptr cinfo);
1099
+ EXTERN(void) jpeg_write_tables(j_compress_ptr cinfo);
1029
1100
 
1030
1101
  /* Write ICC profile. See libjpeg.txt for usage information. */
1031
1102
  EXTERN(void) jpeg_write_icc_profile(j_compress_ptr cinfo,
@@ -1034,11 +1105,11 @@ EXTERN(void) jpeg_write_icc_profile(j_compress_ptr cinfo,
1034
1105
 
1035
1106
 
1036
1107
  /* Decompression startup: read start of JPEG datastream to see what's there */
1037
- EXTERN(int) jpeg_read_header (j_decompress_ptr cinfo, boolean require_image);
1108
+ EXTERN(int) jpeg_read_header(j_decompress_ptr cinfo, boolean require_image);
1038
1109
  /* Return value is one of: */
1039
- #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
1040
- #define JPEG_HEADER_OK 1 /* Found valid image datastream */
1041
- #define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
1110
+ #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
1111
+ #define JPEG_HEADER_OK 1 /* Found valid image datastream */
1112
+ #define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
1042
1113
  /* If you pass require_image = TRUE (normal case), you need not check for
1043
1114
  * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
1044
1115
  * JPEG_SUSPENDED is only possible if you use a data source module that can
@@ -1046,27 +1117,40 @@ EXTERN(int) jpeg_read_header (j_decompress_ptr cinfo, boolean require_image);
1046
1117
  */
1047
1118
 
1048
1119
  /* Main entry points for decompression */
1049
- EXTERN(boolean) jpeg_start_decompress (j_decompress_ptr cinfo);
1050
- EXTERN(JDIMENSION) jpeg_read_scanlines (j_decompress_ptr cinfo,
1051
- JSAMPARRAY scanlines,
1052
- JDIMENSION max_lines);
1053
- EXTERN(JDIMENSION) jpeg_skip_scanlines (j_decompress_ptr cinfo,
1054
- JDIMENSION num_lines);
1055
- EXTERN(void) jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
1056
- JDIMENSION *width);
1057
- EXTERN(boolean) jpeg_finish_decompress (j_decompress_ptr cinfo);
1120
+ EXTERN(boolean) jpeg_start_decompress(j_decompress_ptr cinfo);
1121
+ EXTERN(JDIMENSION) jpeg_read_scanlines(j_decompress_ptr cinfo,
1122
+ JSAMPARRAY scanlines,
1123
+ JDIMENSION max_lines);
1124
+ EXTERN(JDIMENSION) jpeg12_read_scanlines(j_decompress_ptr cinfo,
1125
+ J12SAMPARRAY scanlines,
1126
+ JDIMENSION max_lines);
1127
+ EXTERN(JDIMENSION) jpeg16_read_scanlines(j_decompress_ptr cinfo,
1128
+ J16SAMPARRAY scanlines,
1129
+ JDIMENSION max_lines);
1130
+ EXTERN(JDIMENSION) jpeg_skip_scanlines(j_decompress_ptr cinfo,
1131
+ JDIMENSION num_lines);
1132
+ EXTERN(JDIMENSION) jpeg12_skip_scanlines(j_decompress_ptr cinfo,
1133
+ JDIMENSION num_lines);
1134
+ EXTERN(void) jpeg_crop_scanline(j_decompress_ptr cinfo, JDIMENSION *xoffset,
1135
+ JDIMENSION *width);
1136
+ EXTERN(void) jpeg12_crop_scanline(j_decompress_ptr cinfo, JDIMENSION *xoffset,
1137
+ JDIMENSION *width);
1138
+ EXTERN(boolean) jpeg_finish_decompress(j_decompress_ptr cinfo);
1058
1139
 
1059
1140
  /* Replaces jpeg_read_scanlines when reading raw downsampled data. */
1060
- EXTERN(JDIMENSION) jpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,
1061
- JDIMENSION max_lines);
1141
+ EXTERN(JDIMENSION) jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data,
1142
+ JDIMENSION max_lines);
1143
+ EXTERN(JDIMENSION) jpeg12_read_raw_data(j_decompress_ptr cinfo,
1144
+ J12SAMPIMAGE data,
1145
+ JDIMENSION max_lines);
1062
1146
 
1063
1147
  /* Additional entry points for buffered-image mode. */
1064
1148
  EXTERN(boolean) jpeg_has_multiple_scans (const j_decompress_ptr cinfo);
1065
- EXTERN(boolean) jpeg_start_output (j_decompress_ptr cinfo, int scan_number);
1066
- EXTERN(boolean) jpeg_finish_output (j_decompress_ptr cinfo);
1149
+ EXTERN(boolean) jpeg_start_output(j_decompress_ptr cinfo, int scan_number);
1150
+ EXTERN(boolean) jpeg_finish_output(j_decompress_ptr cinfo);
1067
1151
  EXTERN(boolean) jpeg_input_complete (const j_decompress_ptr cinfo);
1068
- EXTERN(void) jpeg_new_colormap (j_decompress_ptr cinfo);
1069
- EXTERN(int) jpeg_consume_input (j_decompress_ptr cinfo);
1152
+ EXTERN(void) jpeg_new_colormap(j_decompress_ptr cinfo);
1153
+ EXTERN(int) jpeg_consume_input(j_decompress_ptr cinfo);
1070
1154
  /* Return value is one of: */
1071
1155
  /* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
1072
1156
  #define JPEG_REACHED_SOS 1 /* Reached start of new scan */
@@ -1076,25 +1160,25 @@ EXTERN(int) jpeg_consume_input (j_decompress_ptr cinfo);
1076
1160
 
1077
1161
  /* Precalculate output dimensions for current decompression parameters. */
1078
1162
  #if JPEG_LIB_VERSION >= 80
1079
- EXTERN(void) jpeg_core_output_dimensions (j_decompress_ptr cinfo);
1163
+ EXTERN(void) jpeg_core_output_dimensions(j_decompress_ptr cinfo);
1080
1164
  #endif
1081
- EXTERN(void) jpeg_calc_output_dimensions (j_decompress_ptr cinfo);
1165
+ EXTERN(void) jpeg_calc_output_dimensions(j_decompress_ptr cinfo);
1082
1166
 
1083
1167
  /* Control saving of COM and APPn markers into marker_list. */
1084
- EXTERN(void) jpeg_save_markers (j_decompress_ptr cinfo, int marker_code,
1085
- unsigned int length_limit);
1168
+ EXTERN(void) jpeg_save_markers(j_decompress_ptr cinfo, int marker_code,
1169
+ unsigned int length_limit);
1086
1170
 
1087
1171
  /* Install a special processing method for COM or APPn markers. */
1088
- EXTERN(void) jpeg_set_marker_processor (j_decompress_ptr cinfo,
1089
- int marker_code,
1090
- jpeg_marker_parser_method routine);
1172
+ EXTERN(void) jpeg_set_marker_processor(j_decompress_ptr cinfo,
1173
+ int marker_code,
1174
+ jpeg_marker_parser_method routine);
1091
1175
 
1092
1176
  /* Read or write raw DCT coefficients --- useful for lossless transcoding. */
1093
- EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients (j_decompress_ptr cinfo);
1094
- EXTERN(void) jpeg_write_coefficients (j_compress_ptr cinfo,
1095
- jvirt_barray_ptr *coef_arrays);
1177
+ EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients(j_decompress_ptr cinfo);
1178
+ EXTERN(void) jpeg_write_coefficients(j_compress_ptr cinfo,
1179
+ jvirt_barray_ptr *coef_arrays);
1096
1180
  EXTERN(void) jpeg_copy_critical_parameters (const j_decompress_ptr srcinfo,
1097
- j_compress_ptr dstinfo);
1181
+ j_compress_ptr dstinfo);
1098
1182
 
1099
1183
  /* If you choose to abort compression or decompression before completing
1100
1184
  * jpeg_finish_(de)compress, then you need to clean up to release memory,
@@ -1102,17 +1186,17 @@ EXTERN(void) jpeg_copy_critical_parameters (const j_decompress_ptr srcinfo,
1102
1186
  * if you're done with the JPEG object, but if you want to clean it up and
1103
1187
  * reuse it, call this:
1104
1188
  */
1105
- EXTERN(void) jpeg_abort_compress (j_compress_ptr cinfo);
1106
- EXTERN(void) jpeg_abort_decompress (j_decompress_ptr cinfo);
1189
+ EXTERN(void) jpeg_abort_compress(j_compress_ptr cinfo);
1190
+ EXTERN(void) jpeg_abort_decompress(j_decompress_ptr cinfo);
1107
1191
 
1108
1192
  /* Generic versions of jpeg_abort and jpeg_destroy that work on either
1109
1193
  * flavor of JPEG object. These may be more convenient in some places.
1110
1194
  */
1111
- EXTERN(void) jpeg_abort (j_common_ptr cinfo);
1112
- EXTERN(void) jpeg_destroy (j_common_ptr cinfo);
1195
+ EXTERN(void) jpeg_abort(j_common_ptr cinfo);
1196
+ EXTERN(void) jpeg_destroy(j_common_ptr cinfo);
1113
1197
 
1114
1198
  /* Default restart-marker-resync procedure for use by data source modules */
1115
- EXTERN(boolean) jpeg_resync_to_restart (j_decompress_ptr cinfo, int desired);
1199
+ EXTERN(boolean) jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired);
1116
1200
 
1117
1201
  /* Accessor functions for extension parameters */
1118
1202
  #define JPEG_C_PARAM_SUPPORTED 1
@@ -7,7 +7,7 @@
7
7
 
8
8
  #define LIBRSVG_MAJOR_VERSION (2)
9
9
  #define LIBRSVG_MINOR_VERSION (61)
10
- #define LIBRSVG_MICRO_VERSION (1)
11
- #define LIBRSVG_VERSION "2.61.1"
10
+ #define LIBRSVG_MICRO_VERSION (2)
11
+ #define LIBRSVG_VERSION "2.61.2"
12
12
 
13
13
  #endif