module

Vips

Crystal equivalent of the subset of the ruby-vips gem that image_processing relies on: libvips initialization, GType helpers, enum translation and loader/saver lookup.

Constants

BLOB_TYPE = begin init! gtype = LibVips.g_type_from_name("VipsBlob") if gtype == 0 raise(Error.new("unknown type: VipsBlob")) end gtype end

GType of VipsBlob (same as ruby-vips' Vips::BLOB_TYPE). The type is only registered once libvips is initialized, so resolve it lazily on first access (Crystal constants with runtime initializers are deferred).

G_TYPE_BOOLEAN = 20_u64
G_TYPE_BOXED = 72_u64
G_TYPE_CHAR = 12_u64
G_TYPE_DOUBLE = 60_u64
G_TYPE_ENUM = 48_u64
G_TYPE_FLAGS = 52_u64
G_TYPE_FLOAT = 56_u64
G_TYPE_INT = 24_u64
G_TYPE_INT64 = 40_u64
G_TYPE_INTERFACE = 8_u64
G_TYPE_INVALID = 0_u64

Fundamental GType ids (gtype.h, ABI-stable).

G_TYPE_LONG = 32_u64
G_TYPE_NONE = 4_u64
G_TYPE_OBJECT = 80_u64
G_TYPE_PARAM = 76_u64
G_TYPE_POINTER = 68_u64
G_TYPE_STRING = 64_u64
G_TYPE_UCHAR = 16_u64
G_TYPE_UINT = 28_u64
G_TYPE_UINT64 = 44_u64
G_TYPE_ULONG = 36_u64
G_TYPE_VARIANT = 84_u64
MAX_COORD = 10000000

Coordinate value that means "unlimited" for thumbnail dimensions.

Class methods

array_double_type
Source
array_image_type
Source
array_int_type
Source
at_least_libvips?(major : Int32, minor : Int32) : Bool
Source
blob_type
Source
enum_nick(gtype : UInt64, value : Int32) : String

Translates an enum integer back into its nickname.

Source
enum_value(gtype : UInt64, value : Value) : Int32

Translates an enum member given as Symbol/String into its integer value.

Source
flags_value(gtype : UInt64, value : Value) : Int32

Translates a flags member given as Symbol/String into its integer value.

Source
foreign_find_load(path : String) : String | Nil
Source
foreign_find_save(path : String) : String | Nil
Source
image_type
Source
init!
Source
kwargs_to_hash(kwargs : NamedTuple) : Hash(String, Value)
Source
ref_string_type
Source
to_f(value : Value) : Float64
Source
to_i(value : Value) : Int32
Source
type_from_name(name : String) : UInt64
Source
type_name(gtype : UInt64) : String
Source
version
Source

Nested types