Gjsify LogoGjsify Logo

An image. These can represent an image on disc, a memory buffer, an image in the process of being written to disc or a partially evaluated image in memory.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

argument_table: ArgumentTable
bands: number
close: boolean
constructed: boolean
description: string
filename: string
foreign_buffer: object
g_type_instance: TypeInstance
height: number
kill: boolean
local_memory: number
mode: string
nickname: string
parent_instance: Vips.Object
postclose: boolean
preclose: boolean
sizeof_header: number
static_object: boolean
width: number
xoffset: number
xres: number
yoffset: number
yres: number
$gtype: GType<Vips.Image>
name: string

Methods

  • argument_isset(name: string): boolean
  • argument_needsstring(name: string): boolean
  • autorot_remove_angle(): void
  • Remove the orientation tag on image. Also remove any exif orientation tags. You must vips_copy() the image before calling this function since it modifies metadata.

    Returns void

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • source_property: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • target_property: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transform_to: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transform_from: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • build(): number
  • colourspace_issupported(): boolean
  • Make an image which is an area of memory.

    If image is already a memory buffer, just ref and return. If it's a file on disc or a partial, allocate memory and copy the image to it.

    This operation is thread-safe, unlike vips_image_wio_input().

    If you are sure that image is not shared with another thread (perhaps you have made it yourself), use vips_image_wio_input() instead.

    See also: vips_image_wio_input().

    Returns Vips.Image

  • A convenience function to unpack to a format that we can compute with. out.coding is always #VIPS_CODING_NONE.

    This unpacks LABQ to plain LAB. Use vips_LabQ2LabS() for a bit more speed if you need it.

    See also: vips_image_encode(), vips_LabQ2Lab(), vips_rad2float().

    Returns [number, Vips.Image]

  • We often need to know what an image will decode to without actually decoding it, for example, in arg checking.

    See also: vips_image_decode().

    Returns [number, number, BandFormat]

  • disconnect(id: number): void
  • emit(sigName: "eval", progress: Vips.Progress, ...args: any[]): void
  • emit(sigName: "invalidate", ...args: any[]): void
  • emit(sigName: "minimise", ...args: any[]): void
  • emit(sigName: "posteval", progress: Vips.Progress, ...args: any[]): void
  • emit(sigName: "preeval", progress: Vips.Progress, ...args: any[]): void
  • emit(sigName: "written", ...args: any[]): void
  • emit(sigName: "notify::bands", ...args: any[]): void
  • emit(sigName: "notify::filename", ...args: any[]): void
  • emit(sigName: "notify::foreign-buffer", ...args: any[]): void
  • emit(sigName: "notify::height", ...args: any[]): void
  • emit(sigName: "notify::kill", ...args: any[]): void
  • emit(sigName: "notify::mode", ...args: any[]): void
  • emit(sigName: "notify::sizeof-header", ...args: any[]): void
  • emit(sigName: "notify::width", ...args: any[]): void
  • emit(sigName: "notify::xoffset", ...args: any[]): void
  • emit(sigName: "notify::xres", ...args: any[]): void
  • emit(sigName: "notify::yoffset", ...args: any[]): void
  • emit(sigName: "notify::yres", ...args: any[]): void
  • emit(sigName: string, ...args: any[]): void
  • A convenience function to pack to a coding. The inverse of vips_image_decode().

    See also: vips_image_decode().

    Parameters

    • coding: Coding

      coding to apply

    Returns [number, Vips.Image]

  • force_floating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • foreign_load_invalidate(): void
  • Loaders can call this on the image they are making if they see a read error from the load library. It signals "invalidate" on the load operation and will cause it to be dropped from cache.

    If we know a file will cause a read error, we don't want to cache the failing operation, we want to make sure the image will really be opened again if our caller tries again. For example, a broken file might be replaced by a working one.

    Returns void

  • free_buffer(buffer: object): void
  • Free the externally allocated buffer found in the input image. This function is intended to be used with g_signal_connect.

    Parameters

    • buffer: object

      the orignal buffer that was stolen

    Returns void

  • freeze_notify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • get(name: string): [number, any]
  • Fill value_copy with a copy of the header field. value_copy must be zeroed but uninitialised.

    This will return -1 and add a message to the error buffer if the field does not exist. Use vips_image_get_typeof() to test for the existence of a field first if you are not certain it will be there.

    For example, to read a double from an image (though of course you would use vips_image_get_double() in practice):

    |[ GValue value = { 0 }; double d;

    if (vips_image_get (image, name, &value)) return -1;

    if (G_VALUE_TYPE (&value) != G_TYPE_DOUBLE) { vips_error( "mydomain", _("field "%s" is of type %s, not double"), name, g_type_name (G_VALUE_TYPE (&value))); g_value_unset (&value); return -1; }

    d = g_value_get_double (&value); g_value_unset (&value);



    See also: vips_image_get_typeof(), vips_image_get_double().
    @param name the name to fetch

    Parameters

    • name: string

    Returns [number, any]

  • get_area(name: string): [number, object]
  • Gets data from image under the name name. A convenience function over vips_image_get(). Use vips_image_get_typeof() to test for the existence of a piece of metadata.

    See also: vips_image_set_area(), vips_image_get(), vips_image_get_typeof()

    Parameters

    • name: string

      metadata name

    Returns [number, object]

  • get_argument_priority(name: string): number
  • get_argument_to_string(name: string, arg: string): number
  • get_array_double(name: string): [number, number[]]
  • Gets out from im under the name name. The field must be of type #VIPS_TYPE_ARRAY_INT.

    Do not free out. out is valid as long as image is valid.

    Use vips_image_get_typeof() to test for the existence of a piece of metadata.

    See also: vips_image_get(), vips_image_set_image()

    Parameters

    • name: string

      metadata name

    Returns [number, number[]]

  • get_array_int(name: string): [number, number[]]
  • Gets out from im under the name name. The field must be of type #VIPS_TYPE_ARRAY_INT.

    Do not free out. out is valid as long as image is valid.

    Use vips_image_get_typeof() to test for the existence of a piece of metadata.

    See also: vips_image_get(), vips_image_set_image()

    Parameters

    • name: string

      metadata name

    Returns [number, number[]]

  • get_as_string(name: string): [number, string]
  • Returns name from image in out. This function will read any field, returning it as a printable string. You need to free the string with g_free() when you are done with it.

    This will base64-encode BLOBs, for example. Use vips_buf_appendgv() to make a string that's for humans.

    See also: vips_image_get(), vips_image_get_typeof(), vips_buf_appendgv().

    Parameters

    • name: string

      field name

    Returns [number, string]

  • get_bands(): number
  • get_blob(name: string): [number, Uint8Array]
  • Gets blob from image under the name name, optionally returns its length in length. A convenience function over vips_image_get(). Use vips_image_get_typeof() to test for the existence of a piece of metadata.

    See also: vips_image_get(), vips_image_get_typeof(), vips_blob_get(),

    Parameters

    • name: string

      metadata name

    Returns [number, Uint8Array]

  • get_data(): object
  • get_data(key?: string): object
  • get_data(...args: any[]): any
  • get_data(args_or_key?: string | any[]): any
  • Return a pointer to the image's pixel data, if possible. This can involve allocating large amounts of memory and performing a long computation. Image pixels are laid out in band-packed rows.

    Since this function modifies image, it is not threadsafe. Only call it on images which you are sure have not been shared with another thread.

    See also: vips_image_wio_input(), vips_image_copy_memory().

    Returns object

  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • Parameters

    • Rest ...args: any[]

    Returns any

  • Parameters

    • Optional args_or_key: string | any[]

    Returns any

  • get_description(): string
  • Fetch the object description. Useful for language bindings.

    object.description is only avaliable after _build(), which can be too late. This function fetches from the instance, if possible, but falls back to the class description if we are too early.

    Returns string

  • get_double(name: string): [number, number]
  • Gets out from im under the name name. The value will be transformed into a double, if possible.

    See also: vips_image_get(), vips_image_get_typeof()

    Parameters

    • name: string

      field name

    Returns [number, number]

  • get_fields(): string[]
  • Get a %NULL-terminated array listing all the metadata field names on image. Free the return result with g_strfreev().

    This is handy for language bindings. From C, it's usually more convenient to use vips_image_map().

    Returns string[]

  • get_filename(): string
  • get_height(): number
  • get_history(): string
  • This function reads the image history as a C string. The string is owned by VIPS and must not be freed.

    VIPS tracks the history of each image, that is, the sequence of operations that generated that image. Applications built on VIPS need to call vips_image_history_printf() for each action they perform, setting the command-line equivalent for the action.

    See also: vips_image_history_printf().

    Returns string

  • get_image(name: string): [number, Vips.Image]
  • Gets out from im under the name name. The field must be of type #VIPS_TYPE_IMAGE. You must unref out with g_object_unref().

    Use vips_image_get_typeof() to test for the existence of a piece of metadata.

    See also: vips_image_get(), vips_image_set_image()

    Parameters

    • name: string

      metadata name

    Returns [number, Vips.Image]

  • get_int(name: string): [number, number]
  • Gets out from im under the name name. The value will be transformed into an int, if possible.

    See also: vips_image_get(), vips_image_get_typeof()

    Parameters

    • name: string

      field name

    Returns [number, number]

  • get_mode(): string
  • Image modes are things like "t", meaning a memory buffer, and "p" meaning a delayed computation.

    Returns string

  • get_n_pages(): number
  • Fetch and sanity-check #VIPS_META_N_PAGES. Default to 1 if not present or crazy.

    This is the number of pages in the image file, not the number of pages that have been loaded into image.

    Returns number

  • get_n_subifds(): number
  • get_offset(): number
  • get_orientation(): number
  • Fetch and sanity-check #VIPS_META_ORIENTATION. Default to 1 (no rotate, no flip) if not present or crazy.

    Returns number

  • get_orientation_swap(): boolean
  • get_page_height(): number
  • Multi-page images can have a page height. Fetch it, and sanity check it. If page-height is not set, it defaults to the image height.

    Returns number

  • get_property(property_name?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional property_name: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • get_qdata(quark: number): object
  • get_scale(): number
  • get_string(name: string): [number, string]
  • Gets out from im under the name name. The field must be of type G_TYPE_STRING, VIPS_TYPE_REF_STRING.

    Do not free out.

    Use vips_image_get_as_string() to fetch any field as a string.

    See also: vips_image_get(), vips_image_get_typeof()

    Parameters

    • name: string

      field name

    Returns [number, string]

  • get_typeof(name: string): GType<unknown>
  • Read the %GType for a header field. Returns zero if there is no field of that name.

    See also: vips_image_get().

    Parameters

    • name: string

      the name to search for

    Returns GType<unknown>

  • get_width(): number
  • get_xoffset(): number
  • get_xres(): number
  • get_yoffset(): number
  • get_yres(): number
  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • Return the #VipsBandFormat for an image, guessing a sane value if the set value looks crazy.

    For example, for a float image tagged as rgb16, we'd return ushort.

    Returns BandFormat

  • hasalpha(): boolean
  • Look at an image's interpretation and see if it has extra alpha bands. For example, a 4-band #VIPS_INTERPRETATION_sRGB would, but a six-band #VIPS_INTERPRETATION_MULTIBAND would not.

    Return %TRUE if image has an alpha channel.

    Returns boolean

  • history_args(name: string, argv: string[]): number
  • Formats the name/argv as a single string and calls vips_image_history_printf(). A convenience function for command-line prorams.

    See also: vips_image_get_history().

    Parameters

    • name: string

      program name

    • argv: string[]

      program arguments

    Returns number

  • icc_ac2rc(profile_filename: string): [number, Vips.Image]
  • Transform an image from absolute to relative colorimetry using the MediaWhitePoint stored in the ICC profile.

    See also: vips_icc_transform(), vips_icc_import().

    Parameters

    • profile_filename: string

      use this profile

    Returns [number, Vips.Image]

  • init_fields(xsize: number, ysize: number, bands: number, format: BandFormat, coding: Coding, interpretation: Interpretation, xres: number, yres: number): void
  • A convenience function to set the header fields after creating an image. Normally you copy the fields from your input images with vips_image_pipelinev() and then make any adjustments you need, but if you are creating an image from scratch, for example vips_black() or vips_jpegload(), you do need to set all the fields yourself.

    See also: vips_image_pipelinev().

    Parameters

    • xsize: number

      image width

    • ysize: number

      image height

    • bands: number

      image bands

    • format: BandFormat

      band format

    • coding: Coding

      image coding

    • interpretation: Interpretation

      image type

    • xres: number

      horizontal resolution, pixels per millimetre

    • yres: number

      vertical resolution, pixels per millimetre

    Returns void

  • inplace(): number
  • Gets image ready for an in-place operation, such as vips_draw_circle(). After calling this function you can both read and write the image with VIPS_IMAGE_ADDR().

    This method is called for you by the base class of the draw operations, there's no need to call it yourself.

    Since this function modifies image, it is not thread-safe. Only call it on images which you are sure have not been shared with another thread. All in-place operations are inherently not thread-safe, so you need to take great care in any case.

    See also: vips_draw_circle(), vips_image_wio_input().

    Returns number

  • invalidate_all(): void
  • Invalidate all pixel caches on image and any downstream images, that is, images which depend on this image. Additionally, all operations which depend upon this image are dropped from the VIPS operation cache.

    You should call this function after destructively modifying an image with something like vips_draw_circle().

    The #VipsImage::invalidate signal is emitted for all invalidated images.

    See also: vips_region_invalidate().

    Returns void

  • isMSBfirst(): boolean
  • Return %TRUE if image is in most-significant- byte first form. This is the byte order used on the SPARC architecture and others.

    Returns boolean

  • is_floating(): boolean
  • is_sequential(): boolean
  • TRUE if any of the images upstream from image were opened in sequential mode. Some operations change behaviour slightly in sequential mode to optimize memory behaviour.

    Returns boolean

  • isfile(): boolean
  • iskilled(): boolean
  • If image has been killed (see vips_image_set_kill()), set an error message, clear the #VipsImage.kill flag and return %TRUE. Otherwise return %FALSE.

    Handy for loops which need to run sets of threads which can fail.

    See also: vips_image_set_kill().

    Returns boolean

  • ispartial(): boolean
  • map(a: object): object
  • This function calls fn for every header field, including every item of metadata.

    Like all _map functions, the user function should return %NULL to continue iteration, or a non-%NULL pointer to indicate early termination.

    See also: vips_image_get_typeof(), vips_image_get().

    Parameters

    • a: object

      user data for function

    Returns object

  • minimise_all(): void
  • Minimise memory use on this image and any upstream images, that is, images which this image depends upon. This function is called automatically at the end of a computation, but it might be useful to call at other times.

    The #VipsImage::minimise signal is emitted for all minimised images.

    Returns void

  • notify(property_name: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • property_name: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • pio_input(): number
  • Check that an image is readable with vips_region_prepare() and friends. If it isn't, try to transform the image so that vips_region_prepare() can work.

    See also: vips_image_pio_output(), vips_region_prepare().

    Returns number

  • pio_output(): number
  • Check that an image is writeable with vips_image_generate(). If it isn't, try to transform the image so that vips_image_generate() can work.

    See also: vips_image_pio_input().

    Returns number

  • print_dump(): void
  • print_field(name: string): void
  • Prints field name to stdout as ASCII. Handy for debugging.

    Parameters

    • name: string

      field name

    Returns void

  • print_name(): void
  • print_summary(): void
  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • remove(name: string): boolean
  • Find and remove an item of metadata. Return %FALSE if no metadata of that name was found.

    See also: vips_image_set(), vips_image_get_typeof().

    Parameters

    • name: string

      the name to search for

    Returns boolean

  • reorder_margin_hint(margin: number): void
  • vips_reorder_margin_hint() sets a hint that image contains a margin, that is, that each vips_region_prepare() on image will request a slightly larger region from it's inputs. A good value for margin is (width * height) for the window the operation uses.

    This information is used by vips_image_prepare_many() to attempt to reorder computations to minimise recomputation.

    See also: vips_image_prepare_many().

    Parameters

    • margin: number

      the size of the margin this operation has added

    Returns void

  • vips_reorder_prepare_many() runs vips_region_prepare() on each region in regions, requesting the pixels in r.

    It tries to request the regions in the order which will cause least recomputation. This can give a large speedup, in some cases.

    See also: vips_region_prepare(), vips_reorder_margin_hint().

    Parameters

    • regions: Vips.Region[]

      the set of regions to prepare

    • r: Vips.Rect

      the #VipsRect to prepare on each region

    Returns number

  • rewind(): void
  • run_dispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

  • sanity(): boolean
  • set(name: string, value: any): void
  • Set a piece of metadata on image. Any old metadata with that name is destroyed. The %GValue is copied into the image, so you need to unset the value when you're done with it.

    For example, to set an integer on an image (though you would use the convenience function vips_image_set_int() in practice), you would do:

    |[ GValue value = { 0 };

    g_value_init (&value, G_TYPE_INT); g_value_set_int (&value, 42); vips_image_set (image, name, &value); g_value_unset (&value);



    See also: vips_image_get().
    @param name the name to give the metadata
    @param value the %GValue to copy into the image

    Parameters

    • name: string
    • value: any

    Returns void

  • Attaches data as a metadata item on image under the name name. When VIPS no longer needs the metadata, it will be freed with free_fn.

    See also: vips_image_get_double(), vips_image_set()

    Parameters

    • name: string

      metadata name

    • free_fn: CallbackFn

      free function for data

    Returns void

  • set_argument_from_string(name: string, value: string): number
  • set_array_double(name: string, array: number[]): void
  • Attaches array as a metadata item on image as name. A convenience function over vips_image_set().

    See also: vips_image_get_image(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • array: number[]

      array of doubles

    Returns void

  • set_array_int(name: string, array: number[]): void
  • Attaches array as a metadata item on image as name. A convenience function over vips_image_set().

    See also: vips_image_get_image(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • array: number[]

      array of ints

    Returns void

  • set_blob(name: string, free_fn: CallbackFn, data: Uint8Array): void
  • Attaches blob as a metadata item on image under the name name. A convenience function over vips_image_set() using a vips_blob.

    See also: vips_image_get_blob(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • free_fn: CallbackFn

      free function for data

    • data: Uint8Array

      pointer to area of memory

    Returns void

  • set_blob_copy(name: string, data: Uint8Array): void
  • Attaches blob as a metadata item on image under the name name, taking a copy of the memory area. A convenience function over vips_image_set_blob().

    See also: vips_image_get_blob(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • data: Uint8Array

      pointer to area of memory

    Returns void

  • set_data(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • set_delete_on_close(delete_on_close: boolean): void
  • Sets the delete_on_close flag for the image. If this flag is set, when image is finalized, the filename held in image->filename at the time of this call is deleted.

    This function is clearly extremely dangerous, use with great caution.

    See also: vips_image_new_temp_file().

    Parameters

    • delete_on_close: boolean

      format of file

    Returns void

  • set_double(name: string, d: number): void
  • Attaches d as a metadata item on image as name. A convenience function over vips_image_set().

    See also: vips_image_get_double(), vips_image_set()

    Parameters

    • name: string

      metadata name

    • d: number

      metadata value

    Returns void

  • set_from_string(string: string): number
  • Set object arguments from a string. The string can be something like "a=12", or "a = 12, b = 13", or "fred". The string can optionally be enclosed in brackets.

    You'd typically use this between creating the object and building it.

    See also: vips_object_set(), vips_object_build(), vips_cache_operation_buildp().

    Parameters

    • string: string

      arguments as a string

    Returns number

  • set_image(name: string, im: Vips.Image): void
  • Attaches im as a metadata item on image as name. A convenience function over vips_image_set().

    See also: vips_image_get_image(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • im: Vips.Image

      metadata value

    Returns void

  • set_int(name: string, i: number): void
  • Attaches i as a metadata item on image under the name name. A convenience function over vips_image_set().

    See also: vips_image_get_int(), vips_image_set()

    Parameters

    • name: string

      metadata name

    • i: number

      metadata value

    Returns void

  • set_kill(kill: boolean): void
  • Set the #VipsImage.kill flag on an image. Handy for stopping sets of threads.

    See also: vips_image_iskilled().

    Parameters

    • kill: boolean

      the kill state

    Returns void

  • set_progress(progress: boolean): void
  • vips signals evaluation progress via the #VipsImage::preeval, #VipsImage::eval and #VipsImage::posteval signals. Progress is signalled on the most-downstream image for which vips_image_set_progress() was called.

    Parameters

    • progress: boolean

      turn progress reporting on or off

    Returns void

  • set_property(property_name: string, value?: any): void
  • set_required(value: string): number
  • set_static(static_object: boolean): void
  • set_string(name: string, str: string): void
  • Attaches str as a metadata item on image as name. A convenience function over vips_image_set() using #VIPS_TYPE_REF_STRING.

    See also: vips_image_get_double(), vips_image_set().

    Parameters

    • name: string

      metadata name

    • str: string

      metadata value

    Returns void

  • steal_data(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • steal_qdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thaw_notify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • unref_outputs(): void
  • Unref all assigned output objects. Useful for language bindings.

    After an object is built, all output args are owned by the caller. If something goes wrong before then, we have to unref the outputs that have been made so far. This function can also be useful for callers when they've finished processing outputs themselves.

    See also: vips_cache_operation_build().

    Returns void

  • vfunc_build(): number
  • vfunc_close(): void
  • vfunc_constructed(): void
  • vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: ParamSpec): void
  • vfunc_dispose(): void
  • vfunc_finalize(): void
  • vfunc_get_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • vfunc_invalidate(data: object): void
  • vfunc_minimise(data: object): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    virtual

    Parameters

    Returns void

  • vfunc_output_to_arg(string: string): number
  • vfunc_postbuild(data: object): number
  • vfunc_postclose(): void
  • vfunc_preclose(): void
  • vfunc_rewind(): void
  • vfunc_set_property(property_id: number, value?: any, pspec?: ParamSpec): void
  • vfunc_written(result: number, data: object): void
  • watch_closure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • wio_input(): number
  • Check that an image is readable via the VIPS_IMAGE_ADDR() macro, that is, that the entire image is in memory and all pixels can be read with VIPS_IMAGE_ADDR(). If it isn't, try to transform it so that VIPS_IMAGE_ADDR() can work.

    Since this function modifies image, it is not thread-safe. Only call it on images which you are sure have not been shared with another thread. If the image might have been shared, use the less efficient vips_image_copy_memory() instead.

    See also: vips_image_copy_memory(), vips_image_pio_input(), vips_image_inplace(), VIPS_IMAGE_ADDR().

    Returns number

  • Write image to out. Use vips_image_new() and friends to create the #VipsImage you want to write to.

    See also: vips_image_new(), vips_copy(), vips_image_write_to_file().

    Returns [number, Vips.Image]

  • write_line(ypos: number, linebuffer: number): number
  • Write a line of pixels to an image. This function must be called repeatedly with ypos increasing from 0 to #VipsImage::height . linebuffer must be VIPS_IMAGE_SIZEOF_LINE() bytes long.

    See also: vips_image_generate().

    Parameters

    • ypos: number

      vertical position of scan-line to write

    • linebuffer: number

      scanline of pixels

    Returns number

  • write_prepare(): number
  • Call this after setting header fields (width, height, and so on) to allocate resources ready for writing.

    Normally this function is called for you by vips_image_generate() or vips_image_write_line(). You will need to call it yourself if you plan to write directly to the ->data member of a memory image.

    Returns number

  • write_to_memory(): Uint8Array
  • Writes in to memory as a simple, unformatted C-style array.

    The caller is responsible for freeing this memory with g_free().

    See also: vips_image_write_to_buffer().

    Returns Uint8Array

  • compat_control(what: number, data: object): number
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • property_name: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • g_iface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • A renamed vips_image_new_memory() ... Some gobject binding systems do not like more than one _new() method.

    See also: vips_image_new_memory().

    Returns Vips.Image

  • vips_image_new() creates a new, empty #VipsImage. If you write to one of these images, vips will just attach some callbacks, no pixels will be generated.

    Write pixels to an image with vips_image_generate() or vips_image_write_line(). Write a whole image to another image with vips_image_write().

    Returns Vips.Image

  • new_from_file_RW(filename: string): Vips.Image
  • Opens the named file for simultaneous reading and writing. This will only work for VIPS files in a format native to your machine. It is only for paintbox-type applications.

    See also: vips_draw_circle().

    Parameters

    • filename: string

      filename to open

    Returns Vips.Image

  • new_from_file_raw(filename: string, xsize: number, ysize: number, bands: number, offset: number): Vips.Image
  • This function maps the named file and returns a #VipsImage you can use to read it.

    It returns an 8-bit image with bands bands. If the image is not 8-bit, use vips_copy() to transform the descriptor after loading it.

    See also: vips_copy(), vips_rawload(), vips_image_new_from_file().

    Parameters

    • filename: string

      filename to open

    • xsize: number

      image width

    • ysize: number

      image height

    • bands: number

      image bands (or bytes per pixel)

    • offset: number

      bytes to skip at start of file

    Returns Vips.Image

  • Creates a new image with width, height, format, interpretation, resolution and offset taken from image, but with number of bands taken from n and the value of each band element set from c.

    See also: vips_image_new_from_image1()

    Parameters

    • image: Vips.Image

      image to copy

    • c: number[]

      array of constants

    Returns Vips.Image

  • Creates a new image with width, height, format, interpretation, resolution and offset taken from image, but with one band and each pixel having the value c.

    See also: vips_image_new_from_image()

    Parameters

    • image: Vips.Image

      image to copy

    • c: number

      constants

    Returns Vips.Image

  • new_from_memory(data: Uint8Array, width: number, height: number, bands: number, format: BandFormat): Vips.Image
  • This function wraps a #VipsImage around a memory area. The memory area must be a simple array, for example RGBRGBRGB, left-to-right, top-to-bottom. Use vips_image_new_from_buffer() to load an area of memory containing an image in a format.

    VIPS does not take responsibility for the area of memory, it's up to you to make sure it's freed when the image is closed. See for example #VipsObject::close.

    Because VIPS is "borrowing" data from the caller, this function is extremely dangerous. Unless you are very careful, you will get crashes or memory corruption. Use vips_image_new_from_memory_copy() instead if you are at all unsure.

    Use vips_copy() to set other image properties.

    See also: vips_image_new(), vips_image_write_to_memory(), vips_image_new_from_memory_copy().

    Parameters

    • data: Uint8Array

      start of memory area

    • width: number

      image width

    • height: number

      image height

    • bands: number

      image bands (or bytes per pixel)

    • format: BandFormat

      image format

    Returns Vips.Image

  • new_from_memory_copy(data: Uint8Array, width: number, height: number, bands: number, format: BandFormat): Vips.Image
  • Like vips_image_new_from_memory(), but VIPS will make a copy of the memory area. This means more memory use and an extra copy operation, but is much simpler and safer.

    See also: vips_image_new_from_memory().

    Parameters

    • data: Uint8Array

      start of memory area

    • width: number

      image width

    • height: number

      image height

    • bands: number

      image bands (or bytes per pixel)

    • format: BandFormat

      image format

    Returns Vips.Image

  • new_matrix(width: number, height: number): Vips.Image
  • This convenience function makes an image which is a matrix: a one-band #VIPS_FORMAT_DOUBLE image held in memory.

    Use VIPS_IMAGE_ADDR(), or VIPS_MATRIX() to address pixels in the image.

    Use vips_image_set_double() to set "scale" and "offset", if required.

    See also: vips_image_new_matrixv()

    Parameters

    • width: number

      image width

    • height: number

      image height

    Returns Vips.Image

  • new_matrix_from_array(width: number, height: number, array: number[]): Vips.Image
  • A binding-friendly version of vips_image_new_matrixv().

    Parameters

    • width: number

      image width

    • height: number

      image height

    • array: number[]

      array of elements

    Returns Vips.Image

  • Make a #VipsImage which, when written to, will create a temporary file on disc. The file will be automatically deleted when the image is destroyed. format is something like "%s.v" for a vips file.

    The file is created in the temporary directory. This is set with the environment variable TMPDIR. If this is not set, then on Unix systems, vips will default to /tmp. On Windows, vips uses GetTempPath() to find the temporary directory.

    See also: vips_image_new().

    Parameters

    • format: string

      format of file

    Returns Vips.Image

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • object_type: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

  • print_all(): void
  • sanity_all(): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method