Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
imageio_tiff.h File Reference
#include "common/image.h"
#include "caches/mipmap_cache.h"
+ Include dependency graph for imageio_tiff.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

dt_imageio_retval_t dt_imageio_open_tiff (dt_image_t *img, const char *filename, dt_mipmap_buffer_t *buf)
 
int dt_imageio_tiff_read_profile (const char *filename, uint8_t **out)
 
gboolean dt_imageio_tiff_decode_blob (const uint8_t *blob, size_t bufsize, uint8_t **out, int32_t *width, int32_t *height)
 Decode a TIFF held in memory into 8-bit RGBx, for the previews raw files embed.
 

Function Documentation

◆ dt_imageio_open_tiff()

◆ dt_imageio_tiff_decode_blob()

gboolean dt_imageio_tiff_decode_blob ( const uint8_t *  blob,
size_t  bufsize,
uint8_t **  out,
int32_t *  width,
int32_t *  height 
)

Decode a TIFF held in memory into 8-bit RGBx, for the previews raw files embed.

Raws that do not embed a JPEG preview embed a TIFF one – every DNG written by Adobe's converter does, as do Phase One IIQ, Hasselblad 3FR and film scanners. This is the only decoder those previews need; libtiff reads a blob through TIFFClientOpen just as well as a file.

Parameters
blobEncoded TIFF bytes. Not retained.
bufsizeLength of blob.
outOn success, receives a freshly allocated buffer of 4 bytes per pixel, laid out R, G, B, unused – the layout the JPEG preview path also produces. The caller owns it and must release it with dt_pixelpipe_cache_free_align(). Untouched on failure.
widthReceives the decoded width. Untouched on failure.
heightReceives the decoded height. Untouched on failure.
Returns
TRUE on success, FALSE if the blob is not a readable TIFF or allocation failed.

Definition at line 651 of file imageio_tiff.c.

References _blob_close(), _blob_map(), _blob_read(), _blob_seek(), _blob_size(), _blob_unmap(), _blob_write(), _error_handler(), _warning_handler(), _tiff_blob_t::data, DT_DEBUG_IMAGEIO, dt_pixelpipe_cache_alloc_align_cache, dt_pixelpipe_cache_free_align, dt_print(), FALSE, height, i, IS_NULL_PTR, out, TRUE, and width.

Referenced by dt_imageio_large_thumbnail().

◆ dt_imageio_tiff_read_profile()

int dt_imageio_tiff_read_profile ( const char *  filename,
uint8_t **  out 
)