@revizly/sharp-libvips-dev 1.0.56 → 1.0.57

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.
@@ -286,6 +286,12 @@ public:
286
286
  VOption *
287
287
  set(const char *name, const char *value);
288
288
 
289
+ /**
290
+ * Set an input pointer option.
291
+ */
292
+ VOption *
293
+ set(const char *name, void *value);
294
+
289
295
  /**
290
296
  * Set a libvips object as an option. These can be images, sources,
291
297
  * targets, etc.
@@ -529,6 +535,16 @@ public:
529
535
  return vips_image_get_yoffset(get_image());
530
536
  }
531
537
 
538
+ /**
539
+ * Return the orientation of the image, or 1 (no rotate, no flip) if
540
+ * not present or crazy.
541
+ */
542
+ int
543
+ orientation() const
544
+ {
545
+ return vips_image_get_orientation(get_image());
546
+ }
547
+
532
548
  /**
533
549
  * TRUE if the image has an alpha channel.
534
550
  */
@@ -2102,6 +2118,13 @@ public:
2102
2118
  // this file is generated automatically, do not edit!
2103
2119
  // clang-format off
2104
2120
 
2121
+ /**
2122
+ * Transform cicp to scrgb.
2123
+ * @param options Set of options.
2124
+ * @return Output image.
2125
+ */
2126
+ VImage CICP2scRGB(VOption *options = nullptr) const;
2127
+
2105
2128
  /**
2106
2129
  * Transform lch to cmc.
2107
2130
  * @param options Set of options.
@@ -2825,7 +2848,8 @@ public:
2825
2848
  * Load raw camera files.
2826
2849
  *
2827
2850
  * **Optional parameters**
2828
- * - **bitdepth** -- Number of bits per pixel, int.
2851
+ * - **bitdepth** -- Number of bits to decode to, int.
2852
+ * - **half_size** -- Decode image at half size, bool.
2829
2853
  * - **memory** -- Force open via memory, bool.
2830
2854
  * - **access** -- Required access pattern for this file, VipsAccess.
2831
2855
  * - **fail_on** -- Error level to fail on, VipsFailOn.
@@ -2841,7 +2865,8 @@ public:
2841
2865
  * Load raw camera files.
2842
2866
  *
2843
2867
  * **Optional parameters**
2844
- * - **bitdepth** -- Number of bits per pixel, int.
2868
+ * - **bitdepth** -- Number of bits to decode to, int.
2869
+ * - **half_size** -- Decode image at half size, bool.
2845
2870
  * - **memory** -- Force open via memory, bool.
2846
2871
  * - **access** -- Required access pattern for this file, VipsAccess.
2847
2872
  * - **fail_on** -- Error level to fail on, VipsFailOn.
@@ -2857,7 +2882,8 @@ public:
2857
2882
  * Load raw camera files.
2858
2883
  *
2859
2884
  * **Optional parameters**
2860
- * - **bitdepth** -- Number of bits per pixel, int.
2885
+ * - **bitdepth** -- Number of bits to decode to, int.
2886
+ * - **half_size** -- Decode image at half size, bool.
2861
2887
  * - **memory** -- Force open via memory, bool.
2862
2888
  * - **access** -- Required access pattern for this file, VipsAccess.
2863
2889
  * - **fail_on** -- Error level to fail on, VipsFailOn.
@@ -2926,6 +2952,11 @@ public:
2926
2952
 
2927
2953
  /**
2928
2954
  * Draw a line on an image.
2955
+ *
2956
+ * **Optional parameters**
2957
+ * - **draw_point** -- Custom point draw function, void *.
2958
+ * - **client** -- Client data for the point draw function, void *.
2959
+ *
2929
2960
  * @param ink Color for pixels.
2930
2961
  * @param x1 Start of draw_line.
2931
2962
  * @param y1 Start of draw_line.
@@ -4164,6 +4195,8 @@ public:
4164
4195
  * - **lossless** -- Enable lossless compression, bool.
4165
4196
  * - **Q** -- Quality factor, int.
4166
4197
  * - **bitdepth** -- Bit depth, int.
4198
+ * - **interlace** -- Enable progressive (interlaced) encoding, bool.
4199
+ * - **progressive** -- Enable progressive encoding, bool.
4167
4200
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
4168
4201
  * - **background** -- Background value, std::vector<double>.
4169
4202
  * - **page_height** -- Set page height for multipage save, int.
@@ -4184,6 +4217,8 @@ public:
4184
4217
  * - **lossless** -- Enable lossless compression, bool.
4185
4218
  * - **Q** -- Quality factor, int.
4186
4219
  * - **bitdepth** -- Bit depth, int.
4220
+ * - **interlace** -- Enable progressive (interlaced) encoding, bool.
4221
+ * - **progressive** -- Enable progressive encoding, bool.
4187
4222
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
4188
4223
  * - **background** -- Background value, std::vector<double>.
4189
4224
  * - **page_height** -- Set page height for multipage save, int.
@@ -4204,6 +4239,8 @@ public:
4204
4239
  * - **lossless** -- Enable lossless compression, bool.
4205
4240
  * - **Q** -- Quality factor, int.
4206
4241
  * - **bitdepth** -- Bit depth, int.
4242
+ * - **interlace** -- Enable progressive (interlaced) encoding, bool.
4243
+ * - **progressive** -- Enable progressive encoding, bool.
4207
4244
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
4208
4245
  * - **background** -- Background value, std::vector<double>.
4209
4246
  * - **page_height** -- Set page height for multipage save, int.
@@ -5027,6 +5064,18 @@ public:
5027
5064
  */
5028
5065
  int percent(double percent, VOption *options = nullptr) const;
5029
5066
 
5067
+ /**
5068
+ * Find threshold for percent of pixels by bt.709 luminance.
5069
+ *
5070
+ * **Optional parameters**
5071
+ * - **max** -- Histogram upper bound in input unit; values above clamp to the top bin, double.
5072
+ *
5073
+ * @param percent Percentile (0-100) of luminance to return.
5074
+ * @param options Set of options.
5075
+ * @return Luminance value at the requested percentile in input unit.
5076
+ */
5077
+ double percent_lum(double percent, VOption *options = nullptr) const;
5078
+
5030
5079
  /**
5031
5080
  * Make a perlin noise image.
5032
5081
  *
@@ -5054,6 +5103,8 @@ public:
5054
5103
  * Load png from file.
5055
5104
  *
5056
5105
  * **Optional parameters**
5106
+ * - **page** -- First page to load, int.
5107
+ * - **n** -- Number of pages to load, -1 for all, int.
5057
5108
  * - **unlimited** -- Remove all denial of service limits, bool.
5058
5109
  * - **memory** -- Force open via memory, bool.
5059
5110
  * - **access** -- Required access pattern for this file, VipsAccess.
@@ -5070,6 +5121,8 @@ public:
5070
5121
  * Load png from buffer.
5071
5122
  *
5072
5123
  * **Optional parameters**
5124
+ * - **page** -- First page to load, int.
5125
+ * - **n** -- Number of pages to load, -1 for all, int.
5073
5126
  * - **unlimited** -- Remove all denial of service limits, bool.
5074
5127
  * - **memory** -- Force open via memory, bool.
5075
5128
  * - **access** -- Required access pattern for this file, VipsAccess.
@@ -5086,6 +5139,8 @@ public:
5086
5139
  * Load png from source.
5087
5140
  *
5088
5141
  * **Optional parameters**
5142
+ * - **page** -- First page to load, int.
5143
+ * - **n** -- Number of pages to load, -1 for all, int.
5089
5144
  * - **unlimited** -- Remove all denial of service limits, bool.
5090
5145
  * - **memory** -- Force open via memory, bool.
5091
5146
  * - **access** -- Required access pattern for this file, VipsAccess.
@@ -5246,6 +5301,7 @@ public:
5246
5301
  *
5247
5302
  * **Optional parameters**
5248
5303
  * - **max_alpha** -- Maximum value of alpha channel, double.
5304
+ * - **uchar** -- Output should be uchar, bool.
5249
5305
  *
5250
5306
  * @param options Set of options.
5251
5307
  * @return Output image.
@@ -5277,12 +5333,102 @@ public:
5277
5333
 
5278
5334
  /**
5279
5335
  * Find image projections.
5336
+ *
5337
+ * **Optional parameters**
5338
+ * - **combine** -- Combine values with this, VipsCombine.
5339
+ *
5280
5340
  * @param rows Sums of rows.
5281
5341
  * @param options Set of options.
5282
5342
  * @return Sums of columns.
5283
5343
  */
5284
5344
  VImage project(VImage *rows, VOption *options = nullptr) const;
5285
5345
 
5346
+ /**
5347
+ * Load qoi from file.
5348
+ *
5349
+ * **Optional parameters**
5350
+ * - **memory** -- Force open via memory, bool.
5351
+ * - **access** -- Required access pattern for this file, VipsAccess.
5352
+ * - **fail_on** -- Error level to fail on, VipsFailOn.
5353
+ * - **revalidate** -- Don't use a cached result for this operation, bool.
5354
+ *
5355
+ * @param filename Filename to load from.
5356
+ * @param options Set of options.
5357
+ * @return Output image.
5358
+ */
5359
+ static VImage qoiload(const char *filename, VOption *options = nullptr);
5360
+
5361
+ /**
5362
+ * Load qoi from buffer.
5363
+ *
5364
+ * **Optional parameters**
5365
+ * - **memory** -- Force open via memory, bool.
5366
+ * - **access** -- Required access pattern for this file, VipsAccess.
5367
+ * - **fail_on** -- Error level to fail on, VipsFailOn.
5368
+ * - **revalidate** -- Don't use a cached result for this operation, bool.
5369
+ *
5370
+ * @param buffer Buffer to load from.
5371
+ * @param options Set of options.
5372
+ * @return Output image.
5373
+ */
5374
+ static VImage qoiload_buffer(VipsBlob *buffer, VOption *options = nullptr);
5375
+
5376
+ /**
5377
+ * Load qoi from source.
5378
+ *
5379
+ * **Optional parameters**
5380
+ * - **memory** -- Force open via memory, bool.
5381
+ * - **access** -- Required access pattern for this file, VipsAccess.
5382
+ * - **fail_on** -- Error level to fail on, VipsFailOn.
5383
+ *
5384
+ * @param source Source to load from.
5385
+ * @param options Set of options.
5386
+ * @return Output image.
5387
+ */
5388
+ static VImage qoiload_source(VSource source, VOption *options = nullptr);
5389
+
5390
+ /**
5391
+ * Save image to file as qoi.
5392
+ *
5393
+ * **Optional parameters**
5394
+ * - **keep** -- Which metadata to retain, VipsForeignKeep.
5395
+ * - **background** -- Background value, std::vector<double>.
5396
+ * - **page_height** -- Set page height for multipage save, int.
5397
+ * - **profile** -- Filename of ICC profile to embed, const char *.
5398
+ *
5399
+ * @param filename Filename to save to.
5400
+ * @param options Set of options.
5401
+ */
5402
+ void qoisave(const char *filename, VOption *options = nullptr) const;
5403
+
5404
+ /**
5405
+ * Save image to buffer as qoi.
5406
+ *
5407
+ * **Optional parameters**
5408
+ * - **keep** -- Which metadata to retain, VipsForeignKeep.
5409
+ * - **background** -- Background value, std::vector<double>.
5410
+ * - **page_height** -- Set page height for multipage save, int.
5411
+ * - **profile** -- Filename of ICC profile to embed, const char *.
5412
+ *
5413
+ * @param options Set of options.
5414
+ * @return Buffer to save to.
5415
+ */
5416
+ VipsBlob *qoisave_buffer(VOption *options = nullptr) const;
5417
+
5418
+ /**
5419
+ * Save image to target as qoi.
5420
+ *
5421
+ * **Optional parameters**
5422
+ * - **keep** -- Which metadata to retain, VipsForeignKeep.
5423
+ * - **background** -- Background value, std::vector<double>.
5424
+ * - **page_height** -- Set page height for multipage save, int.
5425
+ * - **profile** -- Filename of ICC profile to embed, const char *.
5426
+ *
5427
+ * @param target Target to save to.
5428
+ * @param options Set of options.
5429
+ */
5430
+ void qoisave_target(VTarget target, VOption *options = nullptr) const;
5431
+
5286
5432
  /**
5287
5433
  * Resample an image with a quadratic transform.
5288
5434
  *
@@ -5644,6 +5790,20 @@ public:
5644
5790
  */
5645
5791
  VImage scRGB2BW(VOption *options = nullptr) const;
5646
5792
 
5793
+ /**
5794
+ * Transform scrgb to cicp.
5795
+ *
5796
+ * **Optional parameters**
5797
+ * - **colour_primaries** -- CICP colour primaries (H.273 Table 2), VipsCICPColourPrimaries.
5798
+ * - **transfer_characteristics** -- CICP transfer characteristics (H.273 Table 3), VipsCICPTransferCharacteristics.
5799
+ * - **matrix_coefficients** -- CICP matrix coefficients (H.273 Table 4), VipsCICPMatrixCoefficients.
5800
+ * - **depth** -- Output device space depth in bits, int.
5801
+ *
5802
+ * @param options Set of options.
5803
+ * @return Output image.
5804
+ */
5805
+ VImage scRGB2CICP(VOption *options = nullptr) const;
5806
+
5647
5807
  /**
5648
5808
  * Transform scrgb to xyz.
5649
5809
  * @param options Set of options.
@@ -5807,6 +5967,8 @@ public:
5807
5967
  *
5808
5968
  * **Optional parameters**
5809
5969
  * - **interesting** -- How to measure interestingness, VipsInteresting.
5970
+ * - **interesting_x** -- Horizontal position of the specific point of interest, int.
5971
+ * - **interesting_y** -- Vertical position of the specific point of interest, int.
5810
5972
  * - **premultiplied** -- Input image already has premultiplied alpha, bool.
5811
5973
  *
5812
5974
  * @param width Width of extract area.
@@ -6000,6 +6162,8 @@ public:
6000
6162
  * - **size** -- Only upsize, only downsize, or both, VipsSize.
6001
6163
  * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool.
6002
6164
  * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting.
6165
+ * - **interesting_x** -- Horizontal position of the specific point of interest for cropping, int.
6166
+ * - **interesting_y** -- Vertical position of the specific point of interest for cropping, int.
6003
6167
  * - **linear** -- Reduce in linear light, bool.
6004
6168
  * - **input_profile** -- Fallback input profile, const char *.
6005
6169
  * - **output_profile** -- Fallback output profile, const char *.
@@ -6022,6 +6186,8 @@ public:
6022
6186
  * - **size** -- Only upsize, only downsize, or both, VipsSize.
6023
6187
  * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool.
6024
6188
  * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting.
6189
+ * - **interesting_x** -- Horizontal position of the specific point of interest for cropping, int.
6190
+ * - **interesting_y** -- Vertical position of the specific point of interest for cropping, int.
6025
6191
  * - **linear** -- Reduce in linear light, bool.
6026
6192
  * - **input_profile** -- Fallback input profile, const char *.
6027
6193
  * - **output_profile** -- Fallback output profile, const char *.
@@ -6043,6 +6209,8 @@ public:
6043
6209
  * - **size** -- Only upsize, only downsize, or both, VipsSize.
6044
6210
  * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool.
6045
6211
  * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting.
6212
+ * - **interesting_x** -- Horizontal position of the specific point of interest for cropping, int.
6213
+ * - **interesting_y** -- Vertical position of the specific point of interest for cropping, int.
6046
6214
  * - **linear** -- Reduce in linear light, bool.
6047
6215
  * - **input_profile** -- Fallback input profile, const char *.
6048
6216
  * - **output_profile** -- Fallback output profile, const char *.
@@ -6064,6 +6232,8 @@ public:
6064
6232
  * - **size** -- Only upsize, only downsize, or both, VipsSize.
6065
6233
  * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool.
6066
6234
  * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting.
6235
+ * - **interesting_x** -- Horizontal position of the specific point of interest for cropping, int.
6236
+ * - **interesting_y** -- Vertical position of the specific point of interest for cropping, int.
6067
6237
  * - **linear** -- Reduce in linear light, bool.
6068
6238
  * - **input_profile** -- Fallback input profile, const char *.
6069
6239
  * - **output_profile** -- Fallback output profile, const char *.
@@ -6344,6 +6514,17 @@ public:
6344
6514
  *
6345
6515
  * **Optional parameters**
6346
6516
  * - **Q** -- Q factor, int.
6517
+ * - **gainmap_scale_factor** -- The scale factor of base image to gainmap image, int.
6518
+ * - **peak_brightness** -- Target display peak brightness in nits, double.
6519
+ * - **max_content_boost** -- Maximum content boost for the gainmap, double.
6520
+ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool.
6521
+ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool.
6522
+ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample.
6523
+ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool.
6524
+ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool.
6525
+ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool.
6526
+ * - **quant_table** -- Use predefined quantization table with given index, int.
6527
+ * - **restart_interval** -- Add restart markers every specified number of mcu, int.
6347
6528
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
6348
6529
  * - **background** -- Background value, std::vector<double>.
6349
6530
  * - **page_height** -- Set page height for multipage save, int.
@@ -6359,6 +6540,17 @@ public:
6359
6540
  *
6360
6541
  * **Optional parameters**
6361
6542
  * - **Q** -- Q factor, int.
6543
+ * - **gainmap_scale_factor** -- The scale factor of base image to gainmap image, int.
6544
+ * - **peak_brightness** -- Target display peak brightness in nits, double.
6545
+ * - **max_content_boost** -- Maximum content boost for the gainmap, double.
6546
+ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool.
6547
+ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool.
6548
+ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample.
6549
+ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool.
6550
+ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool.
6551
+ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool.
6552
+ * - **quant_table** -- Use predefined quantization table with given index, int.
6553
+ * - **restart_interval** -- Add restart markers every specified number of mcu, int.
6362
6554
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
6363
6555
  * - **background** -- Background value, std::vector<double>.
6364
6556
  * - **page_height** -- Set page height for multipage save, int.
@@ -6374,6 +6566,17 @@ public:
6374
6566
  *
6375
6567
  * **Optional parameters**
6376
6568
  * - **Q** -- Q factor, int.
6569
+ * - **gainmap_scale_factor** -- The scale factor of base image to gainmap image, int.
6570
+ * - **peak_brightness** -- Target display peak brightness in nits, double.
6571
+ * - **max_content_boost** -- Maximum content boost for the gainmap, double.
6572
+ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool.
6573
+ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool.
6574
+ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample.
6575
+ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool.
6576
+ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool.
6577
+ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool.
6578
+ * - **quant_table** -- Use predefined quantization table with given index, int.
6579
+ * - **restart_interval** -- Add restart markers every specified number of mcu, int.
6377
6580
  * - **keep** -- Which metadata to retain, VipsForeignKeep.
6378
6581
  * - **background** -- Background value, std::vector<double>.
6379
6582
  * - **page_height** -- Set page height for multipage save, int.
@@ -6390,6 +6593,7 @@ public:
6390
6593
  * **Optional parameters**
6391
6594
  * - **max_alpha** -- Maximum value of alpha channel, double.
6392
6595
  * - **alpha_band** -- Unpremultiply with this alpha, int.
6596
+ * - **uchar** -- Output should be uchar, bool.
6393
6597
  *
6394
6598
  * @param options Set of options.
6395
6599
  * @return Output image.
@@ -138,8 +138,8 @@ typedef enum {
138
138
  * @VIPS_OPERATION_BOOLEAN_AND: `&`
139
139
  * @VIPS_OPERATION_BOOLEAN_OR: `|`
140
140
  * @VIPS_OPERATION_BOOLEAN_EOR: `^`
141
- * @VIPS_OPERATION_BOOLEAN_LSHIFT: `>>`
142
- * @VIPS_OPERATION_BOOLEAN_RSHIFT: `<<`
141
+ * @VIPS_OPERATION_BOOLEAN_LSHIFT: `<<`
142
+ * @VIPS_OPERATION_BOOLEAN_RSHIFT: `>>`
143
143
  *
144
144
  * See also: [method@Image.boolean].
145
145
  */
@@ -93,6 +93,11 @@ extern "C" {
93
93
  #define VIPS_D3250_Y0 (100.0)
94
94
  #define VIPS_D3250_Z0 (45.8501)
95
95
 
96
+ /* Rescale from libuhdr's linear convention (1.0 = 203 nits, the ITU-R
97
+ * BT.2408 SDR reference white) to scRGB (1.0 = 80 nits).
98
+ */
99
+ #define VIPS_UHDR_TO_SCRGB (203.0f / 80.0f)
100
+
96
101
  /* Note: constants align with those defined in lcms2.h, except for
97
102
  * VIPS_INTENT_AUTO, which is libvips-specific.
98
103
  */
@@ -105,15 +110,72 @@ typedef enum {
105
110
  * four standard ones.
106
111
  */
107
112
  VIPS_INTENT_AUTO = 32,
108
- VIPS_INTENT_LAST /*< skip >*/
113
+ VIPS_INTENT_LAST /*< skip >*/
109
114
  } VipsIntent;
110
115
 
111
116
  typedef enum {
112
117
  VIPS_PCS_LAB,
113
118
  VIPS_PCS_XYZ,
114
- VIPS_PCS_LAST /*< skip >*/
119
+ VIPS_PCS_LAST /*< skip >*/
115
120
  } VipsPCS;
116
121
 
122
+ /* ITU-T H.273
123
+ */
124
+ typedef enum {
125
+ VIPS_CICP_COLOUR_PRIMARIES_BT709 = 1, /* sRGB */
126
+ VIPS_CICP_COLOUR_PRIMARIES_UNSPECIFIED = 2,
127
+ VIPS_CICP_COLOUR_PRIMARIES_BT470M = 4,
128
+ VIPS_CICP_COLOUR_PRIMARIES_BT470BG = 5,
129
+ VIPS_CICP_COLOUR_PRIMARIES_BT601 = 6,
130
+ VIPS_CICP_COLOUR_PRIMARIES_SMPTE240 = 7,
131
+ VIPS_CICP_COLOUR_PRIMARIES_GENERIC_FILM = 8,
132
+ VIPS_CICP_COLOUR_PRIMARIES_BT2020 = 9,
133
+ VIPS_CICP_COLOUR_PRIMARIES_SMPTE428 = 10,
134
+ VIPS_CICP_COLOUR_PRIMARIES_SMPTE431 = 11, /*< nick=dci-p3 >*/
135
+ VIPS_CICP_COLOUR_PRIMARIES_SMPTE432 = 12, /*< nick=display-p3 >*/
136
+ VIPS_CICP_COLOUR_PRIMARIES_EBU3213 = 22,
137
+ VIPS_CICP_COLOUR_PRIMARIES_LAST /*< skip >*/
138
+ } VipsCICPColourPrimaries;
139
+
140
+ typedef enum {
141
+ VIPS_CICP_TRANSFER_BT709 = 1,
142
+ VIPS_CICP_TRANSFER_UNSPECIFIED = 2,
143
+ VIPS_CICP_TRANSFER_BT470M = 4, /* gamma 2.2 */
144
+ VIPS_CICP_TRANSFER_BT470BG = 5, /* gamma 2.8 */
145
+ VIPS_CICP_TRANSFER_BT601 = 6,
146
+ VIPS_CICP_TRANSFER_SMPTE240 = 7,
147
+ VIPS_CICP_TRANSFER_LINEAR = 8,
148
+ VIPS_CICP_TRANSFER_LOG_100 = 9,
149
+ VIPS_CICP_TRANSFER_LOG_100_SQRT10 = 10,
150
+ VIPS_CICP_TRANSFER_IEC61966 = 11,
151
+ VIPS_CICP_TRANSFER_BT1361 = 12,
152
+ VIPS_CICP_TRANSFER_SRGB = 13,
153
+ VIPS_CICP_TRANSFER_BT2020_10BIT = 14,
154
+ VIPS_CICP_TRANSFER_BT2020_12BIT = 15,
155
+ VIPS_CICP_TRANSFER_PQ = 16, /* ITU-R BT.2100 PQ */
156
+ VIPS_CICP_TRANSFER_SMPTE428 = 17,
157
+ VIPS_CICP_TRANSFER_HLG = 18, /* ITU-R BT.2100 HLG */
158
+ VIPS_CICP_TRANSFER_LAST /*< skip >*/
159
+ } VipsCICPTransferCharacteristics;
160
+
161
+ typedef enum {
162
+ VIPS_CICP_MATRIX_RGB = 0, /* Identity */
163
+ VIPS_CICP_MATRIX_BT709 = 1,
164
+ VIPS_CICP_MATRIX_UNSPECIFIED = 2,
165
+ VIPS_CICP_MATRIX_FCC = 4,
166
+ VIPS_CICP_MATRIX_BT470BG = 5,
167
+ VIPS_CICP_MATRIX_BT601 = 6,
168
+ VIPS_CICP_MATRIX_SMPTE240 = 7,
169
+ VIPS_CICP_MATRIX_YCGCO = 8,
170
+ VIPS_CICP_MATRIX_BT2020_NCL = 9,
171
+ VIPS_CICP_MATRIX_BT2020_CL = 10,
172
+ VIPS_CICP_MATRIX_SMPTE2085 = 11,
173
+ VIPS_CICP_MATRIX_CHROMA_NCL = 12,
174
+ VIPS_CICP_MATRIX_CHROMA_CL = 13,
175
+ VIPS_CICP_MATRIX_ICTCP = 14,
176
+ VIPS_CICP_MATRIX_LAST /*< skip >*/
177
+ } VipsCICPMatrixCoefficients;
178
+
117
179
  VIPS_API
118
180
  gboolean vips_colourspace_issupported(const VipsImage *image);
119
181
  VIPS_API
@@ -220,6 +282,13 @@ VIPS_API
220
282
  int vips_uhdr2scRGB(VipsImage *in, VipsImage **out, ...)
221
283
  G_GNUC_NULL_TERMINATED;
222
284
 
285
+ VIPS_API
286
+ int vips_CICP2scRGB(VipsImage *in, VipsImage **out, ...)
287
+ G_GNUC_NULL_TERMINATED;
288
+ VIPS_API
289
+ int vips_scRGB2CICP(VipsImage *in, VipsImage **out, ...)
290
+ G_GNUC_NULL_TERMINATED;
291
+
223
292
  VIPS_API
224
293
  int vips_profile_load(const char *name, VipsBlob **profile, ...)
225
294
  G_GNUC_NULL_TERMINATED;
@@ -102,6 +102,7 @@ typedef enum {
102
102
  VIPS_INTERESTING_LOW,
103
103
  VIPS_INTERESTING_HIGH,
104
104
  VIPS_INTERESTING_ALL,
105
+ VIPS_INTERESTING_SPECIFIC,
105
106
  VIPS_INTERESTING_LAST /*< skip >*/
106
107
  } VipsInteresting;
107
108
 
@@ -131,7 +132,11 @@ typedef enum {
131
132
  VIPS_BLEND_MODE_SOFT_LIGHT,
132
133
  VIPS_BLEND_MODE_DIFFERENCE,
133
134
  VIPS_BLEND_MODE_EXCLUSION,
134
- VIPS_BLEND_MODE_LAST /*< skip >*/
135
+ VIPS_BLEND_MODE_HUE,
136
+ VIPS_BLEND_MODE_SATURATION,
137
+ VIPS_BLEND_MODE_COLOUR,
138
+ VIPS_BLEND_MODE_LUMINOSITY,
139
+ VIPS_BLEND_MODE_LAST /*< skip >*/
135
140
  } VipsBlendMode;
136
141
 
137
142
  VIPS_API
@@ -41,6 +41,15 @@ GType vips_intent_get_type(void);
41
41
  VIPS_API
42
42
  GType vips_pcs_get_type(void);
43
43
  #define VIPS_TYPE_PCS (vips_pcs_get_type())
44
+ VIPS_API
45
+ GType vips_cicp_colour_primaries_get_type(void);
46
+ #define VIPS_TYPE_CICP_COLOUR_PRIMARIES (vips_cicp_colour_primaries_get_type())
47
+ VIPS_API
48
+ GType vips_cicp_transfer_characteristics_get_type(void);
49
+ #define VIPS_TYPE_CICP_TRANSFER_CHARACTERISTICS (vips_cicp_transfer_characteristics_get_type())
50
+ VIPS_API
51
+ GType vips_cicp_matrix_coefficients_get_type(void);
52
+ #define VIPS_TYPE_CICP_MATRIX_COEFFICIENTS (vips_cicp_matrix_coefficients_get_type())
44
53
  /* enumerations from "conversion.h" */
45
54
  VIPS_API
46
55
  GType vips_extend_get_type(void);
@@ -67,6 +67,8 @@ VIPS_API
67
67
  void vips_error_exit(const char *fmt, ...)
68
68
  G_GNUC_NORETURN G_GNUC_PRINTF(1, 2);
69
69
 
70
+ VIPS_API
71
+ int vips_check_draw(const char *domain, VipsImage *image);
70
72
  VIPS_API
71
73
  int vips_check_uncoded(const char *domain, VipsImage *im);
72
74
  VIPS_API
@@ -815,6 +815,25 @@ VIPS_API
815
815
  int vips_ppmsave_target(VipsImage *in, VipsTarget *target, ...)
816
816
  G_GNUC_NULL_TERMINATED;
817
817
 
818
+ VIPS_API
819
+ int vips_qoiload(const char *filename, VipsImage **out, ...)
820
+ G_GNUC_NULL_TERMINATED;
821
+ VIPS_API
822
+ int vips_qoiload_buffer(void *buf, size_t len, VipsImage **out, ...)
823
+ G_GNUC_NULL_TERMINATED;
824
+ VIPS_API
825
+ int vips_qoiload_source(VipsSource *source, VipsImage **out, ...)
826
+ G_GNUC_NULL_TERMINATED;
827
+ VIPS_API
828
+ int vips_qoisave(VipsImage *in, const char *filename, ...)
829
+ G_GNUC_NULL_TERMINATED;
830
+ VIPS_API
831
+ int vips_qoisave_buffer(VipsImage *in, void **buf, size_t *len, ...)
832
+ G_GNUC_NULL_TERMINATED;
833
+ VIPS_API
834
+ int vips_qoisave_target(VipsImage *in, VipsTarget *target, ...)
835
+ G_GNUC_NULL_TERMINATED;
836
+
818
837
  VIPS_API
819
838
  int vips_matload(const char *filename, VipsImage **out, ...)
820
839
  G_GNUC_NULL_TERMINATED;
@@ -192,6 +192,18 @@ extern "C" {
192
192
  */
193
193
  #define VIPS_META_TILE_HEIGHT "tile-height"
194
194
 
195
+ #define VIPS_META_CICP_COLOUR_PRIMARIES "cicp-colour-primaries"
196
+
197
+ #define VIPS_META_CICP_TRANSFER_CHARACTERISTICS "cicp-transfer-characteristics"
198
+
199
+ #define VIPS_META_CICP_MATRIX_COEFFICIENTS "cicp-matrix-coefficients"
200
+
201
+ #define VIPS_META_CICP_FULL_RANGE_FLAG "cicp-full-range-flag"
202
+
203
+ #define VIPS_META_CLLI_MAX_CONTENT_LIGHT_LEVEL "clli-max-content-light-level"
204
+
205
+ #define VIPS_META_CLLI_MAX_FRAME_AVERAGE_LIGHT_LEVEL "clli-max-frame-average-light-level"
206
+
195
207
  VIPS_API
196
208
  guint64 vips_format_sizeof(VipsBandFormat format);
197
209
  VIPS_API
@@ -241,6 +253,8 @@ int vips_image_get_page_height(VipsImage *image);
241
253
  VIPS_API
242
254
  int vips_image_get_n_pages(VipsImage *image);
243
255
  VIPS_API
256
+ int vips_image_get_loop(VipsImage *image);
257
+ VIPS_API
244
258
  int vips_image_get_n_subifds(VipsImage *image);
245
259
  VIPS_API
246
260
  int vips_image_get_orientation(VipsImage *image);
@@ -299,6 +313,9 @@ void vips_image_set_blob_copy(VipsImage *image,
299
313
  VIPS_API
300
314
  int vips_image_get_blob(const VipsImage *image,
301
315
  const char *name, const void **data, size_t *length);
316
+ VIPS_API
317
+ int vips_image_get_blob_value(const VipsImage *image,
318
+ const char *name, VipsBlob **blob);
302
319
 
303
320
  VIPS_API
304
321
  int vips_image_get_int(const VipsImage *image, const char *name, int *out);
@@ -45,6 +45,9 @@ VIPS_API
45
45
  int vips_percent(VipsImage *in, double percent, int *threshold, ...)
46
46
  G_GNUC_NULL_TERMINATED;
47
47
  VIPS_API
48
+ int vips_percent_lum(VipsImage *in, double percent, double *threshold, ...)
49
+ G_GNUC_NULL_TERMINATED;
50
+ VIPS_API
48
51
  int vips_stdif(VipsImage *in, VipsImage **out, int width, int height, ...)
49
52
  G_GNUC_NULL_TERMINATED;
50
53
  VIPS_API
@@ -227,7 +227,7 @@ struct _VipsImage {
227
227
  char *Hist; /* don't use, see vips_image_get_history() */
228
228
  char *filename; /* pointer to copy of filename */
229
229
  VipsPel *data; /* start of image data for WIO */
230
- int kill; /* set to non-zero to block eval */
230
+ int kill; /* (atomic) - set to non-zero to block eval */
231
231
 
232
232
  /* Everything below this private and only used internally by
233
233
  * VipsImage.
@@ -551,6 +551,8 @@ gboolean vips_image_hasalpha(VipsImage *image);
551
551
  VIPS_API
552
552
  VipsImage *vips_image_copy_memory(VipsImage *image);
553
553
  VIPS_API
554
+ VipsImage *vips_image_copy_draw(VipsImage *image);
555
+ VIPS_API
554
556
  int vips_image_wio_input(VipsImage *image);
555
557
  VIPS_API
556
558
  int vips_image_pio_input(VipsImage *image);
@@ -86,6 +86,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsTargetCustom, g_object_unref)
86
86
  G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsSbuf, g_object_unref)
87
87
  G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsInterpolate, g_object_unref)
88
88
  G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsOperation, g_object_unref)
89
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsRect, g_free);
89
90
 
90
91
  // FIXME ... need more of these
91
92
  G_DEFINE_AUTOPTR_CLEANUP_FUNC(VipsArrayDouble, VipsArrayDouble_unref)
@@ -163,6 +163,9 @@ VIPS_API
163
163
  void vips_region_copy(VipsRegion *reg, VipsRegion *dest,
164
164
  const VipsRect *r, int x, int y);
165
165
  VIPS_API
166
+ void vips_region_blend_over(VipsRegion *reg, VipsRegion *dest,
167
+ const VipsRect *r, int x, int y);
168
+ VIPS_API
166
169
  int vips_region_shrink_method(VipsRegion *from, VipsRegion *to,
167
170
  const VipsRect *target, VipsRegionShrink method);
168
171
  VIPS_API
@@ -119,7 +119,7 @@ typedef VipsThreadState *(*VipsThreadStartFn)(VipsImage *im, void *a);
119
119
 
120
120
  /* A work allocate function. This is run single-threaded by a worker to
121
121
  * set up a new work unit.
122
- * Return non-zero for errors. Set *stop for "no more work to do"
122
+ * Return non-zero for errors. Set *stop atomically for "no more work to do"
123
123
  */
124
124
  typedef int (*VipsThreadpoolAllocateFn)(VipsThreadState *state,
125
125
  void *a, gboolean *stop);
@@ -129,8 +129,8 @@ typedef int (*VipsThreadpoolAllocateFn)(VipsThreadState *state,
129
129
  */
130
130
  typedef int (*VipsThreadpoolWorkFn)(VipsThreadState *state, void *a);
131
131
 
132
- /* A progress function. This is run by the main thread once for every
133
- * allocation. Return an error to kill computation early.
132
+ /* A progress function. This is run single-threaded by a worker once for
133
+ * every work unit processed. Return an error to kill computation early.
134
134
  */
135
135
  typedef int (*VipsThreadpoolProgressFn)(void *a);
136
136