Constructor

VipsImagejp2kload

Declaration [src]

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

Description [src]

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, VipsFailOn.

::: tip “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

::: seealso vips_image_new_from_file().

Parameters

filename const char*
 

File to load.

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

Decompressed image.

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

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.