Blender V2.61 - r43446
Classes | Defines | Functions | Variables

iris.c File Reference

#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 ImBufimb_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 ucharfile_data
static int file_offset

Detailed Description

Definition in file iris.c.


Define Documentation

#define BINTLUM   (21)

Definition at line 75 of file iris.c.

#define BPP (   type)    ((type) & BPPMASK)

Definition at line 92 of file iris.c.

Referenced by imb_loadiris().

#define BPPMASK   0x00ff

Definition at line 87 of file iris.c.

#define CHANOFFSET (   z)    (3-(z))

Definition at line 84 of file iris.c.

Referenced by lumrow(), and output_iris().

#define GINTLUM   (156)

Definition at line 74 of file iris.c.

#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().

#define GSS (   x)    (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0])

Definition at line 235 of file iris.c.

Referenced by imb_is_a_iris().

#define IBUFSIZE (   pixels)    ((pixels+(pixels>>6))<<2)

Definition at line 95 of file iris.c.

#define ILUM (   r,
  g,
 
)    ((int)(RINTLUM*(r)+GINTLUM*(g)+BINTLUM*(b))>>8)

Definition at line 77 of file iris.c.

Referenced by lumrow().

#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)

Definition at line 91 of file iris.c.

#define ITYPE_RLE   0x0100

Definition at line 89 of file iris.c.

#define ITYPE_VERBATIM   0x0000

Definition at line 88 of file iris.c.

#define OFFSET_A   3

Definition at line 82 of file iris.c.

#define OFFSET_B   2

Definition at line 81 of file iris.c.

Referenced by lumrow().

#define OFFSET_G   1

Definition at line 80 of file iris.c.

Referenced by lumrow().

#define OFFSET_R   0

Definition at line 79 of file iris.c.

Referenced by lumrow().

#define RINTLUM   (79)

Definition at line 73 of file iris.c.

#define RLE (   bpp)    (ITYPE_RLE | (bpp))

Definition at line 93 of file iris.c.

Referenced by output_iris().

#define RLE_NOP   0x00

Definition at line 96 of file iris.c.

#define TYPEMASK   0xff00

Definition at line 86 of file iris.c.

#define VERBATIM (   bpp)    (ITYPE_VERBATIM | (bpp))

Definition at line 94 of file iris.c.


Function Documentation

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)

Definition at line 237 of file iris.c.

References GS, GSS, and IMAGIC.

Referenced by imb_loadiris().

struct ImBuf* imb_loadiris ( unsigned char *  mem,
size_t  size,
int  flags 
) [read]
int imb_saveiris ( struct ImBuf ibuf,
const char *  name,
int  flags 
)
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]

Definition at line 206 of file iris.c.

References getlong().

Referenced by imb_loadiris().

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]
static int writetab ( FILE *  outf,
unsigned int *  tab,
int  len 
) [static]

Definition at line 195 of file iris.c.

References putlong().

Referenced by output_iris().


Variable Documentation

uchar* file_data [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().