Class: Vips::Interpolate

Inherits:
Object
  • Object
show all
Defined in:
lib/vips/interpolate.rb

Overview

An interpolator. One of these can be given to operations like Vips::Image#affine or Vips::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:

im = im.affine [2, 0, 0, 2],
    :interpolate => Vips::Interpolate.new(:bicubic)

Defined Under Namespace

Modules: InterpolateLayout Classes: ManagedStruct, Struct

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Interpolate

Returns a new instance of Interpolate.

Raises:



50
51
52
53
54
55
56
# File 'lib/vips/interpolate.rb', line 50

def initialize name
  name = name.to_s if name.is_a? Symbol
  pointer = Vips.vips_interpolate_new name
  raise Vips::Error if pointer.null?

  super(pointer)
end