Blender V5.0
format_tiff.cc File Reference

Go to the source code of this file.

Functions

bool imb_is_a_tiff (const uchar *mem, size_t size)
ImBufimb_load_tiff (const uchar *mem, size_t size, int flags, ImFileColorSpace &r_colorspace)
bool imb_save_tiff (ImBuf *ibuf, const char *filepath, int flags)

Function Documentation

◆ imb_is_a_tiff()

bool imb_is_a_tiff ( const uchar * mem,
size_t size )

Definition at line 18 of file format_tiff.cc.

References blender::imbuf::imb_oiio_check(), and size().

◆ imb_load_tiff()

ImBuf * imb_load_tiff ( const unsigned char * mem,
size_t size,
int flags,
ImFileColorSpace & r_colorspace )

Loads a TIFF file.

Parameters
memMemory containing the TIFF file.
sizeSize of the mem buffer.
flagsIf flags has IB_test set then the file is not actually loaded, but all other operations take place.
Returns
A newly allocated ImBuf structure if successful, otherwise NULL.

Definition at line 23 of file format_tiff.cc.

References ImBuf::flags, IB_alphamode_detect, IB_alphamode_premul, IMB_FTYPE_TIF, blender::imbuf::imb_oiio_read(), ImFileColorSpace::is_hdr_float, and size().

◆ imb_save_tiff()

bool imb_save_tiff ( ImBuf * ibuf,
const char * filepath,
int flags )

Saves a TIFF file.

ImBuf structures with 1, 3 or 4 bytes per pixel (GRAY, RGB, RGBA respectively) are accepted, and interpreted correctly. Note that the TIFF convention is to use pre-multiplied alpha, which can be achieved within Blender by setting premul alpha handling. Other alpha conventions are not strictly correct, but are permitted anyhow.

Parameters
ibufImage buffer.
filepathName of the TIFF file to create.
flagsCurrently largely ignored.
Returns
1 if the function is successful, 0 on failure.

Definition at line 45 of file format_tiff.cc.

References ImBufFloatBuffer::data, ImbFormatOptions::flag, ImBuf::float_buffer, ImBuf::foptions, blender::imbuf::imb_create_write_context(), blender::imbuf::imb_create_write_spec(), blender::imbuf::imb_oiio_write(), ImBuf::planes, TIF_16BIT, TIF_COMPRESS_DEFLATE, TIF_COMPRESS_LZW, TIF_COMPRESS_NONE, and TIF_COMPRESS_PACKBITS.