OLD | NEW |
1 /* | 1 /* |
2 * IMB_imbuf_types.h (mar-2001 nzc) | 2 * IMB_imbuf_types.h (mar-2001 nzc) |
3 * | 3 * |
4 * Types needed for using the image buffer. | 4 * Types needed for using the image buffer. |
5 * | 5 * |
6 * Imbuf is external code, slightly adapted to live in the Blender | 6 * Imbuf is external code, slightly adapted to live in the Blender |
7 * context. It requires an external jpeg module, and the avi-module | 7 * context. It requires an external jpeg module, and the avi-module |
8 * (also external code) in order to function correctly. | 8 * (also external code) in order to function correctly. |
9 * | 9 * |
10 * This file contains types and some constants that go with them. Most | 10 * This file contains types and some constants that go with them. Most |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 */ | 46 */ |
47 | 47 |
48 #ifndef IMB_IMBUF_TYPES_H | 48 #ifndef IMB_IMBUF_TYPES_H |
49 #define IMB_IMBUF_TYPES_H | 49 #define IMB_IMBUF_TYPES_H |
50 | 50 |
51 struct ImMetaData; | 51 struct ImMetaData; |
52 | 52 |
53 #define IB_MIPMAP_LEVELS 20 | 53 #define IB_MIPMAP_LEVELS 20 |
54 #define IB_FILENAME_SIZE 1023 | 54 #define IB_FILENAME_SIZE 1023 |
55 | 55 |
| 56 typedef struct DDSData { |
| 57 unsigned int fourcc; /* DDS fourcc info */ |
| 58 unsigned int nummipmaps; /* The number of mipmaps in the dds file */ |
| 59 unsigned char *data; /* The compressed image data */ |
| 60 unsigned int size; /* The size of the compressed data */ |
| 61 } DDSData; |
| 62 |
56 /** | 63 /** |
57 * \ingroup imbuf | 64 * \ingroup imbuf |
58 * This is the abstraction of an image. ImBuf is the basic type used for all | 65 * This is the abstraction of an image. ImBuf is the basic type used for all |
59 * imbuf operations. | 66 * imbuf operations. |
60 * | 67 * |
61 * REMINDER: if any changes take place, they need to be carried over | 68 * REMINDER: if any changes take place, they need to be carried over |
62 * to source/blender/blenpluginapi/iff.h too, OTHERWISE PLUGINS WON'T | 69 * to source/blender/blenpluginapi/iff.h too, OTHERWISE PLUGINS WON'T |
63 * WORK CORRECTLY! | 70 * WORK CORRECTLY! |
64 * | 71 * |
65 * Also; add new variables to the end to save pain! | 72 * Also; add new variables to the end to save pain! |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 char cachename[IB_FILENAME_SIZE]; /* full filename used for readin
g from cache */ | 127 char cachename[IB_FILENAME_SIZE]; /* full filename used for readin
g from cache */ |
121 | 128 |
122 /* memory cache limiter */ | 129 /* memory cache limiter */ |
123 struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter *
/ | 130 struct MEM_CacheLimiterHandle_s *c_handle; /* handle for cache limiter *
/ |
124 int refcounter; /* reference counter for multiple users */ | 131 int refcounter; /* reference counter for multiple users */ |
125 | 132 |
126 /* some parameters to pass along for packing images */ | 133 /* some parameters to pass along for packing images */ |
127 unsigned char *encodedbuffer; /* Compressed image only used with png
currently */ | 134 unsigned char *encodedbuffer; /* Compressed image only used with png
currently */ |
128 unsigned int encodedsize; /* Size of data written to encodedbuff
er */ | 135 unsigned int encodedsize; /* Size of data written to encodedbuff
er */ |
129 unsigned int encodedbuffersize; /* Size of encodedbuffer */ | 136 unsigned int encodedbuffersize; /* Size of encodedbuffer */ |
| 137 |
| 138 /* information for compressed textures */ |
| 139 struct DDSData dds_data; |
130 } ImBuf; | 140 } ImBuf; |
131 | 141 |
132 /* Moved from BKE_bmfont_types.h because it is a userflag bit mask. */ | 142 /* Moved from BKE_bmfont_types.h because it is a userflag bit mask. */ |
133 /** | 143 /** |
134 * \brief userflags: Flags used internally by blender for imagebuffers | 144 * \brief userflags: Flags used internally by blender for imagebuffers |
135 */ | 145 */ |
136 | 146 |
137 #define IB_BITMAPFONT (1 << 0) /* this image is a font */ | 147 #define IB_BITMAPFONT (1 << 0) /* this image is a font */ |
138 #define IB_BITMAPDIRTY (1 << 1) /* image needs to be saved is no
t the same as filename */ | 148 #define IB_BITMAPDIRTY (1 << 1) /* image needs to be saved is no
t the same as filename */ |
139 #define IB_MIPMAP_INVALID (1 << 2) /* image mipmaps are invalid, ne
ed recreate */ | 149 #define IB_MIPMAP_INVALID (1 << 2) /* image mipmaps are invalid, ne
ed recreate */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 225 |
216 /** | 226 /** |
217 * \name Imbuf preset profile tags | 227 * \name Imbuf preset profile tags |
218 * \brief Some predefined color space profiles that 8 bit imbufs can represent | 228 * \brief Some predefined color space profiles that 8 bit imbufs can represent |
219 */ | 229 */ |
220 #define IB_PROFILE_NONE 0 | 230 #define IB_PROFILE_NONE 0 |
221 #define IB_PROFILE_LINEAR_RGB 1 | 231 #define IB_PROFILE_LINEAR_RGB 1 |
222 #define IB_PROFILE_SRGB 2 | 232 #define IB_PROFILE_SRGB 2 |
223 #define IB_PROFILE_CUSTOM 3 | 233 #define IB_PROFILE_CUSTOM 3 |
224 | 234 |
| 235 |
| 236 /* dds */ |
| 237 #ifdef WITH_DDS |
| 238 #ifndef MAKEFOURCC |
| 239 #define MAKEFOURCC(ch0, ch1, ch2, ch3)\ |
| 240 ((unsigned long)(unsigned char)(ch0) | \ |
| 241 ((unsigned long)(unsigned char)(ch1) << 8) | \ |
| 242 ((unsigned long)(unsigned char)(ch2) << 16) | \ |
| 243 ((unsigned long)(unsigned char)(ch3) << 24)) |
| 244 #endif //MAKEFOURCC |
| 245 |
| 246 /* |
| 247 * FOURCC codes for DX compressed-texture pixel formats |
| 248 */ |
| 249 |
| 250 #define FOURCC_DDS (MAKEFOURCC('D','D','S',' ')) |
| 251 #define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1')) |
| 252 #define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2')) |
| 253 #define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3')) |
| 254 #define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4')) |
| 255 #define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5')) |
| 256 |
| 257 #endif // DDS |
225 extern const char *imb_ext_image[]; | 258 extern const char *imb_ext_image[]; |
226 extern const char *imb_ext_image_qt[]; | 259 extern const char *imb_ext_image_qt[]; |
227 extern const char *imb_ext_movie[]; | 260 extern const char *imb_ext_movie[]; |
228 extern const char *imb_ext_audio[]; | 261 extern const char *imb_ext_audio[]; |
229 | |
230 #endif | 262 #endif |
OLD | NEW |