|
Blender
V2.93
|
#include <string.h>#include "BLI_fileops.h"#include "BLI_utildefines.h"#include "MEM_guardedalloc.h"#include "IMB_filetype.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "imbuf.h"#include "IMB_colormanagement.h"#include "IMB_colormanagement_intern.h"Go to the source code of this file.
Classes | |
| struct | IMAGE |
| struct | MFileOffset |
Macros | |
| #define | IMAGIC 0732 |
| #define | HEADER_SIZE 512 |
| #define | RINTLUM (79) |
| #define | GINTLUM (156) |
| #define | BINTLUM (21) |
| #define | ILUM(r, g, b) ((int)(RINTLUM * (r) + GINTLUM * (g) + BINTLUM * (b)) >> 8) |
| #define | OFFSET_R 0 /* this is byte order dependent */ |
| #define | OFFSET_G 1 |
| #define | OFFSET_B 2 |
| #define | CHANOFFSET(z) (3 - (z)) /* this is byte order dependent */ |
| #define | BPPMASK 0x00ff |
| #define | ITYPE_RLE 0x0100 |
| #define | ISRLE(type) (((type)&0xff00) == ITYPE_RLE) |
| #define | BPP(type) ((type)&BPPMASK) |
| #define | RLE(bpp) (ITYPE_RLE | (bpp)) |
| #define | MFILE_DATA(inf) ((void)0, ((inf)->_file_data + (inf)->_file_offset)) |
| #define | MFILE_STEP(inf, step) |
| #define | MFILE_SEEK(inf, pos) |
| #define | DIRTY_FLAG_EOF (1 << 0) |
| #define | DIRTY_FLAG_ENCODING (1 << 1) |
| #define | GS(x) (((uchar *)(x))[0] << 8 | ((uchar *)(x))[1]) |
| #define | GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) |
| #define | MFILE_CAPACITY_AT_PTR_OK_OR_FAIL(p) |
| #define | MFILE_CAPACITY_AT_PTR_OK_OR_FAIL(p) |
| #define | EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL(iptr_next) |
| #define | EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL(optr_next) |
| #define | EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL(iptr_next) |
| #define | EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL(optr_next) |
Typedefs | |
| typedef struct MFileOffset | MFileOffset |
Functions | |
| BLI_STATIC_ASSERT (sizeof(IMAGE)==HEADER_SIZE, "Invalid header size") | |
| static void | readheader (MFileOffset *inf, IMAGE *image) |
| static int | writeheader (FILE *outf, IMAGE *image) |
| static ushort | getshort (MFileOffset *inf) |
| static uint | getlong (MFileOffset *mofs) |
| static void | putshort (FILE *outf, ushort val) |
| static int | putlong (FILE *outf, uint val) |
| static int | writetab (FILE *outf, uint *tab, int len) |
| static void | readtab (MFileOffset *inf, uint *tab, int len) |
| static int | expandrow (uchar *optr, const uchar *optr_end, const uchar *iptr, const uchar *iptr_end, int z) |
| static int | expandrow2 (float *optr, const float *optr_end, const uchar *iptr, const uchar *iptr_end, int z) |
| static void | interleaverow (uchar *lptr, const uchar *cptr, int z, int n) |
| static void | interleaverow2 (float *lptr, const uchar *cptr, int z, int n) |
| static int | compressrow (uchar *lbuf, uchar *rlebuf, int z, int cnt) |
| static void | lumrow (const uchar *rgbptr, uchar *lumptr, int n) |
| static void | test_endian_zbuf (struct ImBuf *ibuf) |
| bool | imb_is_a_iris (const uchar *mem, size_t size) |
| struct ImBuf * | imb_loadiris (const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE]) |
| static bool | output_iris (uint *lptr, int xsize, int ysize, int zsize, const char *name, int *zptr) |
| bool | imb_saveiris (struct ImBuf *ibuf, const char *filepath, int flags) |
| #define EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL | ( | iptr_next | ) |
| #define EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL | ( | iptr_next | ) |
| #define EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL | ( | optr_next | ) |
| #define EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL | ( | optr_next | ) |
| #define MFILE_CAPACITY_AT_PTR_OK_OR_FAIL | ( | p | ) |
| #define MFILE_CAPACITY_AT_PTR_OK_OR_FAIL | ( | p | ) |
| #define MFILE_DATA | ( | inf | ) | ((void)0, ((inf)->_file_data + (inf)->_file_offset)) |
| #define MFILE_SEEK | ( | inf, | |
| pos | |||
| ) |
| #define MFILE_STEP | ( | inf, | |
| step | |||
| ) |
| typedef struct MFileOffset MFileOffset |
| BLI_STATIC_ASSERT | ( | sizeof(IMAGE) | = =HEADER_SIZE, |
| "Invalid header size" | |||
| ) |
|
static |
Definition at line 718 of file iris.c.
References BLI_assert, count, DIRTY_FLAG_ENCODING, EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL, EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL, and z.
Referenced by imb_loadiris().
|
static |
Definition at line 630 of file iris.c.
References BLI_assert, count, DIRTY_FLAG_ENCODING, EXPAND_CAPACITY_AT_INPUT_OK_OR_FAIL, EXPAND_CAPACITY_AT_OUTPUT_OK_OR_FAIL, and z.
Referenced by imb_loadiris().
|
static |
Definition at line 141 of file iris.c.
References MFILE_DATA, and MFILE_STEP.
Referenced by readtab().
|
static |
Definition at line 131 of file iris.c.
References MFILE_DATA, and MFILE_STEP.
Referenced by readheader().
| bool imb_is_a_iris | ( | const uchar * | mem, |
| size_t | size | ||
| ) |
| struct ImBuf* imb_loadiris | ( | const uchar * | 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.
| 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.
Definition at line 907 of file iris.c.
References CHANOFFSET, ILUM, OFFSET_B, OFFSET_G, and OFFSET_R.
Referenced by output_iris().
|
static |
Copy an array of ints to an iris image file. Each int represents one pixel. xsize and ysize specify the dimensions of the pixel array. zsize specifies what kind of image file to write out. if zsize is 1, the luminance of the pixels are calculated, and a single channel black and white image is saved. If zsize is 3, an RGB image file is saved. If zsize is 4, an RGBA image file is saved.
Added: zbuf write
Definition at line 815 of file iris.c.
References BLI_fopen(), CHANOFFSET, compressrow(), IMAGE::dim, HEADER_SIZE, IMAGIC, IMAGE::imagic, len, lumrow(), IMAGE::max, MEM_freeN, MEM_mallocN, IMAGE::min, ImBuf::name, pos, RLE, IMAGE::type, writeheader(), writetab(), IMAGE::xsize, y, IMAGE::ysize, z, and IMAGE::zsize.
Referenced by imb_saveiris().
|
static |
Definition at line 160 of file iris.c.
Referenced by writeheader(), and writetab().
|
static |
Definition at line 151 of file iris.c.
Referenced by writeheader().
|
static |
Definition at line 171 of file iris.c.
References IMAGE::dim, getshort(), IMAGE::imagic, IMAGE::type, IMAGE::xsize, IMAGE::ysize, and IMAGE::zsize.
Referenced by imb_loadiris().
|
static |
|
static |
Definition at line 219 of file iris.c.
References BIG_LONG, len, NULL, ImBuf::x, ImBuf::y, and ImBuf::zbuf.
Referenced by imb_loadiris(), and imb_saveiris().
|
static |
Definition at line 182 of file iris.c.
References IMAGE::dim, IMAGE::imagic, IMAGE::max, IMAGE::min, putlong(), putshort(), t, IMAGE::type, IMAGE::xsize, IMAGE::ysize, and IMAGE::zsize.
Referenced by output_iris().