Constructor

VipsImagejp2kload

Declaration [src]

int
vips_jp2kload (
  const char* filename,
  VipsImage** out,
  ...
)

Description [src]

Optional arguments:

  • page: %gint, load this page
  • oneshot: %gboolean, load pages in one-shot mode
  • fail_on: VipsFailOn, types of read error to fail on

Read a JPEG2000 image. The loader supports 8, 16 and 32-bit int pixel values, signed and unsigned. It supports greyscale, RGB, YCC, CMYK and multispectral colour spaces. It will read any ICC profile on the image.

It will only load images where all channels have the same format.

Use page to set the page to load, where page 0 is the base resolution image and higher-numbered pages are x2 reductions. Use the metadata item “n-pages” to find the number of pyramid layers.

Some versions of openjpeg can fail to decode some tiled images correctly. Setting oneshot will force the loader to decode tiled images in a single operation and can improve compatibility.

Use fail_on to set the type of error that will cause load to fail. By default, loaders are permissive, that is, #VIPS_FAIL_ON_NONE.

See also: vips_image_new_from_file().

This constructor is not directly available to language bindings.

Parameters

filename

Type: const char*

File to load.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
out

Type: VipsImage

Decompressed image.

The argument will be set by the function.
The caller of the function takes ownership of the returned data, and is responsible for freeing it.
...

Type: 

NULL-terminated list of optional named arguments.

Return value

Type: int

0 on success, -1 on error.