ruby-vips 2.2.4 → 2.3.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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/CHANGELOG.md +15 -2
- data/README.md +2 -2
- data/VERSION +1 -1
- data/example/inheritance_with_refcount.rb +3 -0
- data/lib/vips/combine.rb +10 -0
- data/lib/vips/fail_on.rb +15 -0
- data/lib/vips/foreign_dz_container.rb +10 -0
- data/lib/vips/foreign_dz_depth.rb +10 -0
- data/lib/vips/foreign_dz_layout.rb +12 -0
- data/lib/vips/foreign_heif_compression.rb +11 -0
- data/lib/vips/foreign_heif_encoder.rb +11 -0
- data/lib/vips/foreign_keep.rb +14 -0
- data/lib/vips/foreign_png_filter.rb +13 -0
- data/lib/vips/foreign_ppm_format.rb +12 -0
- data/lib/vips/foreign_subsample.rb +10 -0
- data/lib/vips/foreign_tiff_compression.rb +16 -0
- data/lib/vips/foreign_tiff_predictor.rb +10 -0
- data/lib/vips/foreign_tiff_resunit.rb +9 -0
- data/lib/vips/foreign_webp_preset.rb +13 -0
- data/lib/vips/gvalue.rb +41 -3
- data/lib/vips/image.rb +40 -15
- data/lib/vips/intent.rb +12 -0
- data/lib/vips/interpolate.rb +1 -1
- data/lib/vips/interpretation.rb +4 -3
- data/lib/vips/kernel.rb +9 -6
- data/lib/vips/methods.rb +241 -116
- data/lib/vips/mutableimage.rb +1 -0
- data/lib/vips/object.rb +1 -0
- data/lib/vips/operation_morphology.rb +9 -0
- data/lib/vips/pcs.rb +10 -0
- data/lib/vips/precision.rb +10 -0
- data/lib/vips/region_shrink.rb +13 -0
- data/lib/vips/sdf_shape.rb +11 -0
- data/lib/vips/text_wrap.rb +11 -0
- data/lib/vips/version.rb +1 -1
- data/lib/vips.rb +28 -13
- metadata +25 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b025e3dd6e37cb95d8b77fea2351d2c8bef1d711cb8fd600d1532fed3ce606db
|
|
4
|
+
data.tar.gz: 245512b73bdb8db46af18c499060b2e2ab39ab2976c1eabc4866f0610fc51e0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 28e0163d98af345d4b01536f508a28d052a594ee84e4a171d61960dc1af09c79c92aa063557cb5ff66b38f334c36f18ed3c262c13e68dcacbe65ee8ece277bef
|
|
7
|
+
data.tar.gz: 7a84837e453159d4126bc6dded6f3a6e3d76fdc43e1725fa6aa5d72b5bb6eeceb2c9240f05c8a4c3f804b56165bff3f0a7129b16b7573805eb38ae6246d7c66c
|
data/.github/workflows/test.yml
CHANGED
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
15
|
- name: Checkout code
|
|
16
|
-
uses: actions/checkout@
|
|
16
|
+
uses: actions/checkout@v6
|
|
17
17
|
|
|
18
18
|
- name: Set up Ruby
|
|
19
19
|
uses: ruby/setup-ruby@v1
|
|
@@ -47,7 +47,7 @@ jobs:
|
|
|
47
47
|
|
|
48
48
|
steps:
|
|
49
49
|
- name: Checkout code
|
|
50
|
-
uses: actions/checkout@
|
|
50
|
+
uses: actions/checkout@v6
|
|
51
51
|
|
|
52
52
|
- name: Set up Ruby
|
|
53
53
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## master
|
|
4
4
|
|
|
5
|
+
## Version 2.3.0 (2025-12-10)
|
|
6
|
+
|
|
7
|
+
* move library_name out of the global namespace and into FFI [jcupitt]
|
|
8
|
+
* update docs for libvips 8.18 [jcupitt]
|
|
9
|
+
* add Image#get_gainmap [jcupitt]
|
|
10
|
+
* version bump to 2.3
|
|
11
|
+
|
|
12
|
+
## Version 2.2.5 (2025-08-20)
|
|
13
|
+
|
|
14
|
+
* improve NULL pointer handling [dloebl]
|
|
15
|
+
* improve GFlags argument handling [jcupitt]
|
|
16
|
+
* add missing flag and enum docs [jcupitt]
|
|
17
|
+
|
|
5
18
|
## Version 2.2.4 (2025-06-05)
|
|
6
19
|
|
|
7
20
|
* fix write to target test with libvips 8.17 [jcupitt]
|
|
@@ -18,8 +31,8 @@
|
|
|
18
31
|
|
|
19
32
|
## Version 2.2.1 (2024-02-21)
|
|
20
33
|
|
|
21
|
-
* add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/
|
|
22
|
-
* add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/
|
|
34
|
+
* add `Vips.block_untrusted` method to block all untrusted operations. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/func.block_untrusted_set.html). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
|
|
35
|
+
* add `Vips.block` method to block specific operation. Only for libvips >= 8.13. [Docs](https://www.libvips.org/API/current/type_func.Operation.block_set.html). [#382](https://github.com/libvips/ruby-vips/pull/382) [aglushkov](https://github.com/aglushkov)
|
|
23
36
|
* `new_from_source` keeps a ref to the source object [taylorthurlow]
|
|
24
37
|
* some fixes to object references system
|
|
25
38
|
|
data/README.md
CHANGED
|
@@ -52,7 +52,7 @@ im = Vips::Image.new_from_file filename
|
|
|
52
52
|
# put im at position (100, 100) in a 3000 x 3000 pixel image,
|
|
53
53
|
# make the other pixels in the image by mirroring im up / down /
|
|
54
54
|
# left / right, see
|
|
55
|
-
# https://libvips.
|
|
55
|
+
# https://www.libvips.org/API/current/method.Image.embed.html
|
|
56
56
|
im = im.embed 100, 100, 3000, 3000, extend: :mirror
|
|
57
57
|
|
|
58
58
|
# multiply the green (middle) band by 2, leave the other two alone
|
|
@@ -80,7 +80,7 @@ should always work.
|
|
|
80
80
|
See the `Vips` section in the docs for a [tutorial introduction with
|
|
81
81
|
examples](https://www.rubydoc.info/gems/ruby-vips/Vips).
|
|
82
82
|
|
|
83
|
-
The [libvips reference manual](https://libvips.
|
|
83
|
+
The [libvips reference manual](https://www.libvips.org/API/current/)
|
|
84
84
|
has a complete explanation of every method.
|
|
85
85
|
|
|
86
86
|
The [`example/`](https://github.com/libvips/ruby-vips/tree/master/example)
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.3.0
|
|
@@ -21,6 +21,7 @@ end
|
|
|
21
21
|
|
|
22
22
|
module Libc
|
|
23
23
|
extend FFI::Library
|
|
24
|
+
|
|
24
25
|
ffi_lib FFI::Library::LIBC
|
|
25
26
|
|
|
26
27
|
attach_function :malloc, [:size_t], :pointer
|
|
@@ -29,6 +30,7 @@ end
|
|
|
29
30
|
|
|
30
31
|
module GLib
|
|
31
32
|
extend FFI::Library
|
|
33
|
+
|
|
32
34
|
ffi_lib "gobject-2.0"
|
|
33
35
|
|
|
34
36
|
def self.set_log_domain(_domain)
|
|
@@ -142,6 +144,7 @@ end
|
|
|
142
144
|
|
|
143
145
|
module Vips
|
|
144
146
|
extend FFI::Library
|
|
147
|
+
|
|
145
148
|
ffi_lib "vips"
|
|
146
149
|
|
|
147
150
|
LOG_DOMAIN = "VIPS"
|
data/lib/vips/combine.rb
ADDED
data/lib/vips/fail_on.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# How sensitive loaders are to errors, from never stop (very insensitive),
|
|
3
|
+
# to stop on the smallest warning (very sensitive).
|
|
4
|
+
#
|
|
5
|
+
# Each implies the ones before it, so `:error` implies `:truncated`, for
|
|
6
|
+
# example.
|
|
7
|
+
#
|
|
8
|
+
# * `:none` never stop
|
|
9
|
+
# * `:truncated` stop on image truncated, nothing else
|
|
10
|
+
# * `:error` stop on serious error or truncation
|
|
11
|
+
# * `:warning` stop on anything, even warnings
|
|
12
|
+
|
|
13
|
+
class FailOn < Symbol
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# What directory layout and metadata standard to use.
|
|
3
|
+
#
|
|
4
|
+
# * `:dz` use DeepZoom directory layout
|
|
5
|
+
# * `:zoomify` use Zoomify directory layout
|
|
6
|
+
# * `:google` use Google maps directory layout
|
|
7
|
+
# * `:iiif` use IIIF v2 directory layout
|
|
8
|
+
# * `:iiif3` use IIIF v3 directory layout
|
|
9
|
+
|
|
10
|
+
class ForeignDzLayout < Symbol
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# Savers can be given a set of metadata items to keep.
|
|
3
|
+
#
|
|
4
|
+
# * `:none` remove all metadata
|
|
5
|
+
# * `:exif` keep EXIF metadata
|
|
6
|
+
# * `:xmp` keep XMP metadata
|
|
7
|
+
# * `:iptc` keep IPTC metadata
|
|
8
|
+
# * `:icc` keep ICC profiles
|
|
9
|
+
# * `:gainmap` keep the gainmap metadata
|
|
10
|
+
# * `:other` keep other metadata
|
|
11
|
+
|
|
12
|
+
class ForeignKeep < Symbol
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# The set of filters for PNG save. See http://www.w3.org/TR/PNG-Filters.html
|
|
3
|
+
#
|
|
4
|
+
# * `:none` no filtering
|
|
5
|
+
# * `:sub` difference to the left
|
|
6
|
+
# * `:up` difference up
|
|
7
|
+
# * `:avg` average of left and up
|
|
8
|
+
# * `:paeth` pick best neighbor predictor automatically
|
|
9
|
+
# * `:all` adaptive
|
|
10
|
+
|
|
11
|
+
class ForeignPngFilter < Symbol
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# The compression types supported by the tiff writer.
|
|
3
|
+
#
|
|
4
|
+
# * `:none` no compression
|
|
5
|
+
# * `:jpeg` jpeg compression
|
|
6
|
+
# * `:deflate` deflate (zip) compression
|
|
7
|
+
# * `:packbits` packbits compression
|
|
8
|
+
# * `:ccittfax4` fax4 compression
|
|
9
|
+
# * `:lzw` LZW compression
|
|
10
|
+
# * `:webp` WEBP compression
|
|
11
|
+
# * `:zstd` ZSTD compression
|
|
12
|
+
# * `:jp2k` JP2K compression
|
|
13
|
+
|
|
14
|
+
class ForeignTiffCompression < Symbol
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# Tune lossy encoder settings for different image types.
|
|
3
|
+
#
|
|
4
|
+
# * `:default` default preset
|
|
5
|
+
# * `:picture` digital picture, like portrait, inner shot
|
|
6
|
+
# * `:photo` outdoor photograph, with natural lighting
|
|
7
|
+
# * `:drawing` hand or line drawing, with high-contrast details
|
|
8
|
+
# * `:icon` small-sized colorful images
|
|
9
|
+
# * `:text` text-like
|
|
10
|
+
|
|
11
|
+
class ForeignWebpPreset < Symbol
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/vips/gvalue.rb
CHANGED
|
@@ -25,7 +25,7 @@ module GObject
|
|
|
25
25
|
:data, [:ulong_long, 2]
|
|
26
26
|
|
|
27
27
|
# convert an enum value (str/symb/int) into an int ready for libvips
|
|
28
|
-
def self.
|
|
28
|
+
def self.enum_from_nick(gtype, value)
|
|
29
29
|
value = value.to_s if value.is_a? Symbol
|
|
30
30
|
|
|
31
31
|
if value.is_a? String
|
|
@@ -40,6 +40,43 @@ module GObject
|
|
|
40
40
|
value
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
# compatibility ... we used to call it this, perhaps someone has used this
|
|
44
|
+
# internal method
|
|
45
|
+
def self.from_nick(gtype, value)
|
|
46
|
+
GValue.enum_from_nick(gtype, value)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# convert an flags value (array[str/symb/int] | str/symb/int) into an
|
|
50
|
+
# int ready for libvips
|
|
51
|
+
def self.flags_from_nick(gtype, value)
|
|
52
|
+
if value.is_a? String
|
|
53
|
+
# libvips will parse strings like "sub|up" etc.
|
|
54
|
+
name = value.tr("_", "-")
|
|
55
|
+
value = Vips.vips_flags_from_nick "ruby-vips", gtype, name
|
|
56
|
+
else
|
|
57
|
+
value = [value] if !value.is_a? Array
|
|
58
|
+
|
|
59
|
+
# convert each item to a set of bits, OR them together
|
|
60
|
+
result = 0
|
|
61
|
+
value.map do |item|
|
|
62
|
+
item = item.to_s if item.is_a? Symbol
|
|
63
|
+
if item.is_a? String
|
|
64
|
+
name = item.tr("_", "-")
|
|
65
|
+
item = Vips.vips_flags_from_nick "ruby-vips", gtype, name
|
|
66
|
+
if item == -1
|
|
67
|
+
raise Vips::Error
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
result |= item
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
value = result
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
value
|
|
78
|
+
end
|
|
79
|
+
|
|
43
80
|
# convert an int enum back into a symbol
|
|
44
81
|
def self.to_nick(gtype, enum_value)
|
|
45
82
|
enum_name = Vips.vips_enum_nick gtype, enum_value
|
|
@@ -148,10 +185,11 @@ module GObject
|
|
|
148
185
|
else
|
|
149
186
|
case fundamental
|
|
150
187
|
when GFLAGS_TYPE
|
|
151
|
-
|
|
188
|
+
flags_value = GValue.flags_from_nick(self[:gtype], value)
|
|
189
|
+
::GObject.g_value_set_flags self, flags_value
|
|
152
190
|
|
|
153
191
|
when GENUM_TYPE
|
|
154
|
-
enum_value = GValue.
|
|
192
|
+
enum_value = GValue.enum_from_nick(self[:gtype], value)
|
|
155
193
|
::GObject.g_value_set_enum self, enum_value
|
|
156
194
|
|
|
157
195
|
when GOBJECT_TYPE
|
data/lib/vips/image.rb
CHANGED
|
@@ -50,6 +50,10 @@ module Vips
|
|
|
50
50
|
attach_function :vips_addalpha, [:pointer, :pointer, :varargs], :int
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
if Vips.at_least_libvips?(8, 18)
|
|
54
|
+
attach_function :vips_image_get_gainmap, [:pointer], :pointer
|
|
55
|
+
end
|
|
56
|
+
|
|
53
57
|
# move these three lines to mutableimage when we finally remove set and
|
|
54
58
|
# remove in this class
|
|
55
59
|
attach_function :vips_image_set,
|
|
@@ -114,12 +118,12 @@ module Vips
|
|
|
114
118
|
end
|
|
115
119
|
|
|
116
120
|
def self.complex? format
|
|
117
|
-
format_number = GObject::GValue.
|
|
121
|
+
format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
|
|
118
122
|
Vips.vips_band_format_iscomplex(format_number) != 0
|
|
119
123
|
end
|
|
120
124
|
|
|
121
125
|
def self.float? format
|
|
122
|
-
format_number = GObject::GValue.
|
|
126
|
+
format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
|
|
123
127
|
Vips.vips_band_format_isfloat(format_number) != 0
|
|
124
128
|
end
|
|
125
129
|
|
|
@@ -380,7 +384,7 @@ module Vips
|
|
|
380
384
|
size = data.bytesize
|
|
381
385
|
end
|
|
382
386
|
|
|
383
|
-
format_number = GObject::GValue.
|
|
387
|
+
format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
|
|
384
388
|
vi = Vips.vips_image_new_from_memory data, size,
|
|
385
389
|
width, height, bands, format_number
|
|
386
390
|
raise Vips::Error if vi.null?
|
|
@@ -405,7 +409,7 @@ module Vips
|
|
|
405
409
|
# @param format [Symbol] band format
|
|
406
410
|
# @return [Image] the loaded image
|
|
407
411
|
def self.new_from_memory_copy data, width, height, bands, format
|
|
408
|
-
format_number = GObject::GValue.
|
|
412
|
+
format_number = GObject::GValue.enum_from_nick BAND_FORMAT_TYPE, format
|
|
409
413
|
|
|
410
414
|
if data.is_a?(FFI::Pointer)
|
|
411
415
|
if data.size == UNKNOWN_POINTER_SIZE
|
|
@@ -471,9 +475,10 @@ module Vips
|
|
|
471
475
|
def self.matrix_from_array width, height, array
|
|
472
476
|
ptr = FFI::MemoryPointer.new :double, array.length
|
|
473
477
|
ptr.write_array_of_double array
|
|
474
|
-
|
|
478
|
+
img_ptr = Vips.vips_image_new_matrix_from_array width, height,
|
|
475
479
|
ptr, array.length
|
|
476
|
-
Vips::
|
|
480
|
+
raise Vips::Error if img_ptr.null?
|
|
481
|
+
Vips::Image.new img_ptr
|
|
477
482
|
end
|
|
478
483
|
|
|
479
484
|
# Create a new Image from a 1D or 2D array. A 1D array becomes an
|
|
@@ -534,7 +539,6 @@ module Vips
|
|
|
534
539
|
end
|
|
535
540
|
|
|
536
541
|
image = Vips::Image.matrix_from_array width, height, array
|
|
537
|
-
raise Vips::Error if image.nil?
|
|
538
542
|
|
|
539
543
|
image.mutate do |mutable|
|
|
540
544
|
# be careful to set them as double
|
|
@@ -700,7 +704,7 @@ module Vips
|
|
|
700
704
|
def write_to_memory
|
|
701
705
|
len = Vips::SizeStruct.new
|
|
702
706
|
ptr = Vips.vips_image_write_to_memory self, len
|
|
703
|
-
raise Vips::Error if ptr.
|
|
707
|
+
raise Vips::Error if ptr.null?
|
|
704
708
|
|
|
705
709
|
# wrap up as an autopointer
|
|
706
710
|
ptr = FFI::AutoPointer.new(ptr, GLib::G_FREE)
|
|
@@ -797,8 +801,33 @@ module Vips
|
|
|
797
801
|
names
|
|
798
802
|
end
|
|
799
803
|
|
|
804
|
+
# Get the gainmap (if any) from an image.
|
|
805
|
+
#
|
|
806
|
+
# After modifying the gainmap, you should write it back to the image in a
|
|
807
|
+
# mutable block, see [#mutate], in the field "gainmap".
|
|
808
|
+
#
|
|
809
|
+
# For example:
|
|
810
|
+
#
|
|
811
|
+
# ```ruby
|
|
812
|
+
# gainmap = image.get_gainmap
|
|
813
|
+
# unless gainmap.nil?
|
|
814
|
+
# new_gainmap = gainmap.crop left, top, width, height
|
|
815
|
+
# image = image.mutate do |x|
|
|
816
|
+
# x.set_type! Vips::IMAGE_TYPE, "gainmap", new_gainmap
|
|
817
|
+
# end
|
|
818
|
+
# end
|
|
819
|
+
# ```
|
|
820
|
+
#
|
|
821
|
+
# @return [Image] the gainmap image, or nil
|
|
822
|
+
def get_gainmap
|
|
823
|
+
if Vips.at_least_libvips?(8, 18)
|
|
824
|
+
vi = Vips.vips_image_get_gainmap self
|
|
825
|
+
Image.new(vi) unless vi.null?
|
|
826
|
+
end
|
|
827
|
+
end
|
|
828
|
+
|
|
800
829
|
# Mutate an image with a block. Inside the block, you can call methods
|
|
801
|
-
# which modify the image, such as setting or removing metadata
|
|
830
|
+
# which modify the image, such as setting or removing metadata or
|
|
802
831
|
# modifying pixels.
|
|
803
832
|
#
|
|
804
833
|
# For example:
|
|
@@ -1173,11 +1202,7 @@ module Vips
|
|
|
1173
1202
|
# @return [Image] result of inequality
|
|
1174
1203
|
def != other
|
|
1175
1204
|
# for equality, we must allow tests against nil
|
|
1176
|
-
|
|
1177
|
-
true
|
|
1178
|
-
else
|
|
1179
|
-
call_enum "relational", other, :noteq
|
|
1180
|
-
end
|
|
1205
|
+
other.nil? || call_enum("relational", other, :noteq)
|
|
1181
1206
|
end
|
|
1182
1207
|
|
|
1183
1208
|
# Fetch bands using a number or a range
|
|
@@ -1319,7 +1344,7 @@ module Vips
|
|
|
1319
1344
|
end
|
|
1320
1345
|
|
|
1321
1346
|
mode = mode.map do |x|
|
|
1322
|
-
GObject::GValue.
|
|
1347
|
+
GObject::GValue.enum_from_nick Vips::BLEND_MODE_TYPE, x
|
|
1323
1348
|
end
|
|
1324
1349
|
|
|
1325
1350
|
Vips::Image.composite([self] + overlay, mode, **opts)
|
data/lib/vips/intent.rb
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Vips
|
|
2
|
+
# The rendering intent.
|
|
3
|
+
#
|
|
4
|
+
# * `:perceptual` perceptual rendering intent
|
|
5
|
+
# * `:relative` relative colorimetric rendering intent
|
|
6
|
+
# * `:saturation` saturation rendering intent
|
|
7
|
+
# * `:absolute` absolute colorimetric rendering intent
|
|
8
|
+
# * `:auto` the rendering intent that the profile suggests
|
|
9
|
+
|
|
10
|
+
class Intent < Symbol
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/vips/interpolate.rb
CHANGED
data/lib/vips/interpretation.rb
CHANGED
|
@@ -6,7 +6,6 @@ module Vips
|
|
|
6
6
|
# * `:multiband` generic many-band image
|
|
7
7
|
# * `:b_w` some kind of single-band image
|
|
8
8
|
# * `:histogram` a 1D image, eg. histogram or lookup table
|
|
9
|
-
# * `:fourier` image is in fourier space
|
|
10
9
|
# * `:xyz` the first three bands are CIE XYZ
|
|
11
10
|
# * `:lab` pixels are in CIE Lab space
|
|
12
11
|
# * `:cmyk` the first four bands are in CMYK space
|
|
@@ -16,12 +15,14 @@ module Vips
|
|
|
16
15
|
# * `:lch` pixels are in CIE LCh space
|
|
17
16
|
# * `:labs` CIE LAB coded as three signed 16-bit values
|
|
18
17
|
# * `:srgb` pixels are sRGB
|
|
19
|
-
# * `:hsv` pixels are HSV
|
|
20
|
-
# * `:scrgb` pixels are scRGB
|
|
21
18
|
# * `:yxy` pixels are CIE Yxy
|
|
19
|
+
# * `:fourier` image is in fourier space
|
|
22
20
|
# * `:rgb16` generic 16-bit RGB
|
|
23
21
|
# * `:grey16` generic 16-bit mono
|
|
24
22
|
# * `:matrix` a matrix
|
|
23
|
+
# * `:scrgb` pixels are scRGB
|
|
24
|
+
# * `:hsv` pixels are HSV
|
|
25
|
+
|
|
25
26
|
class Interpretation < Symbol
|
|
26
27
|
end
|
|
27
28
|
end
|
data/lib/vips/kernel.rb
CHANGED
|
@@ -4,16 +4,19 @@ module Vips
|
|
|
4
4
|
#
|
|
5
5
|
# At least these should be available:
|
|
6
6
|
#
|
|
7
|
-
# * `:nearest`
|
|
8
|
-
# * `:linear`
|
|
9
|
-
# * `:cubic`
|
|
10
|
-
# * `:
|
|
11
|
-
# * `:
|
|
7
|
+
# * `:nearest` nearest-neighbour interpolation
|
|
8
|
+
# * `:linear` linear interpolation
|
|
9
|
+
# * `:cubic` cubic interpolation
|
|
10
|
+
# * `:mitchell` Mitchell interpolation
|
|
11
|
+
# * `:lanczos2` two-lobe Lanczos
|
|
12
|
+
# * `:lanczos3` three-lobe Lanczos
|
|
13
|
+
# * `:mks2013` convolve with Magic Kernel Sharp 2013
|
|
14
|
+
# * `:mks2021` convolve with Magic Kernel Sharp 2021
|
|
12
15
|
#
|
|
13
16
|
# For example:
|
|
14
17
|
#
|
|
15
18
|
# ```ruby
|
|
16
|
-
# im = im.resize 3, :
|
|
19
|
+
# im = im.resize 3, kernel: :lanczos2
|
|
17
20
|
# ```
|
|
18
21
|
|
|
19
22
|
class Kernel < Symbol
|