Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ArgumentTable: HashTable
Pel: number

Variables

ARGUMENT_OPTIONAL_INPUT: number
ARGUMENT_OPTIONAL_OUTPUT: number
ARGUMENT_REQUIRED_INPUT: number
ARGUMENT_REQUIRED_OUTPUT: number
A_X0: number

Areas under curves for illuminant A (2856K), 2 degree observer.

A_Y0: number
A_Z0: number
B_X0: number

Areas under curves for illuminant B (4874K), 2 degree observer.

B_Y0: number
B_Z0: number
CONFIG: string
C_X0: number

Areas under curves for illuminant C (6774K), 2 degree observer.

C_Y0: number
C_Z0: number
D3250_X0: number

Areas under curves for black body at 3250K, 2 degree observer.

D3250_Y0: number
D3250_Z0: number
D50_X0: number

Areas under curves for D50, 2 degree observer.

D50_Y0: number
D50_Z0: number
D55_X0: number

Areas under curves for D55, 2 degree observer.

D55_Y0: number
D55_Z0: number
D65_X0: number

Areas under curves for D65, 2 degree observer.

D65_Y0: number
D65_Z0: number
D75_X0: number

Areas under curves for D75, 2 degree observer.

D75_Y0: number
D75_Z0: number
D93_X0: number

Areas under curves for D93, 2 degree observer.

D93_Y0: number
D93_Z0: number
ENABLE_DEPRECATED: number
EXEEXT: string
E_X0: number

Areas under curves for equal energy illuminant E.

E_Y0: number
E_Z0: number
INTERPOLATE_SCALE: number

#VIPS_INTERPOLATE_SHIFT as a multiplicative constant.

INTERPOLATE_SHIFT: number

Many of the vips interpolators use fixed-point arithmetic for value calcualtion. This is how many bits of precision they use.

LIBRARY_AGE: number
LIBRARY_CURRENT: number
LIBRARY_REVISION: number
MAGIC_INTEL: number

The first four bytes of a VIPS file in Intel byte ordering.

MAGIC_SPARC: number

The first four bytes of a VIPS file in SPARC byte ordering.

MAJOR_VERSION: number
MAX_COORD: number
META_EXIF_NAME: string

The name that JPEG read and write operations use for the image's EXIF data.

META_ICC_NAME: string

The name we use to attach an ICC profile. The file read and write operations for TIFF, JPEG, PNG and others use this item of metadata to attach and save ICC profiles. The profile is updated by the vips_icc_transform() operations.

META_IMAGEDESCRIPTION: string

The IMAGEDESCRIPTION tag. Often has useful metadata.

META_IPTC_NAME: string

The name that read and write operations use for the image's IPTC data.

META_LOADER: string

Record the name of the original loader here. Handy for hinting file formats and for debugging.

META_N_PAGES: string

If set, the number of pages in the original file.

META_N_SUBIFDS: string

If set, the number of subifds in the first page of the file.

META_ORIENTATION: string

The orientation tag for this image. An int from 1 - 8 using the standard exif/tiff meanings.

  • 1 - The 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side.
  • 2 - The 0th row represents the visual top of the image, and the 0th column represents the visual right-hand side.
  • 3 - The 0th row represents the visual bottom of the image, and the 0th column represents the visual right-hand side.
  • 4 - The 0th row represents the visual bottom of the image, and the 0th column represents the visual left-hand side.
  • 5 - The 0th row represents the visual left-hand side of the image, and the 0th column represents the visual top.
  • 6 - The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual top.
  • 7 - The 0th row represents the visual right-hand side of the image, and the 0th column represents the visual bottom.
  • 8 - The 0th row represents the visual left-hand side of the image, and the 0th column represents the visual bottom.
META_PAGE_HEIGHT: string

If set, the height of each page when this image was loaded. If you save an image with "page-height" set to a format that supports multiple pages, such as tiff, the image will be saved as a series of pages.

META_PHOTOSHOP_NAME: string

The name that TIFF read and write operations use for the image's TIFFTAG_PHOTOSHOP data.

META_RESOLUTION_UNIT: string

The JPEG and TIFF read and write operations use this to record the file's preferred unit for resolution.

META_SEQUENTIAL: string

Images loaded via vips_sequential() have this int field defined. Some operations (eg. vips_shrinkv()) add extra caches if they see it on their input.

META_XMP_NAME: string

The name that read and write operations use for the image's XMP data.

MICRO_VERSION: number
MINOR_VERSION: number
SONAME: string

The name of the shared object containing the vips library, for example "libvips.so.42", or "libvips-42.dll".

TRANSFORM_SCALE: number

#VIPS_TRANSFORM_SHIFT as a multiplicative constant.

TRANSFORM_SHIFT: number

Many of the vips interpolators use fixed-point arithmetic for coordinate calculation. This is how many bits of precision they use.

VERSION: string
VERSION_STRING: string

Functions

  • area_free_cb(mem: object, area: Area): number
  • band_format_iscomplex(format: BandFormat): boolean
  • Like vips_blob_new(), but take a copy of the data. Useful for bindings which struggle with callbacks.

    See also: vips_blob_new().

    Parameters

    • data: Uint8Array

      data to store

    Returns Vips.Blob

  • cache_drop_all(): void
  • Drop the whole operation cache, handy for leak tracking. Also called automatically on vips_shutdown().

    Returns void

  • cache_get_max(): number
  • cache_get_max_files(): number
  • Get the maximum number of tracked files we allow before we start dropping cached operations. See vips_tracked_get_files().

    libvips only tracks file descriptors it allocates, it can't track ones allocated by external libraries. If you use an operation like vips_magickload(), most of the descriptors it uses won't be included.

    See also: vips_tracked_get_files().

    Returns number

  • cache_get_max_mem(): number
  • Get the maximum amount of tracked memory we allow before we start dropping cached operations. See vips_tracked_get_mem().

    See also: vips_tracked_get_mem().

    Returns number

  • cache_get_size(): number
  • A binding-friendly version of vips_cache_operation_buildp().

    After calling this, operation has the same ref count as when it went in, and the result must be freed with vips_object_unref_outputs() and g_object_unref().

    Parameters

    Returns Vips.Operation

  • cache_print(): void
  • cache_set_dump(dump: boolean): void
  • Handy for debugging. Print the operation cache to stdout just before exit.

    See also: vips_cache_set_trace().

    Parameters

    • dump: boolean

      if %TRUE, dump the operation cache on exit

    Returns void

  • cache_set_max(max: number): void
  • Set the maximum number of operations we keep in cache.

    Parameters

    • max: number

      maximum number of operation to cache

    Returns void

  • cache_set_max_files(max_files: number): void
  • Set the maximum number of tracked files we allow before we start dropping cached operations. See vips_tracked_get_files().

    See also: vips_tracked_get_files().

    Parameters

    • max_files: number

      max open files we allow

    Returns void

  • cache_set_max_mem(max_mem: number): void
  • Set the maximum amount of tracked memory we allow before we start dropping cached operations. See vips_tracked_get_mem().

    libvips only tracks memory it allocates, it can't track memory allocated by external libraries. If you use an operation like vips_magickload(), most of the memory it uses won't be included.

    See also: vips_tracked_get_mem().

    Parameters

    • max_mem: number

      maximum amount of tracked memory we use

    Returns void

  • cache_set_trace(trace: boolean): void
  • Handy for debugging. Print operation cache actions to stdout as we run.

    You can set the environment variable VIPS_TRACE to turn this option on, or use the command-line flag --vips-cache-trace.

    See also: vips_cache_set_dump().

    Parameters

    • trace: boolean

      if %TRUE, trace the operation cache

    Returns void

  • call_argv(operation: Vips.Operation, argc: number, argv: string): number
  • check_8or16(domain: string, im: Vips.Image): number
  • Check that the image is 8 or 16-bit integer, signed or unsigned. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_bandno(domain: string, im: Vips.Image, bandno: number): number
  • bandno should be a valid band number (ie. 0 to im->Bands - 1), or can be -1, meaning all bands. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • bandno: number

      band number

    Returns number

  • check_bands(domain: string, im: Vips.Image, bands: number): number
  • Check that the image has bands bands. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • bands: number

      must have this many bands

    Returns number

  • check_bands_1or3(domain: string, im: Vips.Image): number
  • Check that the image has either one or three bands. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • Check that the images have the same number of bands, or that one of the images has just 1 band. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im1: Vips.Image

      first image to check

    • im2: Vips.Image

      second image to check

    Returns number

  • check_bands_1orn_unary(domain: string, im: Vips.Image, n: number): number
  • Check that an image has 1 or n bands. Handy for unary operations, cf. vips_check_bands_1orn(). If not, set an error message and return non-zero.

    See also: vips_check_bands_1orn().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • n: number

      number of bands, or 1

    Returns number

  • check_bands_atleast(domain: string, im: Vips.Image, bands: number): number
  • Check that the image has at least bands bands. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • bands: number

      at least this many bands

    Returns number

  • Check that the images have the same number of bands. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im1: Vips.Image

      first image to check

    • im2: Vips.Image

      second image to check

    Returns number

  • Check that the image has the required coding. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • coding: Coding

      required coding

    Returns number

  • check_coding_known(domain: string, im: Vips.Image): number
  • Check that the image is uncoded, LABQ coded or RAD coded. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_coding_noneorlabq(domain: string, im: Vips.Image): number
  • Check that the image is uncoded or LABQ coded. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • Check that the images have the same coding. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im1: Vips.Image

      first image to check

    • im2: Vips.Image

      second image to check

    Returns number

  • check_complex(domain: string, im: Vips.Image): number
  • Check that the image is complex. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • Check that the image has the specified format. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    • fmt: BandFormat

      format to test for

    Returns number

  • Check that the images have the same format. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im1: Vips.Image

      first image to check

    • im2: Vips.Image

      second image to check

    Returns number

  • check_hist(domain: string, im: Vips.Image): number
  • Histogram images must have width or height 1, and must not have more than 65536 elements. Return 0 if the image will pass as a histogram, or -1 and set an error message otherwise.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_int(domain: string, im: Vips.Image): number
  • Check that the image is in one of the integer formats. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • Matrix images must have width and height less than 100000 and have 1 band.

    Return 0 if the image will pass as a matrix, or -1 and set an error message otherwise.

    out is set to be im cast to double and stored in memory. Use VIPS_MATRIX() to address values in out.

    You must unref out when you are done with it.

    See also: VIPS_MATRIX(), vips_object_local()

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns [number, Vips.Image]

  • check_mono(domain: string, im: Vips.Image): number
  • Check that the image has exactly one band. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_noncomplex(domain: string, im: Vips.Image): number
  • Check that the image is not complex. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_oddsquare(domain: string, im: Vips.Image): number
  • Check that the image is square and that the sides are odd. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_precision_intfloat(domain: string, precision: Precision): number
  • Check that prec image is either float or int. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • precision: Precision

      precision to check

    Returns number

  • check_separable(domain: string, im: Vips.Image): number
  • Separable matrix images must have width or height 1. Return 0 if the image will pass, or -1 and set an error message otherwise.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • Check that the images have the same size. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im1: Vips.Image

      first image to check

    • im2: Vips.Image

      second image to check

    Returns number

  • check_twocomponents(domain: string, im: Vips.Image): number
  • Check that the image is has two "components", ie. is a one-band complex or a two-band non-complex. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_u8or16(domain: string, im: Vips.Image): number
  • Check that the image is 8 or 16-bit unsigned integer. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_u8or16orf(domain: string, im: Vips.Image): number
  • Check that the image is 8 or 16-bit unsigned integer, or float. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_uint(domain: string, im: Vips.Image): number
  • Check that the image is in one of the unsigned integer formats. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_uintorf(domain: string, im: Vips.Image): number
  • Check that the image is unsigned int or float. Otherwise set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_uncoded(domain: string, im: Vips.Image): number
  • Check that the image is not coded. If not, set an error message and return non-zero.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • im: Vips.Image

      image to check

    Returns number

  • check_vector(domain: string, n: number, im: Vips.Image): number
  • Operations with a vector constant need a 1-element vector, or a vector with the same number of elements as there are bands in the image, or a 1-band image and a many-element vector.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • n: number

      number of elements in vector

    • im: Vips.Image

      image to check against

    Returns number

  • check_vector_length(domain: string, n: number, len: number): number
  • Check that n == len.

    See also: vips_error().

    Parameters

    • domain: string

      the originating domain for the error message

    • n: number

      number of elements in vector

    • len: number

      number of elements vector should have

    Returns number

  • Search below basename, return the first class whose name or nickname matches.

    See also: vips_type_find()

    Parameters

    • basename: string

      name of base class

    • nickname: string

      search for a class with this nickname

    Returns Vips.ObjectClass

  • col_C2Ccmc(C: number): number
  • col_Ccmc2C(Ccmc: number): number
  • Calculate C from Ccmc using a table. Call vips_col_make_tables_CMC() at least once before using this function.

    Parameters

    • Ccmc: number

      Ccmc

    Returns number

  • col_Ch2ab(C: number, h: number, a: number, b: number): void
  • Calculate ab from Ch, h in degrees.

    Parameters

    • C: number

      Chroma

    • h: number

      Hue angle (degrees)

    • a: number

      return CIE a* value

    • b: number

      return CIE b* value

    Returns void

  • col_Ch2hcmc(C: number, h: number): number
  • col_Chcmc2h(C: number, hcmc: number): number
  • Calculate h from C and hcmc, using a table. Call vips_col_make_tables_CMC() at least once before using this function.

    Parameters

    • C: number

      Chroma

    • hcmc: number

      Hue cmc (degrees)

    Returns number

  • col_L2Lcmc(L: number): number
  • col_Lab2XYZ(L: number, a: number, b: number): [number, number, number]
  • Calculate XYZ from Lab, D65.

    See also: vips_Lab2XYZ().

    Parameters

    • L: number

      Input CIE Lab value

    • a: number

      Input CIE Lab value

    • b: number

      Input CIE Lab value

    Returns [number, number, number]

  • col_Lcmc2L(Lcmc: number): number
  • Calculate L from Lcmc using a table. Call vips_col_make_tables_CMC() at least once before using this function.

    Parameters

    • Lcmc: number

      L cmc

    Returns number

  • col_XYZ2Lab(X: number, Y: number, Z: number): [number, number, number]
  • Calculate XYZ from Lab, D65.

    See also: vips_XYZ2Lab().

    Parameters

    • X: number

      Input CIE XYZ colour

    • Y: number

      Input CIE XYZ colour

    • Z: number

      Input CIE XYZ colour

    Returns [number, number, number]

  • col_XYZ2scRGB(X: number, Y: number, Z: number): [number, number, number, number]
  • Turn XYZ into scRGB.

    See also: vips_XYZ2scRGB().

    Parameters

    • X: number

      Input XYZ value

    • Y: number

      Input XYZ value

    • Z: number

      Input XYZ value

    Returns [number, number, number, number]

  • col_ab2Ch(a: number, b: number, C: number, h: number): void
  • col_ab2h(a: number, b: number): number
  • col_dE00(L1: number, a1: number, b1: number, L2: number, a2: number, b2: number): number
  • CIEDE2000, from:

    Luo, Cui, Rigg, "The Development of the CIE 2000 Colour-Difference Formula: CIEDE2000", COLOR research and application, pp 340

    Parameters

    • L1: number

      Input coordinate 1

    • a1: number

      Input coordinate 1

    • b1: number

      Input coordinate 1

    • L2: number

      Input coordinate 2

    • a2: number

      Input coordinate 2

    • b2: number

      Input coordinate 2

    Returns number

  • col_make_tables_CMC(): void
  • col_sRGB2scRGB_16(r: number, g: number, b: number, R: number, G: number, B: number): number
  • col_sRGB2scRGB_16_noclip(r: number, g: number, b: number, R: number, G: number, B: number): number
  • col_sRGB2scRGB_8(r: number, g: number, b: number, R: number, G: number, B: number): number
  • col_sRGB2scRGB_8_noclip(r: number, g: number, b: number, R: number, G: number, B: number): number
  • col_scRGB2BW_16(R: number, G: number, B: number, g: number, og: number): number
  • col_scRGB2BW_8(R: number, G: number, B: number, g: number, og: number): number
  • col_scRGB2XYZ(R: number, G: number, B: number): [number, number, number, number]
  • Turn scRGB into XYZ.

    See also: vips_scRGB2XYZ().

    Parameters

    • R: number

      Input scRGB value

    • G: number

      Input scRGB value

    • B: number

      Input scRGB value

    Returns [number, number, number, number]

  • col_scRGB2sRGB_16(R: number, G: number, B: number, r: number, g: number, b: number, og: number): number
  • col_scRGB2sRGB_8(R: number, G: number, B: number, r: number, g: number, b: number, og: number): number
  • concurrency_get(): number
  • Returns the number of worker threads that vips should use when running a #VipsThreadPool.

    vips gets this values from these sources in turn:

    If vips_concurrency_set() has been called, this value is used. The special value 0 means "default". You can also use the command-line argument "--vips-concurrency" to set this value.

    If vips_concurrency_set() has not been called and no command-line argument was used, vips uses the value of the environment variable VIPS_CONCURRENCY,

    If VIPS_CONCURRENCY has not been set, vips finds the number of hardware threads that the host machine can run in parallel and uses that value.

    The final value is clipped to the range 1 - 1024.

    See also: vips_concurrency_get().

    Returns number

  • concurrency_set(concurrency: number): void
  • Sets the number of worker threads that vips should use when running a #VipsThreadPool.

    The special value 0 means "default". In this case, the number of threads is set by the environment variable VIPS_CONCURRENCY, or if that is not set, the number of threads available on the host machine.

    See also: vips_concurrency_get().

    Parameters

    • concurrency: number

      number of threads to run

    Returns void

  • error_buffer(): string
  • Get a pointer to the start of the error buffer as a C string. The string is owned by the error system and must not be freed.

    See also: vips_error_clear().

    Returns string

  • error_buffer_copy(): string
  • error_clear(): void
  • Clear and reset the error buffer. This is typically called after presenting an error to the user.

    See also: vips_error_buffer().

    Returns void

  • error_freeze(): void
  • Stop errors being logged. Use vips_error_thaw() to unfreeze. You can nest freeze/thaw pairs.

    Returns void

  • error_g(): void
  • This function sets the glib error pointer from the vips error buffer and clears it. It's handy for returning errors to glib functions from vips.

    See vips_g_error() for the inverse operation.

    See also: g_set_error(), vips_g_error().

    Returns void

  • error_thaw(): void
  • filename_get_filename(vips_filename: string): string
  • Given a vips filename like "fred.jpg[Q=90]", return a new string of just the filename part, "fred.jpg" in this case.

    Useful for language bindings.

    See also: vips_filename_get_options().

    Parameters

    • vips_filename: string

      a filename including a set of options

    Returns string

  • filename_get_options(vips_filename: string): string
  • Given a vips filename like "fred.jpg[Q=90]", return a new string of just the options part, "[Q=90]" in this case.

    Useful for language bindings.

    See also: vips_filename_get_filename().

    Parameters

    • vips_filename: string

      a filename including a set of options

    Returns string

  • g_error(): void
  • This function adds the %GError to the vips error buffer and clears it. It's the opposite of vips_error_g().

    See also: vips_error_g().

    Returns void

  • get_argv0(): string
  • get_disc_threshold(): number
  • Return the number of bytes at which we flip between open via memory and open via disc. This defaults to 100mb, but can be changed with the VIPS_DISC_THRESHOLD environment variable or the --vips-disc-threshold command-line flag. See vips_image_new_from_file().

    Returns number

  • get_prgname(): string
  • Return the program name. This can be useful for the user tio see,.

    See also: VIPS_INIT().

    Returns string

  • guess_libdir(argv0: string, env_name: string): string
  • vips_guess_libdir() tries to guess the install directory (usually the configure libdir, or $prefix/lib). You should pass in the value of argv[0] (the name your program was run as) as a clue to help it out, plus the name of the environment variable you let the user override your package install area with (eg. "VIPSHOME").

    On success, vips_guess_libdir() returns the libdir it discovered, and as a side effect, sets the prefix environment variable (if it's not set).

    Don't free the return string!

    See also: vips_guess_prefix().

    Parameters

    • argv0: string

      program name (typically argv[0])

    • env_name: string

      save prefix in this environment variable

    Returns string

  • guess_prefix(argv0: string, env_name: string): string
  • vips_guess_prefix() tries to guess the install directory. You should pass in the value of argv[0] (the name your program was run as) as a clue to help it out, plus the name of the environment variable you let the user override your package install area with (eg. "VIPSHOME").

    On success, vips_guess_prefix() returns the prefix it discovered, and as a side effect, sets the environment variable (if it's not set).

    Don't free the return string!

    See also: vips_guess_libdir().

    Parameters

    • argv0: string

      program name (typically argv[0])

    • env_name: string

      save prefix in this environment variable

    Returns string

  • icc_is_compatible_profile(image: Vips.Image, data: object, data_length: number): boolean
  • icc_present(): number
  • VIPS can optionally be built without the ICC library. Use this function to test for its availability.

    Returns number

  • init(argv0: string): number
  • This function starts up libvips, see VIPS_INIT().

    This function is for bindings which need to start up vips. C programs should use the VIPS_INIT() macro, which does some extra checks.

    See also: VIPS_INIT().

    Parameters

    • argv0: string

      name of application

    Returns number

  • leak_set(leak: boolean): void
  • Turn on or off vips leak checking. See also --vips-leak, vips_add_option_entries() and the VIPS_LEAK environment variable.

    You should call this very early in your program.

    Parameters

    • leak: boolean

      turn leak checking on or off

    Returns void

  • malloc(object: Vips.Object, size: number): object | null
  • g_malloc() local to object, that is, the memory will be automatically freed for you when the object is closed. If object is %NULL, you need to free the memory explicitly with g_free().

    This function cannot fail. See vips_tracked_malloc() if you are allocating large amounts of memory.

    See also: vips_tracked_malloc().

    Parameters

    • object: Vips.Object

      allocate memory local to this #VipsObject, or %NULL

    • size: number

      number of bytes to allocate

    Returns object | null

  • nickname_find(type: GType<unknown>): string
  • Return the VIPS nickname for a %GType. Handy for language bindings.

    Parameters

    • type: GType<unknown>

      #GType to search for

    Returns string

  • path_filename7(path: string): string
  • Return the filename part of a vips7 path. For testing only.

    Parameters

    • path: string

      path to split

    Returns string

  • path_mode7(path: string): string
  • Return the mode part of a vips7 path. For testing only.

    Parameters

    • path: string

      path to split

    Returns string

  • progress_set(progress: boolean): void
  • If set, vips will print messages about the progress of computation to stdout. This can also be enabled with the --vips-progress option, or by setting the environment variable VIPS_PROGRESS.

    Parameters

    • progress: boolean

      %TRUE to enable progress messages

    Returns void

  • pythagoras(L1: number, a1: number, b1: number, L2: number, a2: number, b2: number): number
  • Pythagorean distance between two points in colour space. Lab/XYZ/CMC etc.

    Parameters

    • L1: number

      Input coordinate 1

    • a1: number

      Input coordinate 1

    • b1: number

      Input coordinate 1

    • L2: number

      Input coordinate 2

    • a2: number

      Input coordinate 2

    • b2: number

      Input coordinate 2

    Returns number

  • shutdown(): void
  • Call this to drop caches, close plugins, terminate background threads, and finalize any internal library testing.

    vips_shutdown() is optional. If you don't call it, your platform will clean up for you. The only negative consequences are that the leak checker and the profiler will not work.

    You may call VIPS_INIT() many times and vips_shutdown() many times, but you must not call VIPS_INIT() after vips_shutdown(). In other words, you cannot stop and restart libvips.

    See also: vips_profile_set(), vips_leak_set().

    Returns void

  • g_strdup() a string. When object is freed, the string will be freed for you. If object is %NULL, you need to free the memory yourself with g_free().

    This function cannot fail.

    See also: vips_malloc().

    Parameters

    • object: Vips.Object

      allocate memory local to this #VipsObject, or %NULL

    • str: string

      string to copy

    Returns string

  • thread_shutdown(): void
  • Free any thread-private data and flush any profiling information.

    This function needs to be called when a thread that has been using vips exits. It is called for you by vips_shutdown() and for any threads created within the #VipsThreadPool.

    You will need to call it from threads created in other ways or there will be memory leaks. If you do not call it, vips will generate a warning message.

    It may be called many times, and you can continue using vips after calling it. Calling it too often will reduce performance.

    Returns void

  • tracked_close(fd: number): number
  • Exactly as close(2), but update the number of files currently open via vips_tracked_get_files(). This is used by the vips operation cache to drop cache when the number of files available is low.

    You must only close file descriptors opened with vips_tracked_open().

    See also: vips_tracked_open(), vips_tracked_get_files().

    Parameters

    • fd: number

      file to close()

    Returns number

  • tracked_free(s: object): void
  • Only use it to free memory that was previously allocated with vips_tracked_malloc() with a %NULL first argument.

    See also: vips_tracked_malloc().

    Parameters

    • s: object

      memory to free

    Returns void

  • tracked_get_allocs(): number
  • tracked_get_files(): number
  • tracked_get_mem(): number
  • Returns the number of bytes currently allocated via vips_malloc() and friends. vips uses this figure to decide when to start dropping cache, see #VipsOperation.

    Returns number

  • tracked_get_mem_highwater(): number
  • Returns the largest number of bytes simultaneously allocated via vips_tracked_malloc(). Handy for estimating max memory requirements for a program.

    Returns number

  • tracked_malloc(size: number): object | null
  • Allocate an area of memory that will be tracked by vips_tracked_get_mem() and friends.

    If allocation fails, vips_malloc() returns %NULL and sets an error message.

    You must only free the memory returned with vips_tracked_free().

    See also: vips_tracked_free(), vips_malloc().

    Parameters

    • size: number

      number of bytes to allocate

    Returns object | null

  • tracked_open(pathname: string, flags: number, mode: number): number
  • Exactly as open(2), but the number of files currently open via vips_tracked_open() is available via vips_tracked_get_files(). This is used by the vips operation cache to drop cache when the number of files available is low.

    You must only close the file descriptor with vips_tracked_close().

    pathname should be utf8.

    See also: vips_tracked_close(), vips_tracked_get_files().

    Parameters

    • pathname: string

      name of file to open

    • flags: number

      flags for open()

    • mode: number

      open mode

    Returns number

  • type_depth(type: GType<unknown>): number
  • type_find(basename: string, nickname: string): GType
  • Search below basename, return the %GType of the class whose name or nickname matches, or 0 for not found. If basename is NULL, the whole of #VipsObject is searched.

    This function uses a cache, so it should be quick.

    See also: vips_class_find()

    Parameters

    • basename: string

      name of base class

    • nickname: string

      search for a class with this nickname

    Returns GType

  • value_get_area(value: any): [object | null, number]
  • Get the pointer from an area. Don't touch count (area is static).

    Parameters

    • value: any

      get from this value

    Returns [object | null, number]

  • value_get_array(value: any): [object | null, number, GType, number]
  • Return the pointer to the array held by value. Optionally return the other properties of the array in n, type, sizeof_type.

    See also: vips_value_set_array().

    Parameters

    • value: any

      %GValue to get from

    Returns [object | null, number, GType, number]

  • value_get_array_double(value: any): number[]
  • Return the start of the array of doubles held by value. optionally return the number of elements in n.

    See also: vips_array_double_new().

    Parameters

    • value: any

      %GValue to get from

    Returns number[]

  • value_get_array_image(value: any): Vips.Image[]
  • Return the start of the array of images held by value. optionally return the number of elements in n.

    See also: vips_value_set_array_image().

    Parameters

    • value: any

      %GValue to get from

    Returns Vips.Image[]

  • value_get_array_int(value: any): number[]
  • Return the start of the array of ints held by value. optionally return the number of elements in n.

    See also: vips_array_int_new().

    Parameters

    • value: any

      %GValue to get from

    Returns number[]

  • value_get_blob(value: any): [object | null, number]
  • Returns the data pointer from a blob. Optionally returns the length too.

    blobs are things like ICC profiles or EXIF data. They are relocatable, and are saved to VIPS files for you coded as base64 inside the XML. They are copied by copying reference-counted pointers.

    See also: vips_value_set_blob()

    Parameters

    • value: any

      GValue to set

    Returns [object | null, number]

  • value_get_ref_string(value: any): [string, number]
  • Get the C string held internally by the %GValue.

    Parameters

    • value: any

      %GValue to get from

    Returns [string, number]

  • value_get_save_string(value: any): string
  • value_is_null(psoec: ParamSpec, value: any): boolean
  • value_set_area(value: any, free_fn: CallbackFn): void
  • Set value to be a ref-counted area of memory with a free function.

    Parameters

    • value: any

      set this value

    • free_fn: CallbackFn

      data will be freed with this function

    Returns void

  • value_set_array(n: number, type: GType<unknown>, sizeof_type: number): any
  • Set value to be an array of things.

    This allocates memory but does not initialise the contents: get the pointer and write instead.

    Parameters

    • n: number

      number of elements

    • type: GType<unknown>

      the type of each element

    • sizeof_type: number

      the sizeof each element

    Returns any

  • value_set_array_double(value: any, array: number[]): void
  • Set value to hold a copy of array. Pass in the array length in n.

    See also: vips_array_double_get().

    Parameters

    • value: any

      %GValue to get from

    • array: number[]

      array of doubles

    Returns void

  • value_set_array_image(value: any, n: number): void
  • Set value to hold an array of images. Pass in the array length in n.

    See also: vips_array_image_get().

    Parameters

    • value: any

      %GValue to get from

    • n: number

      the number of elements

    Returns void

  • value_set_array_int(value: any, array: number[]): void
  • Set value to hold a copy of array. Pass in the array length in n.

    See also: vips_array_int_get().

    Parameters

    • value: any

      %GValue to get from

    • array: number[]

      array of ints

    Returns void

  • value_set_array_object(n: number): any
  • Set value to hold an array of %GObject. Pass in the array length in n.

    See also: vips_value_get_array_object().

    Parameters

    • n: number

      the number of elements

    Returns any

  • value_set_blob(free_fn: CallbackFn, length: number): any
  • Sets value to hold a data. When value is freed, data will be freed with free_fn. value also holds a note of the size of the memory area.

    blobs are things like ICC profiles or EXIF data. They are relocatable, and are saved to VIPS files for you coded as base64 inside the XML. They are copied by copying reference-counted pointers.

    See also: vips_value_get_blob()

    Parameters

    • free_fn: CallbackFn

      free function for data

    • length: number

      length of memory area

    Returns any

  • value_set_blob_free(value: any, data: object, length: number): void
  • Just like vips_value_set_blob(), but when value is freed, data will be freed with g_free().

    This can be easier to call for language bindings.

    See also: vips_value_set_blob()

    Parameters

    • value: any

      GValue to set

    • data: object

      pointer to area of memory

    • length: number

      length of memory area

    Returns void

  • value_set_ref_string(str: string): any
  • Copies the C string str into value.

    vips_ref_string are immutable C strings that are copied between images by copying reference-counted pointers, making them much more efficient than regular %GValue strings.

    str should be a valid utf-8 string.

    Parameters

    • str: string

      C string to copy into the GValue

    Returns any

  • value_set_save_string(str: string): any
  • Copies the C string into value.

    str should be a valid utf-8 string.

    Parameters

    • str: string

      C string to copy into the GValue

    Returns any

  • version(flag: number): number
  • Get the major, minor or micro library version, with flag values 0, 1 and 2.

    Get the ABI current, revision and age (as used by libtool) with flag values 3, 4, 5.

    Parameters

    • flag: number

      which field of the version to get

    Returns number

  • version_string(): string

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