Blender
V3.3
|
#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 |
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 (const uchar *lbuf, uchar *rlebuf, int z, int row_len) |
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 (const char *filepath, const uint *lptr, const int *zptr, const int xsize, const int ysize, const int zsize) |
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_STEP | ( | inf, | |
step | |||
) |
typedef struct MFileOffset MFileOffset |
BLI_STATIC_ASSERT | ( | sizeof(IMAGE) | = =HEADER_SIZE , |
"Invalid header size" | |||
) |
|
static |
Definition at line 696 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 608 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 125 of file iris.c.
References MFILE_DATA, and MFILE_STEP.
Referenced by readtab().
|
static |
Definition at line 115 of file iris.c.
References MFILE_DATA, and MFILE_STEP.
Referenced by readheader().
struct ImBuf* imb_loadiris | ( | const unsigned char * | mem, |
size_t | size, | ||
int | flags, | ||
char | colorspace[IM_MAX_SPACE] | ||
) |
Read in a B/W RGB or RGBA iris image file and return an image buffer.
Definition at line 238 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, 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(), x, ImBuf::x, y, ImBuf::y, z, and ImBuf::zbuf.
Definition at line 961 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 890 of file iris.c.
References CHANOFFSET, ILUM, OFFSET_B, OFFSET_G, and OFFSET_R.
Referenced by output_iris().
|
static |
filepath | The file path to write to. |
lptr | an array of integers to an iris image file (each int represents one pixel). |
zptr | depth-buffer (optional, may be NULL). |
xsize | with width of the pixel-array. |
ysize | height of the pixel-array. |
zsize | specifies what kind of image file to write out.
|
Definition at line 794 of file iris.c.
References BLI_assert_msg, BLI_fopen(), CHANOFFSET, compressrow(), HEADER_SIZE, image(), IMAGIC, len, lumrow(), MEM_freeN, MEM_mallocN, pos, RLE, writeheader(), writetab(), y, and z.
Referenced by imb_saveiris().
|
static |
Definition at line 144 of file iris.c.
Referenced by writeheader(), and writetab().
Definition at line 135 of file iris.c.
Referenced by writeheader().
|
static |
Definition at line 155 of file iris.c.
References getshort(), and image().
Referenced by imb_loadiris().
|
static |
Definition at line 203 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 166 of file iris.c.
References image(), putlong(), putshort(), and t.
Referenced by output_iris().