diff options
Diffstat (limited to 'source/blender/blenpluginapi/iff.h')
-rw-r--r-- | source/blender/blenpluginapi/iff.h | 153 |
1 files changed, 26 insertions, 127 deletions
diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h index 9378cdc9134..b8628b00575 100644 --- a/source/blender/blenpluginapi/iff.h +++ b/source/blender/blenpluginapi/iff.h @@ -35,123 +35,19 @@ #include "util.h" #include "externdef.h" -#define IB_rect (1 << 0) -#define IB_planes (1 << 1) -#define IB_cmap (1 << 2) -#define IB_test (1 << 7) - -#define IB_fields (1 << 11) -#define IB_yuv (1 << 12) -#define IB_zbuf (1 << 13) -#define IB_rgba (1 << 14) - -#define JP2 (1 << 18) - -#define AMI (1 << 31) -#define PNG (1 << 30) -#define Anim (1 << 29) -#define TGA (1 << 28) -#define JPG (1 << 27) -#define BMP (1 << 26) -#ifdef WITH_QUICKTIME -#define QUICKTIME (1 << 25) -#endif -#define RADHDR (1<<24) - -#define RAWTGA (TGA | 1) - -#define JPG_STD (JPG | (0 << 8)) -#define JPG_VID (JPG | (1 << 8)) -#define JPG_JST (JPG | (2 << 8)) -#define JPG_MAX (JPG | (3 << 8)) -#define JPG_MSK (0xffffff00) - -#define AM_ham (0x0800 | AMI) -#define AM_hbrite (0x0080 | AMI) -#define AM_lace (0x0004 | AMI) -#define AM_hires (0x8000 | AMI) -#define AM_hblace (AM_hbrite | AM_lace) -#define AM_hilace (AM_hires | AM_lace) -#define AM_hamlace (AM_ham | AM_lace) - -#define RGB888 1 -#define RGB555 2 -#define DYUV 3 -#define CLUT8 4 -#define CLUT7 5 -#define CLUT4 6 -#define CLUT3 7 -#define RL7 8 -#define RL3 9 -#define MPLTE 10 - -#define DYUV1 0 -#define C233 1 -#define YUVX 2 -#define HAMX 3 -#define TANX 4 - -#define AN_c233 (Anim | C233) -#define AN_yuvx (Anim | YUVX) -#define AN_hamx (Anim | HAMX) -#define AN_tanx (Anim | TANX) - -#define IS_amiga(x) (x->ftype & AMI) -#define IS_ham(x) ((x->ftype & AM_ham) == AM_ham) -#define IS_hbrite(x) ((x->ftype & AM_hbrite) == AM_hbrite) - -#define IS_lace(x) ((x->ftype & AM_lace) == AM_lace) -#define IS_hires(x) ((x->ftype & AM_hires) == AM_hires) -#define IS_hblace(x) ((x->ftype & AM_hblace) == AM_hblace) -#define IS_hilace(x) ((x->ftype & AM_hilace) == AM_hilace) -#define IS_hamlace(x) ((x->ftype & AM_hamlace) == AM_hamlace) - -#define IS_anim(x) (x->ftype & Anim) -#define IS_hamx(x) (x->ftype == AN_hamx) -#define IS_tga(x) (x->ftype & TGA) -#define IS_png(x) (x->ftype & PNG) -#define IS_bmp(x) (x->ftype & BMP) -#define IS_radhdr(x) (x->ftype & RADHDR) -#define IS_tim(x) (x->ftype & TIM) -#define IS_tiff(x) (x->ftype & TIFF) -#define IS_openexr(x) (x->ftype & OPENEXR) -#define IS_jp2(x) (x->ftype & JP2) - - -#define IMAGIC 0732 -#define IS_iris(x) (x->ftype == IMAGIC) - -#define IS_jpg(x) (x->ftype & JPG) -#define IS_stdjpg(x) ((x->ftype & JPG_MSK) == JPG_STD) -#define IS_vidjpg(x) ((x->ftype & JPG_MSK) == JPG_VID) -#define IS_jstjpg(x) ((x->ftype & JPG_MSK) == JPG_JST) -#define IS_maxjpg(x) ((x->ftype & JPG_MSK) == JPG_MAX) - -#define AN_INIT an_stringdec = stringdec; an_stringenc = stringenc; - -#define IB_MIPMAP_LEVELS 10 - -struct MEM_CacheLimiterHandle_s; +struct ImMetaData; + +#define IB_MIPMAP_LEVELS 20 +#define IB_FILENAME_SIZE 1023 typedef struct ImBuf { struct ImBuf *next, *prev; /**< allow lists of ImBufs, for caches or flipbooks */ short x, y; /**< width and Height of our image buffer */ - short skipx; /**< Width in ints to get to the next scanline */ unsigned char depth; /**< Active amount of bits/bitplanes */ - unsigned char cbits; /**< Amount of active bits in cmap */ - unsigned short mincol; /**< smallest color in colormap */ - unsigned short maxcol; /**< Largest color in colormap */ - int type; /**< 0=abgr, 1=bitplanes */ - int ftype; /**< File type we are going to save as */ - unsigned int *cmap; /**< Color map data. */ unsigned int *rect; /**< pixel values stored here */ - unsigned int **planes; /**< bitplanes */ + unsigned int *crect; /**< color corrected pixel values stored here */ int flags; /**< Controls which components should exist. */ int mall; /**< what is malloced internal, and can be freed */ - short xorig, yorig; /**< Cordinates of first pixel of an image used in some formats (example: targa) */ - char name[1023]; /**< The file name assocated with this image */ - char namenull; /**< Unused don't want to remove it thought messes things up */ - int userflags; /**< Used to set imbuf to Dirty and other stuff */ int *zbuf; /**< z buffer data, original zbuffer */ float *zbuf_float; /**< z buffer data, camera coordinates */ void *userdata; /**< temporary storage, only used by baking at the moment */ @@ -159,34 +55,43 @@ typedef struct ImBuf { unsigned int encodedsize; /**< Size of data written to encodedbuffer */ unsigned int encodedbuffersize; /**< Size of encodedbuffer */ - float *rect_float; /**< floating point Rect equivilant */ + float *rect_float; /**< floating point Rect equivalent + Linear RGB color space - may need gamma correction to + sRGB when generating 8bit representations */ int channels; /**< amount of channels in rect_float (0 = 4 channel default) */ float dither; /**< random dither value, for conversion from float -> byte rect */ - - struct MEM_CacheLimiterHandle_s * c_handle; /**< handle for cache limiter */ - struct ImgInfo * img_info; - int refcounter; /**< Refcounter for multiple users */ - int index; /**< reference index for ImBuf lists */ - + short profile; /** color space/profile preset that the byte rect buffer represents */ + char profile_filename[256]; /** to be implemented properly, specific filename for custom profiles */ + + /* mipmapping */ struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /**< MipMap levels, a series of halved images */ + int miplevels; + + /* externally used flags */ + int index; /* reference index for ImBuf lists */ + int userflags; /* used to set imbuf to dirty and other stuff */ + struct ImMetaData *metadata; + + /* file information */ + int ftype; /* file type we are going to save as */ + char name[IB_FILENAME_SIZE]; /* filename associated with this image */ + + /* memory cache limiter */ + struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter */ + int refcounter; /* reference counter for multiple users */ } ImBuf; LIBIMPORT struct ImBuf *allocImBuf(short,short,uchar,uint,uchar); LIBIMPORT struct ImBuf *dupImBuf(struct ImBuf *); LIBIMPORT void freeImBuf(struct ImBuf*); -LIBIMPORT short converttocmap(struct ImBuf* ibuf); - LIBIMPORT short saveiff(struct ImBuf *,char *,int); -LIBIMPORT struct ImBuf *loadiffmem(int *,int); LIBIMPORT struct ImBuf *loadifffile(int,int); LIBIMPORT struct ImBuf *loadiffname(char *,int); LIBIMPORT struct ImBuf *testiffname(char *,int); LIBIMPORT struct ImBuf *onehalf(struct ImBuf *); -LIBIMPORT struct ImBuf *onethird(struct ImBuf *); -LIBIMPORT struct ImBuf *halflace(struct ImBuf *); LIBIMPORT struct ImBuf *half_x(struct ImBuf *); LIBIMPORT struct ImBuf *half_y(struct ImBuf *); LIBIMPORT struct ImBuf *double_x(struct ImBuf *); @@ -196,17 +101,11 @@ LIBIMPORT struct ImBuf *double_fast_y(struct ImBuf *); LIBIMPORT int ispic(char *); -LIBIMPORT void dit2(struct ImBuf *, short, short); -LIBIMPORT void dit0(struct ImBuf *, short, short); - LIBIMPORT struct ImBuf *scaleImBuf(struct ImBuf *, short, short); LIBIMPORT struct ImBuf *scalefastImBuf(struct ImBuf *, short, short); -LIBIMPORT struct ImBuf *scalefieldImBuf(struct ImBuf *, short, short); -LIBIMPORT struct ImBuf *scalefastfieldImBuf(struct ImBuf *, short, short); LIBIMPORT void de_interlace(struct ImBuf *ib); LIBIMPORT void interlace(struct ImBuf *ib); -LIBIMPORT void gamwarp(struct ImBuf *ibuf, double gamma); LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, int desty, int srcx, int srcy, int width, int height); |