|
Blender
V2.93
|
#include "IMB_imbuf.h"Go to the source code of this file.
Classes | |
| struct | ImFileType |
Macros | |
| #define | IM_FTYPE_FLOAT 1 |
Typedefs | |
| typedef struct ImFileType | ImFileType |
Functions | |
| const ImFileType * | IMB_file_type_from_ftype (int ftype) |
| const ImFileType * | IMB_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) |
| bool | imb_is_a_png (const unsigned char *mem, const size_t size) |
| struct ImBuf * | imb_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) |
| bool | imb_is_a_targa (const unsigned char *buf, const size_t size) |
| struct ImBuf * | imb_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) |
| bool | imb_is_a_iris (const unsigned char *mem, const size_t size) |
| struct ImBuf * | imb_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) |
| bool | imb_is_a_jp2 (const unsigned char *buf, const size_t size) |
| struct ImBuf * | imb_load_jp2 (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| struct ImBuf * | imb_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) |
| bool | imb_is_a_jpeg (const unsigned char *mem, const size_t size) |
| bool | imb_savejpeg (struct ImBuf *ibuf, const char *filepath, int flags) |
| struct ImBuf * | imb_load_jpeg (const unsigned char *buffer, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| bool | imb_is_a_bmp (const unsigned char *buf, const size_t size) |
| struct ImBuf * | imb_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) |
| bool | imb_is_a_cineon (const unsigned char *buf, const size_t size) |
| bool | imb_save_cineon (struct ImBuf *buf, const char *filepath, int flags) |
| struct ImBuf * | imb_load_cineon (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| bool | imb_is_a_dpx (const unsigned char *buf, const size_t size) |
| bool | imb_save_dpx (struct ImBuf *buf, const char *filepath, int flags) |
| struct ImBuf * | imb_load_dpx (const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| bool | imb_is_a_hdr (const unsigned char *buf, const size_t size) |
| struct ImBuf * | imb_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) |
| void | imb_inittiff (void) |
| bool | imb_is_a_tiff (const unsigned char *buf, const size_t size) |
| struct ImBuf * | imb_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) |
Variables | |
| const ImFileType | IMB_FILE_TYPES [] |
| const ImFileType * | IMB_FILE_TYPES_LAST |
| #define IM_FTYPE_FLOAT 1 |
Definition at line 29 of file IMB_filetype.h.
| typedef struct ImFileType ImFileType |
| struct ImBuf* imb_bmp_decode | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 121 of file bmp.c.
References BMPINFOHEADER::biBitCount, BMPINFOHEADER::biHeight, BMPINFOHEADER::biSize, BMPINFOHEADER::biWidth, BMPINFOHEADER::biXPelsPerMeter, BMPINFOHEADER::biYPelsPerMeter, BMP_FILEHEADER_SIZE, checkbmp(), col, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ImBuf::ftype, IB_rect, IB_test, if(), IM_MAX_SPACE, IMB_allocImBuf(), imb_bmp_calc_row_size_in_bytes(), IMB_FTYPE_BMP, LITTLE_LONG, LITTLE_SHORT, NULL, ImBuf::ppm, ImBuf::rect, size(), x, and y.
| const ImFileType* IMB_file_type_from_ftype | ( | int | ftype | ) |
Definition at line 219 of file filetype.c.
References IMB_FILE_TYPES, IMB_FILE_TYPES_LAST, NULL, and type.
Referenced by IMB_file_type_from_ibuf(), and IMB_ispic_type_matches().
| const ImFileType* IMB_file_type_from_ibuf | ( | const struct ImBuf * | ibuf | ) |
| void imb_filetypes_exit | ( | void | ) |
Definition at line 245 of file filetype.c.
References IMB_FILE_TYPES, IMB_FILE_TYPES_LAST, and type.
Referenced by IMB_exit().
| void imb_filetypes_init | ( | void | ) |
Definition at line 234 of file filetype.c.
References IMB_FILE_TYPES, IMB_FILE_TYPES_LAST, and type.
Referenced by IMB_init().
| bool imb_is_a_bmp | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 109 of file bmp.c.
References checkbmp(), and size().
| bool imb_is_a_cineon | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 191 of file cineon_dpx.c.
References logImageIsCineon(), and size().
Referenced by imb_load_cineon().
| bool imb_is_a_dpx | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 212 of file cineon_dpx.c.
References logImageIsDpx(), and size().
Referenced by imb_load_dpx().
| bool imb_is_a_hdr | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 200 of file radiance_hdr.c.
References magic(), and size().
Referenced by imb_loadhdr().
| bool imb_is_a_iris | ( | const unsigned char * | mem, |
| const size_t | size | ||
| ) |
| bool imb_is_a_jp2 | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 85 of file jp2.c.
References check_j2k(), check_jp2(), and size().
| bool imb_is_a_jpeg | ( | const unsigned char * | mem, |
| const size_t | size | ||
| ) |
Definition at line 62 of file jpeg.c.
References magic(), and size().
Referenced by imb_load_jpeg().
| bool imb_is_a_png | ( | const unsigned char * | mem, |
| const size_t | size | ||
| ) |
| bool imb_is_a_targa | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 416 of file targa.c.
References checktarga(), and size().
| bool imb_is_a_tiff | ( | const unsigned char * | buf, |
| const size_t | size | ||
| ) |
Definition at line 319 of file tiff.c.
References IMB_TIFF_NCB, and size().
Referenced by imb_loadtiff().
| struct ImBuf* imb_load_cineon | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 196 of file cineon_dpx.c.
References ImBuf::flags, imb_is_a_cineon(), imb_load_dpx_cineon(), NULL, and size().
| struct ImBuf* imb_load_dpx | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 217 of file cineon_dpx.c.
References ImBuf::flags, imb_is_a_dpx(), imb_load_dpx_cineon(), NULL, and size().
| struct ImBuf* imb_load_jp2 | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 317 of file jp2.c.
References BufInfo::buf, format_from_header(), imb_load_jp2_stream(), JP2_FILEHEADER_SIZE, opj_stream_create_from_buffer(), and size().
| struct ImBuf* imb_load_jp2_filepath | ( | const char * | filepath, |
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 336 of file jp2.c.
References format_from_header(), imb_load_jp2_stream(), JP2_FILEHEADER_SIZE, NULL, and opj_stream_create_from_file().
| struct ImBuf* imb_load_jpeg | ( | const unsigned char * | buffer, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 437 of file jpeg.c.
References buffer, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ibJpegImageFromCinfo(), IM_MAX_SPACE, imb_is_a_jpeg(), jpeg_error(), memory_source(), NULL, my_error_mgr::pub, my_error_mgr::setjmp_buffer, and size().
| struct ImBuf* imb_loadhdr | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 218 of file radiance_hdr.c.
References BLU, COLOR_ROLE_DEFAULT_FLOAT, colorspace_set_default_role(), ImBuf::flags, freadcolrs(), ImBuf::ftype, GRN, height, IB_alphamode_detect, IB_alphamode_premul, IB_rect, IB_rectfloat, IB_test, IM_MAX_SPACE, IMB_allocImBuf(), IMB_flipy(), imb_is_a_hdr(), IMB_rect_from_float(), MEM_freeN, MEM_mallocN, MIN2, NULL, ptr, ImBuf::rect_float, RED, RGBE2FLOAT(), size(), UNLIKELY, width, x, and y.
| struct ImBuf* imb_loadiris | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 260 of file iris.c.
References BPP, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), ELEM, expandrow(), expandrow2(), ImBuf::flags, ImBuf::ftype, HEADER_SIZE, IB_rect, IB_rectfloat, IB_test, if(), IM_MAX_SPACE, IMAGIC, IMAGE::imagic, IMB_allocImBuf(), IMB_convert_rgba_to_abgr(), IMB_FTYPE_IMAGIC, imb_is_a_iris(), IMB_rect_from_float(), interleaverow(), interleaverow2(), ISRLE, MEM_freeN, MEM_mallocN, MFILE_CAPACITY_AT_PTR_OK_OR_FAIL, MFILE_DATA, MFILE_SEEK, MFILE_STEP, NULL, ImBuf::planes, readheader(), readtab(), ImBuf::rect, ImBuf::rect_float, size(), test_endian_zbuf(), IMAGE::type, x, ImBuf::x, IMAGE::xsize, y, ImBuf::y, IMAGE::ysize, z, ImBuf::zbuf, and IMAGE::zsize.
| struct ImBuf* imb_loadpng | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 540 of file png.c.
References ImBuf::channels, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), count, PNGReadStruct::data, ImbFormatOptions::flag, ImBuf::flags, ImBuf::foptions, from, ImBuf::ftype, height, IB_metadata, IB_test, IM_MAX_SPACE, imb_addrectfloatImBuf(), imb_addrectImBuf(), imb_alloc_pixels(), IMB_allocImBuf(), IMB_freeImBuf(), IMB_FTYPE_PNG, imb_is_a_png(), IMB_metadata_ensure(), IMB_metadata_set_field(), imb_png_error(), imb_png_warning(), MEM_freeN, MEM_mallocN, ImBuf::metadata, NULL, PNG_16BIT, ImBuf::ppm, ImBuf::rect, ImBuf::rect_float, PNGReadStruct::seek, size(), PNGReadStruct::size, width, ImBuf::x, and ImBuf::y.
| struct ImBuf* imb_loadtarga | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Definition at line 628 of file targa.c.
References BIG_LONG, checktarga(), col, COLOR_ROLE_DEFAULT_BYTE, colorspace_set_default_role(), count, decodetarga(), ELEM, ImbFormatOptions::flag, ImBuf::flags, ImBuf::foptions, ImBuf::ftype, IB_rect, IB_test, IM_MAX_SPACE, IMB_allocImBuf(), IMB_convert_rgba_to_abgr(), IMB_flipy(), IMB_FTYPE_TGA, TARGA::imgdes, TARGA::imgtyp, ldtarga(), TARGA::mapbits, TARGA::mapsize, MEM_callocN, MEM_freeN, NULL, TARGA::numid, TARGA::pixsize, ImBuf::planes, RAWTGA, ImBuf::rect, size(), TARGA_HEADER_SIZE, ImBuf::x, TARGA::xsize, ImBuf::y, and TARGA::ysize.
| struct ImBuf* imb_loadtiff | ( | const unsigned char * | mem, |
| size_t | size, | ||
| int | flags, | ||
| char | colorspace[IM_MAX_SPACE] | ||
| ) |
Loads a TIFF file.
| mem | Memory containing the TIFF file. |
| size | Size of the mem buffer. |
| flags | If flags has IB_test set then the file is not actually loaded, but all other operations take place. |
Definition at line 564 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, 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.
| void imb_loadtile | ( | struct ImBuf * | ibuf, |
| int | tx, | ||
| int | ty, | ||
| unsigned int * | rect | ||
| ) |
Definition at line 315 of file readimage.c.
References BLI_open(), ImBuf::cachename, file, imb_loadtilefile(), and O_BINARY.
Referenced by imb_global_cache_tile_load().
| void imb_loadtiletiff | ( | struct ImBuf * | ibuf, |
| const unsigned char * | mem, | ||
| size_t | size, | ||
| int | tx, | ||
| int | ty, | ||
| unsigned int * | rect | ||
| ) |
Definition at line 689 of file tiff.c.
References height, imb_tiff_client_open(), ImBuf::miplevel, NULL, size(), ImBuf::tilex, ImBuf::tiley, width, ImBuf::x, ImBuf::y, and ImBuf::ytiles.
| bool imb_save_cineon | ( | struct ImBuf * | buf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 186 of file cineon_dpx.c.
References ImBuf::flags, and imb_save_dpx_cineon().
| bool imb_save_dpx | ( | struct ImBuf * | buf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 207 of file cineon_dpx.c.
References ImBuf::flags, and imb_save_dpx_cineon().
| bool imb_save_jp2 | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 1201 of file jp2.c.
References ImBuf::flags, imb_save_jp2_stream(), NULL, and opj_stream_create_from_file().
| bool imb_savebmp | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
| bool imb_savehdr | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 435 of file radiance_hdr.c.
References BLI_fopen(), ImBuf::channels, file, ImBuf::flags, fwritecolrs(), height, NULL, ImBuf::rect, ImBuf::rect_float, width, writeHeader(), ImBuf::x, y, and ImBuf::y.
| bool imb_saveiris | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 977 of file iris.c.
References ImBuf::flags, IB_zbuf, IMB_convert_rgba_to_abgr(), NULL, output_iris(), ImBuf::planes, ImBuf::rect, test_endian_zbuf(), ImBuf::x, ImBuf::y, and ImBuf::zbuf.
| bool imb_savejpeg | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
| bool imb_savepng | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
Definition at line 126 of file png.c.
References BLI_fopen(), channel_colormanage_noop(), ImBuf::channels, ImBuf::colormanage_flag, IDProperty::data, ImBuf::encodedsize, ListBase::first, ImbFormatOptions::flag, float(), ImBuf::float_colorspace, Flush(), ImBuf::foptions, from, ftoshort(), IDPropertyData::group, IB_mem, IDP_String, IDP_STRING, imb_addencodedbufferImBuf(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_get_luminance(), linearrgb_to_srgb(), MEM_callocN, MEM_freeN, MEM_mallocN, ImBuf::metadata, IDProperty::name, IDProperty::next, NULL, ImBuf::planes, PNG_16BIT, ImBuf::ppm, premul_to_straight_v4_v4(), ImbFormatOptions::quality, ImBuf::rect, ImBuf::rect_float, IDProperty::type, UPSAMPLE_8_TO_16(), ImBuf::x, and ImBuf::y.
| bool imb_savetarga | ( | struct ImBuf * | ibuf, |
| const char * | filepath, | ||
| int | flags | ||
| ) |
| bool imb_savetiff | ( | 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.
| ibuf | Image buffer. |
| name | Name of the TIFF file to create. |
| flags | Currently largely ignored. |
Definition at line 761 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, 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, unit_float_to_ushort_clamp(), x, ImBuf::x, y, and ImBuf::y.
| void imb_tile_cache_exit | ( | void | ) |
Definition at line 223 of file cache.c.
References Freestyle::a, BLI_ghash_free(), BLI_memarena_free(), BLI_mutex_end(), ListBase::first, GLOBAL_CACHE, imb_global_cache_tile_unload(), imb_thread_cache_exit(), ImGlobalTileCache::initialized, ImGlobalTileCache::memarena, ImGlobalTileCache::mutex, ImGlobalTile::next, NULL, ImGlobalTileCache::thread_cache, ImGlobalTileCache::tilehash, ImGlobalTileCache::tiles, and ImGlobalTileCache::totthread.
Referenced by IMB_exit(), and IMB_tile_cache_params().
| void imb_tile_cache_init | ( | void | ) |
Definition at line 210 of file cache.c.
References BLI_mutex_init(), GLOBAL_CACHE, IMB_tile_cache_params(), ImGlobalTileCache::initialized, and ImGlobalTileCache::mutex.
Referenced by IMB_init().
| void imb_tile_cache_tile_free | ( | struct ImBuf * | ibuf, |
| int | tx, | ||
| int | ty | ||
| ) |
Definition at line 157 of file cache.c.
References BLI_addtail(), BLI_ghash_lookup(), BLI_ghash_remove(), BLI_mutex_lock(), BLI_mutex_unlock(), BLI_remlink(), GLOBAL_CACHE, ImGlobalTile::ibuf, ImGlobalTile::loading, ImGlobalTileCache::mutex, NULL, ImGlobalTileCache::tilehash, ImGlobalTileCache::tiles, ImGlobalTile::tx, ImGlobalTile::ty, and ImGlobalTileCache::unused.
Referenced by imb_freetilesImBuf().
|
extern |
Definition at line 43 of file filetype.c.
Referenced by IMB_file_type_from_ftype(), imb_filetypes_exit(), imb_filetypes_init(), IMB_ibImageFromFile(), IMB_ibImageFromMemory(), and IMB_ispic_type_from_memory().
|
extern |
Definition at line 217 of file filetype.c.
Referenced by IMB_file_type_from_ftype(), imb_filetypes_exit(), imb_filetypes_init(), IMB_ibImageFromFile(), IMB_ibImageFromMemory(), and IMB_ispic_type_from_memory().