Sha256: 7c23b7586330545727f1c2547df867567a9b219eb8b7ac07b22aefcef4d15100

Contents?: true

Size: 1.57 KB

Versions: 18

Compression:

Stored size: 1.57 KB

Contents

module Vips

    attach_function :vips_interpolate_new, [:string], :pointer

    # An interpolator. One of these can be given to operations like 
    # {Image#affine} or {Image#mapim} to select the type of pixel interpolation
    # to use.
    #
    # To see all interpolators supported by your
    # libvips, try
    #
    # ```
    # $ vips -l interpolate
    # ```
    #
    # But at least these should be available:
    #
    # *   `:nearest` Nearest-neighbour interpolation.
    # *   `:bilinear` Bilinear interpolation.
    # *   `:bicubic` Bicubic interpolation.
    # *   `:lbb` Reduced halo bicubic interpolation.
    # *   `:nohalo` Edge sharpening resampler with halo reduction.
    # *   `:vsqbs` B-Splines with antialiasing smoothing.
    #
    #  For example:
    #
    #  ```ruby
    #  im = im.affine [2, 0, 0, 2], 
    #      :interpolate => Vips::Interpolate.new(:bicubic)
    #  ```

    class Interpolate < Vips::Object

        # the layout of the VipsInterpolate struct
        module InterpolateLayout
            def self.included base
                base.class_eval do
                    layout :parent, Vips::Object::Struct
                    # rest opaque
                end
            end
        end

        class Struct < Vips::Object::Struct
            include InterpolateLayout

        end

        class ManagedStruct < Vips::Object::ManagedStruct
            include InterpolateLayout

        end

        def initialize name
            ptr = Vips::vips_interpolate_new name
            raise Vips::Error if ptr == nil

            super ptr
        end

    end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
vips-8.6.3.2 lib/vips/interpolate.rb
vips-8.7.0.1 lib/vips/interpolate.rb
ruby-vips-2.0.13 lib/vips/interpolate.rb
vips-8.6.3.1 lib/vips/interpolate.rb
vips-8.6.3 lib/vips/interpolate.rb
ruby-vips-2.0.12 lib/vips/interpolate.rb
ruby-vips-2.0.11 lib/vips/interpolate.rb
ruby-vips-2.0.10 lib/vips/interpolate.rb
ruby-vips-2.0.9 lib/vips/interpolate.rb
ruby-vips-2.0.8 lib/vips/interpolate.rb
ruby-vips-2.0.7 lib/vips/interpolate.rb
ruby-vips-2.0.6 lib/vips/interpolate.rb
ruby-vips-2.0.5 lib/vips/interpolate.rb
ruby-vips-2.0.4 lib/vips/interpolate.rb
ruby-vips-2.0.3 lib/vips/interpolate.rb
ruby-vips-2.0.2 lib/vips/interpolate.rb
ruby-vips-2.0.1 lib/vips/interpolate.rb
ruby-vips-2.0.0 lib/vips/interpolate.rb