Blender  V3.3
Classes
IMB_filetype.h File Reference
#include "IMB_imbuf.h"

Go to the source code of this file.

Classes

struct  ImFileType
 

Functions

Format: PNG (#IMB_FTYPE_PNG)
bool imb_is_a_png (const unsigned char *mem, size_t size)
 
struct ImBufimb_loadpng (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_savepng (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: TARGA (#IMB_FTYPE_TGA)
bool imb_is_a_targa (const unsigned char *buf, size_t size)
 
struct ImBufimb_loadtarga (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_savetarga (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: IRIS (#IMB_FTYPE_IMAGIC)
bool imb_is_a_iris (const unsigned char *mem, size_t size)
 
struct ImBufimb_loadiris (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_saveiris (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: JP2 (#IMB_FTYPE_JP2)
bool imb_is_a_jp2 (const unsigned char *buf, size_t size)
 
struct ImBufimb_load_jp2 (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
struct ImBufimb_load_jp2_filepath (const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_save_jp2 (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: JPEG (#IMB_FTYPE_JPG)
bool imb_is_a_jpeg (const unsigned char *mem, size_t size)
 
bool imb_savejpeg (struct ImBuf *ibuf, const char *filepath, int flags)
 
struct ImBufimb_load_jpeg (const unsigned char *buffer, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
struct ImBufimb_thumbnail_jpeg (const char *filepath, int flags, size_t max_thumb_size, char colorspace[IM_MAX_SPACE], size_t *r_width, size_t *r_height)
 
Format: BMP (#IMB_FTYPE_BMP)
bool imb_is_a_bmp (const unsigned char *buf, size_t size)
 
struct ImBufimb_bmp_decode (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_savebmp (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: CINEON (#IMB_FTYPE_CINEON)
bool imb_is_a_cineon (const unsigned char *buf, size_t size)
 
bool imb_save_cineon (struct ImBuf *buf, const char *filepath, int flags)
 
struct ImBufimb_load_cineon (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
Format: DPX (#IMB_FTYPE_DPX)
bool imb_is_a_dpx (const unsigned char *buf, size_t size)
 
bool imb_save_dpx (struct ImBuf *buf, const char *filepath, int flags)
 
struct ImBufimb_load_dpx (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
Format: HDR (#IMB_FTYPE_RADHDR)
bool imb_is_a_hdr (const unsigned char *buf, size_t size)
 
struct ImBufimb_loadhdr (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_savehdr (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: TIFF (#IMB_FTYPE_TIF)
void imb_inittiff (void)
 
bool imb_is_a_tiff (const unsigned char *buf, size_t size)
 
struct ImBufimb_loadtiff (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
void imb_loadtiletiff (struct ImBuf *ibuf, const unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect)
 
bool imb_savetiff (struct ImBuf *ibuf, const char *filepath, int flags)
 
Format: TIFF (#IMB_FTYPE_WEBP)
bool imb_is_a_webp (const unsigned char *buf, size_t size)
 
struct ImBufimb_loadwebp (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
bool imb_savewebp (struct ImBuf *ibuf, const char *name, int flags)
 

Generic File Type

#define IM_FTYPE_FLOAT   1
 
typedef struct ImFileType ImFileType
 
const ImFileType IMB_FILE_TYPES []
 
const ImFileTypeIMB_FILE_TYPES_LAST
 
const ImFileTypeIMB_file_type_from_ftype (int ftype)
 
const ImFileTypeIMB_file_type_from_ibuf (const struct ImBuf *ibuf)
 
void imb_filetypes_init (void)
 
void imb_filetypes_exit (void)
 
void imb_tile_cache_init (void)
 
void imb_tile_cache_exit (void)
 
void imb_loadtile (struct ImBuf *ibuf, int tx, int ty, unsigned int *rect)
 
void imb_tile_cache_tile_free (struct ImBuf *ibuf, int tx, int ty)
 

Macro Definition Documentation

◆ IM_FTYPE_FLOAT

#define IM_FTYPE_FLOAT   1

Definition at line 17 of file IMB_filetype.h.

Typedef Documentation

◆ ImFileType

typedef struct ImFileType ImFileType

Function Documentation

◆ imb_bmp_decode()

struct ImBuf* imb_bmp_decode ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ IMB_file_type_from_ftype()

const ImFileType* IMB_file_type_from_ftype ( int  ftype)

◆ IMB_file_type_from_ibuf()

const ImFileType* IMB_file_type_from_ibuf ( const struct ImBuf ibuf)

◆ imb_filetypes_exit()

void imb_filetypes_exit ( void  )

Definition at line 259 of file filetype.c.

References IMB_FILE_TYPES, IMB_FILE_TYPES_LAST, and type.

Referenced by IMB_exit().

◆ imb_filetypes_init()

void imb_filetypes_init ( void  )

Definition at line 248 of file filetype.c.

References IMB_FILE_TYPES, IMB_FILE_TYPES_LAST, and type.

Referenced by IMB_init().

◆ imb_inittiff()

void imb_inittiff ( void  )

Definition at line 535 of file tiff.c.

References G, G_DEBUG, and NULL.

◆ imb_is_a_bmp()

bool imb_is_a_bmp ( const unsigned char *  buf,
size_t  size 
)

Definition at line 93 of file bmp.c.

References checkbmp(), and size().

◆ imb_is_a_cineon()

bool imb_is_a_cineon ( const unsigned char *  buf,
size_t  size 
)

Definition at line 176 of file cineon_dpx.c.

References logImageIsCineon(), and size().

Referenced by imb_load_cineon().

◆ imb_is_a_dpx()

bool imb_is_a_dpx ( const unsigned char *  buf,
size_t  size 
)

Definition at line 197 of file cineon_dpx.c.

References logImageIsDpx(), and size().

Referenced by imb_load_dpx().

◆ imb_is_a_hdr()

bool imb_is_a_hdr ( const unsigned char *  buf,
size_t  size 
)

Definition at line 179 of file radiance_hdr.c.

References magic(), and size().

Referenced by imb_loadhdr().

◆ imb_is_a_iris()

bool imb_is_a_iris ( const unsigned char *  mem,
size_t  size 
)

Definition at line 230 of file iris.c.

References GS, GSS, IMAGIC, and size().

Referenced by imb_loadiris().

◆ imb_is_a_jp2()

bool imb_is_a_jp2 ( const unsigned char *  buf,
size_t  size 
)

Definition at line 71 of file jp2.c.

References check_j2k(), check_jp2(), and size().

◆ imb_is_a_jpeg()

bool imb_is_a_jpeg ( const unsigned char *  mem,
size_t  size 
)

Definition at line 51 of file jpeg.c.

References magic(), and size().

Referenced by imb_load_jpeg().

◆ imb_is_a_png()

bool imb_is_a_png ( const unsigned char *  mem,
size_t  size 
)

Definition at line 48 of file png.c.

References size().

Referenced by imb_loadpng().

◆ imb_is_a_targa()

bool imb_is_a_targa ( const unsigned char *  buf,
size_t  size 
)

Definition at line 400 of file targa.c.

References checktarga(), and size().

◆ imb_is_a_tiff()

bool imb_is_a_tiff ( const unsigned char *  buf,
size_t  size 
)

Definition at line 306 of file tiff.c.

References IMB_TIFF_NCB, and size().

Referenced by imb_loadtiff().

◆ imb_is_a_webp()

bool imb_is_a_webp ( const unsigned char *  buf,
size_t  size 
)

Definition at line 23 of file webp.c.

References NULL, and size().

Referenced by imb_loadwebp().

◆ imb_load_cineon()

struct ImBuf* imb_load_cineon ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

Definition at line 181 of file cineon_dpx.c.

References ImBuf::flags, imb_is_a_cineon(), imb_load_dpx_cineon(), NULL, and size().

◆ imb_load_dpx()

struct ImBuf* imb_load_dpx ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

Definition at line 202 of file cineon_dpx.c.

References ImBuf::flags, imb_is_a_dpx(), imb_load_dpx_cineon(), NULL, and size().

◆ imb_load_jp2()

struct ImBuf* imb_load_jp2 ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_load_jp2_filepath()

struct ImBuf* imb_load_jp2_filepath ( const char *  filepath,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_load_jpeg()

struct ImBuf* imb_load_jpeg ( const unsigned char *  buffer,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_loadhdr()

struct ImBuf* imb_loadhdr ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_loadiris()

struct ImBuf* imb_loadiris ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_loadpng()

struct ImBuf* imb_loadpng ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_loadtarga()

struct ImBuf* imb_loadtarga ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_loadtiff()

struct ImBuf* imb_loadtiff ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

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 542 of file tiff.c.

References ceil(), COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ImBuf::flags, ImBuf::ftype, height, IB_alphamode_detect, IB_alphamode_premul, IB_test, IB_tilecache, IM_MAX_SPACE, image(), imb_addtilesImBuf(), IMB_allocImBuf(), imb_is_a_tiff(), imb_read_tiff_pixels(), imb_tiff_client_open(), ImBuf::mipmap, ImBuf::miptot, NULL, size(), STREQ, and width.

◆ imb_loadtile()

void imb_loadtile ( struct ImBuf ibuf,
int  tx,
int  ty,
unsigned int *  rect 
)

Definition at line 355 of file readimage.c.

References BLI_open(), ImBuf::cachename, file, imb_loadtilefile(), O_BINARY, and ImBuf::rect.

Referenced by imb_global_cache_tile_load().

◆ imb_loadtiletiff()

void imb_loadtiletiff ( struct ImBuf ibuf,
const unsigned char *  mem,
size_t  size,
int  tx,
int  ty,
unsigned int *  rect 
)

◆ imb_loadwebp()

struct ImBuf* imb_loadwebp ( const unsigned char *  mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_save_cineon()

bool imb_save_cineon ( struct ImBuf buf,
const char *  filepath,
int  flags 
)

Definition at line 171 of file cineon_dpx.c.

References ImBuf::flags, and imb_save_dpx_cineon().

◆ imb_save_dpx()

bool imb_save_dpx ( struct ImBuf buf,
const char *  filepath,
int  flags 
)

Definition at line 192 of file cineon_dpx.c.

References ImBuf::flags, and imb_save_dpx_cineon().

◆ imb_save_jp2()

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

Definition at line 1187 of file jp2.c.

References ImBuf::flags, imb_save_jp2_stream(), NULL, and opj_stream_create_from_file().

◆ imb_savebmp()

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

◆ imb_savehdr()

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

◆ imb_saveiris()

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

◆ imb_savejpeg()

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

Definition at line 752 of file jpeg.c.

◆ imb_savepng()

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

◆ imb_savetarga()

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

◆ imb_savetiff()

bool imb_savetiff ( struct 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 724 of file tiff.c.

References alloc_utf16_from_8(), ImBuf::channels, ImBuf::colormanage_flag, copy_v3_v3(), ELEM, ImbFormatOptions::flag, float(), ImBuf::float_colorspace, ImBuf::foptions, free(), from, IB_mem, image(), IMB_COLORMANAGE_IS_DATA, IMB_DPI_DEFAULT, linearrgb_to_srgb(), linearrgb_to_srgb_v3_v3(), NULL, ImBuf::planes, ImBuf::ppm, ImBuf::rect, ImBuf::rect_float, usdtokens::rgb(), unit_float_to_ushort_clamp(), x, ImBuf::x, y, and ImBuf::y.

◆ imb_savewebp()

bool imb_savewebp ( struct ImBuf ibuf,
const char *  name,
int  flags 
)

◆ imb_thumbnail_jpeg()

struct ImBuf* imb_thumbnail_jpeg ( const char *  filepath,
int  flags,
size_t  max_thumb_size,
char  colorspace[IM_MAX_SPACE],
size_t *  r_width,
size_t *  r_height 
)

◆ imb_tile_cache_exit()

void imb_tile_cache_exit ( void  )

◆ imb_tile_cache_init()

void imb_tile_cache_init ( void  )

◆ imb_tile_cache_tile_free()

void imb_tile_cache_tile_free ( struct ImBuf ibuf,
int  tx,
int  ty 
)

Variable Documentation

◆ IMB_FILE_TYPES

const ImFileType IMB_FILE_TYPES[]
extern

◆ IMB_FILE_TYPES_LAST

const ImFileType* IMB_FILE_TYPES_LAST
extern