Blender V2.61 - r43446
|
#include <string.h>
#include "BLI_blenlib.h"
#include "MEM_guardedalloc.h"
#include "imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
#include "IMB_filetype.h"
Go to the source code of this file.
Classes | |
struct | IMAGE |
Defines | |
#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 |
#define | OFFSET_G 1 |
#define | OFFSET_B 2 |
#define | OFFSET_A 3 |
#define | CHANOFFSET(z) (3-(z)) |
#define | TYPEMASK 0xff00 |
#define | BPPMASK 0x00ff |
#define | ITYPE_VERBATIM 0x0000 |
#define | ITYPE_RLE 0x0100 |
#define | ISRLE(type) (((type) & 0xff00) == ITYPE_RLE) |
#define | ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM) |
#define | BPP(type) ((type) & BPPMASK) |
#define | RLE(bpp) (ITYPE_RLE | (bpp)) |
#define | VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) |
#define | IBUFSIZE(pixels) ((pixels+(pixels>>6))<<2) |
#define | RLE_NOP 0x00 |
#define | GS(x) (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) |
#define | GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) |
Functions | |
static void | readheader (FILE *inf, IMAGE *image) |
static int | writeheader (FILE *outf, IMAGE *image) |
static unsigned short | getshort (FILE *inf) |
static unsigned int | getlong (FILE *inf) |
static void | putshort (FILE *outf, unsigned short val) |
static int | putlong (FILE *outf, unsigned int val) |
static int | writetab (FILE *outf, unsigned int *tab, int len) |
static void | readtab (FILE *inf, unsigned int *tab, int len) |
static void | expandrow (unsigned char *optr, unsigned char *iptr, int z) |
static void | expandrow2 (float *optr, unsigned char *iptr, int z) |
static void | interleaverow (unsigned char *lptr, unsigned char *cptr, int z, int n) |
static void | interleaverow2 (float *lptr, unsigned char *cptr, int z, int n) |
static int | compressrow (unsigned char *lbuf, unsigned char *rlebuf, int z, int cnt) |
static void | lumrow (unsigned char *rgbptr, unsigned char *lumptr, int n) |
static void | test_endian_zbuf (struct ImBuf *ibuf) |
int | imb_is_a_iris (unsigned char *mem) |
struct ImBuf * | imb_loadiris (unsigned char *mem, size_t size, int flags) |
static int | output_iris (unsigned int *lptr, int xsize, int ysize, int zsize, const char *name, int *zptr) |
int | imb_saveiris (struct ImBuf *ibuf, const char *name, int flags) |
Variables | |
static uchar * | file_data |
static int | file_offset |
Definition in file iris.c.
#define BPP | ( | type | ) | ((type) & BPPMASK) |
Definition at line 92 of file iris.c.
Referenced by imb_loadiris().
#define CHANOFFSET | ( | z | ) | (3-(z)) |
Definition at line 84 of file iris.c.
Referenced by lumrow(), and output_iris().
#define GS | ( | x | ) | (((unsigned char *)(x))[0] << 8 | ((unsigned char *)(x))[1]) |
Definition at line 232 of file iris.c.
Referenced by imb_is_a_iris().
Definition at line 235 of file iris.c.
Referenced by imb_is_a_iris().
#define ISRLE | ( | type | ) | (((type) & 0xff00) == ITYPE_RLE) |
Definition at line 90 of file iris.c.
Referenced by imb_loadiris().
#define ISVERBATIM | ( | type | ) | (((type) & 0xff00) == ITYPE_VERBATIM) |
#define RLE | ( | bpp | ) | (ITYPE_RLE | (bpp)) |
Definition at line 93 of file iris.c.
Referenced by output_iris().
static int compressrow | ( | unsigned char * | lbuf, |
unsigned char * | rlebuf, | ||
int | z, | ||
int | cnt | ||
) | [static] |
Definition at line 762 of file iris.c.
Referenced by output_iris().
static void expandrow | ( | unsigned char * | optr, |
unsigned char * | iptr, | ||
int | z | ||
) | [static] |
Definition at line 604 of file iris.c.
Referenced by imb_loadiris().
static void expandrow2 | ( | float * | optr, |
unsigned char * | iptr, | ||
int | z | ||
) | [static] |
Definition at line 549 of file iris.c.
Referenced by imb_loadiris().
static unsigned int getlong | ( | FILE * | inf | ) | [static] |
Definition at line 135 of file iris.c.
References file_data, and file_offset.
Referenced by readtab().
static unsigned short getshort | ( | FILE * | inf | ) | [static] |
Definition at line 124 of file iris.c.
References file_data, and file_offset.
Referenced by readheader().
int imb_is_a_iris | ( | unsigned char * | mem | ) |
struct ImBuf* imb_loadiris | ( | unsigned char * | mem, |
size_t | size, | ||
int | flags | ||
) | [read] |
Definition at line 249 of file iris.c.
References BPP, expandrow(), expandrow2(), file_data, file_offset, ImBuf::ftype, IB_PROFILE_SRGB, IB_rect, IB_rectfloat, IB_test, if(), IMAGE::imagic, IMAGIC, IMB_allocImBuf(), IMB_convert_rgba_to_abgr(), imb_is_a_iris(), IMB_rect_from_float(), interleaverow(), interleaverow2(), ISRLE, MEM_freeN(), MEM_mallocN(), NULL, ImBuf::planes, ImBuf::profile, readheader(), readtab(), ImBuf::rect, ImBuf::rect_float, test_endian_zbuf(), IMAGE::type, ImBuf::x, IMAGE::xsize, ImBuf::y, IMAGE::ysize, ImBuf::zbuf, and IMAGE::zsize.
int imb_saveiris | ( | struct ImBuf * | ibuf, |
const char * | name, | ||
int | flags | ||
) |
Definition at line 820 of file iris.c.
References IB_zbuf, IMB_convert_rgba_to_abgr(), NULL, output_iris(), ImBuf::planes, ImBuf::rect, test_endian_zbuf(), ImBuf::x, ImBuf::y, and ImBuf::zbuf.
static void interleaverow | ( | unsigned char * | lptr, |
unsigned char * | cptr, | ||
int | z, | ||
int | n | ||
) | [static] |
Definition at line 530 of file iris.c.
Referenced by imb_loadiris().
static void interleaverow2 | ( | float * | lptr, |
unsigned char * | cptr, | ||
int | z, | ||
int | n | ||
) | [static] |
Definition at line 539 of file iris.c.
Referenced by imb_loadiris().
static void lumrow | ( | unsigned char * | rgbptr, |
unsigned char * | lumptr, | ||
int | n | ||
) | [static] |
Definition at line 752 of file iris.c.
References CHANOFFSET, ILUM, OFFSET_B, OFFSET_G, and OFFSET_R.
Referenced by output_iris().
static int output_iris | ( | unsigned int * | lptr, |
int | xsize, | ||
int | ysize, | ||
int | zsize, | ||
const char * | name, | ||
int * | zptr | ||
) | [static] |
Definition at line 666 of file iris.c.
References CHANOFFSET, compressrow(), IMAGIC, len(), lumrow(), MEM_freeN(), MEM_mallocN(), RLE, writeheader(), writetab(), and ImBuf::y.
Referenced by imb_saveiris().
static int putlong | ( | FILE * | outf, |
unsigned int | val | ||
) | [static] |
Definition at line 155 of file iris.c.
Referenced by writeheader(), and writetab().
static void putshort | ( | FILE * | outf, |
unsigned short | val | ||
) | [static] |
Definition at line 146 of file iris.c.
Referenced by writeheader().
static void readheader | ( | FILE * | inf, |
IMAGE * | image | ||
) | [static] |
Definition at line 166 of file iris.c.
References IMAGE::dim, getshort(), IMAGE::imagic, IMAGE::type, IMAGE::xsize, IMAGE::ysize, and IMAGE::zsize.
Referenced by imb_loadiris().
static void readtab | ( | FILE * | inf, |
unsigned int * | tab, | ||
int | len | ||
) | [static] |
static void test_endian_zbuf | ( | struct ImBuf * | ibuf | ) | [static] |
Definition at line 214 of file iris.c.
References BIG_LONG, len(), NULL, ImBuf::x, ImBuf::y, and ImBuf::zbuf.
Referenced by imb_loadiris(), and imb_saveiris().
static int writeheader | ( | FILE * | outf, |
IMAGE * | image | ||
) | [static] |
Definition at line 177 of file iris.c.
References IMAGE::dim, IMAGE::imagic, IMAGE::max, IMAGE::min, putlong(), putshort(), IMAGE::type, IMAGE::xsize, IMAGE::ysize, and IMAGE::zsize.
Referenced by output_iris().
static int writetab | ( | FILE * | outf, |
unsigned int * | tab, | ||
int | len | ||
) | [static] |
Definition at line 121 of file iris.c.
Referenced by getlong(), getshort(), and imb_loadiris().
int file_offset [static] |
Definition at line 122 of file iris.c.
Referenced by getlong(), getshort(), and imb_loadiris().