2 * IMB_imbuf_types.h (mar-2001 nzc)
4 * Types needed for using the image buffer.
6 * Imbuf is external code, slightly adapted to live in the Blender
7 * context. It requires an external jpeg module, and the avi-module
8 * (also external code) in order to function correctly.
10 * This file contains types and some constants that go with them. Most
11 * are self-explanatory (e.g. IS_amiga tests whether the buffer
12 * contains an Amiga-format file).
16 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version. The Blender
22 * Foundation also sells licenses for use in proprietary software under
23 * the Blender License. See http://www.blender.org/BL/ for information
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software Foundation,
33 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
36 * All rights reserved.
38 * The Original Code is: all of this file.
40 * Contributor(s): none yet.
42 * ***** END GPL/BL DUAL LICENSE BLOCK *****
45 #ifndef IMB_IMBUF_TYPES_H
46 #define IMB_IMBUF_TYPES_H
48 #include <stdio.h> /* for size_t */
49 #include "DNA_listBase.h" /* for ListBase */
53 /* the basic imbuf type */
56 short x,y; /* width in pixels, height in scanlines */
57 short skipx; /* width in ints to get to the next scanline */
58 unsigned char depth; /* active amount of bits/bitplanes */
59 unsigned char cbits; /* amount of active bits in cmap */
60 unsigned short mincol;
61 unsigned short maxcol;
62 int type; /* 0=abgr, 1=bitplanes */
64 unsigned int *cmap; /* int array van kleuren */
65 unsigned int *rect; /* databuffer */
66 unsigned int **planes; /* bitplanes */
68 int mall; /* what is malloced internal, and can be freed */
75 unsigned char *encodedbuffer;
76 unsigned int encodedsize;
77 unsigned int encodedbuffersize;
80 /* Moved from BKE_bmfont_types.h because it is a userflag bit mask. */
82 IB_BITMAPFONT = 1 << 0,
83 IB_BITMAPDIRTY = 1 << 1
84 } ImBuf_userflagsMask;
87 /* From iff.h. This was once moved away by Frank, now Nzc moves it
88 * back. Such is the way it is... It is a long list of defines, and
89 * there are a few external defines in the back. Most of the stuff is
90 * probably imbuf_intern only. This will need to be merged later
93 #define IB_rect (1 << 0)
94 #define IB_planes (1 << 1)
95 #define IB_cmap (1 << 2)
97 #define IB_vert (1 << 4)
98 #define IB_freem (1 << 6)
99 #define IB_test (1 << 7)
101 #define IB_ttob (1 << 8)
102 #define IB_subdlta (1 << 9)
103 #define IB_fields (1 << 11)
104 #define IB_zbuf (1 << 13)
106 #define IB_mem (1 << 14)
108 #define AMI (1 << 31)
109 #define PNG (1 << 30)
110 #define Anim (1 << 29)
111 #define TGA (1 << 28)
112 #define JPG (1 << 27)
113 #define BMP (1 << 26)
114 #ifdef WITH_QUICKTIME
115 #define QUICKTIME (1 << 25)
117 #ifdef WITH_FREEIMAGE
118 #define FREEIMAGE (1 << 24)
120 #ifdef WITH_IMAGEMAGICK
121 #define IMAGEMAGICK (1 << 23)
124 #define RAWTGA (TGA | 1)
126 #define JPG_STD (JPG | (0 << 8))
127 #define JPG_VID (JPG | (1 << 8))
128 #define JPG_JST (JPG | (2 << 8))
129 #define JPG_MAX (JPG | (3 << 8))
130 #define JPG_MSK (0xffffff00)
132 #define AM_ham (0x0800 | AMI)
133 #define AM_hbrite (0x0080 | AMI)
140 #define AN_c233 (Anim | C233)
141 #define AN_yuvx (Anim | YUVX)
142 #define AN_hamx (Anim | HAMX)
143 #define AN_tanx (Anim | TANX)
145 #define IS_amiga(x) (x->ftype & AMI)
146 #define IS_ham(x) ((x->ftype & AM_ham) == AM_ham)
147 #define IS_hbrite(x) ((x->ftype & AM_hbrite) == AM_hbrite)
149 #define IS_anim(x) (x->ftype & Anim)
150 #define IS_hamx(x) (x->ftype == AN_hamx)
151 #define IS_tga(x) (x->ftype & TGA)
152 #define IS_png(x) (x->ftype & PNG)
153 #define IS_bmp(x) (x->ftype & BMP)
156 #define IS_iris(x) (x->ftype == IMAGIC)
158 #define IS_jpg(x) (x->ftype & JPG)
159 #define IS_stdjpg(x) ((x->ftype & JPG_MSK) == JPG_STD)
160 #define IS_vidjpg(x) ((x->ftype & JPG_MSK) == JPG_VID)
161 #define IS_jstjpg(x) ((x->ftype & JPG_MSK) == JPG_JST)
162 #define IS_maxjpg(x) ((x->ftype & JPG_MSK) == JPG_MAX)