~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/imbuf/IMB_imbuf_types.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * IMB_imbuf_types.h (mar-2001 nzc)
3
 
 *
4
 
 * Types needed for using the image buffer.
5
 
 *
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.
9
 
 *
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).
13
 
 *
14
 
 *
15
2
 * ***** BEGIN GPL LICENSE BLOCK *****
16
3
 *
17
4
 * This program is free software; you can redistribute it and/or
37
24
 *
38
25
 * ***** END GPL LICENSE BLOCK *****
39
26
 */
 
27
 
 
28
#ifndef __IMB_IMBUF_TYPES_H__
 
29
#define __IMB_IMBUF_TYPES_H__
 
30
 
 
31
#include "DNA_vec_types.h"  /* for rcti */
 
32
 
40
33
/**
41
34
 * \file IMB_imbuf_types.h
42
35
 * \ingroup imbuf
43
36
 * \brief Contains defines and structs used throughout the imbuf module.
44
37
 * \todo Clean up includes.
 
38
 *
 
39
 * Types needed for using the image buffer.
 
40
 *
 
41
 * Imbuf is external code, slightly adapted to live in the Blender
 
42
 * context. It requires an external jpeg module, and the avi-module
 
43
 * (also external code) in order to function correctly.
 
44
 *
 
45
 * This file contains types and some constants that go with them. Most
 
46
 * are self-explanatory (e.g. IS_amiga tests whether the buffer
 
47
 * contains an Amiga-format file).
45
48
 */
46
49
 
47
 
#ifndef __IMB_IMBUF_TYPES_H__
48
 
#define __IMB_IMBUF_TYPES_H__
49
 
 
50
50
struct ImMetaData;
51
51
 
52
52
#define IB_MIPMAP_LEVELS        20
53
53
#define IB_FILENAME_SIZE        1024
54
54
 
 
55
typedef struct DDSData {
 
56
        unsigned int fourcc; /* DDS fourcc info */
 
57
        unsigned int nummipmaps; /* The number of mipmaps in the dds file */
 
58
        unsigned char *data; /* The compressed image data */
 
59
        unsigned int size; /* The size of the compressed data */
 
60
} DDSData;
 
61
 
55
62
/**
56
63
 * \ingroup imbuf
57
64
 * This is the abstraction of an image.  ImBuf is the basic type used for all
58
65
 * imbuf operations.
59
66
 *
60
 
 * REMINDER: if any changes take place, they need to be carried over
61
 
 * to source/blender/blenpluginapi/iff.h too, OTHERWISE PLUGINS WON'T
62
 
 * WORK CORRECTLY!
63
 
 *
64
67
 * Also; add new variables to the end to save pain!
65
68
 *
66
 
 * Also, that iff.h needs to be in the final release "plugins/include" dir, too!
67
69
 */
68
70
typedef struct ImBuf {
69
71
        struct ImBuf *next, *prev;      /**< allow lists of ImBufs, for caches or flipbooks */
93
95
        /* tiled pixel storage */
94
96
        int tilex, tiley;
95
97
        int xtiles, ytiles;
96
 
        unsigned int **tiles;   
 
98
        unsigned int **tiles;
97
99
 
98
100
        /* zbuffer */
99
101
        int     *zbuf;                          /* z buffer data, original zbuffer */
101
103
 
102
104
        /* parameters used by conversion between byte and float */
103
105
        float dither;                           /* random dither value, for conversion from float -> byte rect */
104
 
        short profile;                          /* color space/profile preset that the byte rect buffer represents */
105
106
 
106
107
        /* mipmapping */
107
108
        struct ImBuf *mipmap[IB_MIPMAP_LEVELS]; /* MipMap levels, a series of halved images */
126
127
        unsigned char *encodedbuffer;     /* Compressed image only used with png currently */
127
128
        unsigned int   encodedsize;       /* Size of data written to encodedbuffer */
128
129
        unsigned int   encodedbuffersize; /* Size of encodedbuffer */
 
130
 
 
131
        /* color management */
 
132
        struct ColorSpace *rect_colorspace;          /* color space of byte buffer */
 
133
        struct ColorSpace *float_colorspace;         /* color space of float buffer, used by sequencer only */
 
134
        unsigned int *display_buffer_flags;          /* array of per-display display buffers dirty flags */
 
135
        struct ColormanageCache *colormanage_cache;  /* cache used by color management */
 
136
        int colormanage_flag;
 
137
        rcti invalid_rect;
 
138
 
 
139
        /* information for compressed textures */
 
140
        struct DDSData dds_data;
129
141
} ImBuf;
130
142
 
131
143
/* Moved from BKE_bmfont_types.h because it is a userflag bit mask. */
133
145
 * \brief userflags: Flags used internally by blender for imagebuffers
134
146
 */
135
147
 
136
 
#define IB_BITMAPFONT           (1 << 0)        /* this image is a font */
137
 
#define IB_BITMAPDIRTY          (1 << 1)        /* image needs to be saved is not the same as filename */
138
 
#define IB_MIPMAP_INVALID       (1 << 2)        /* image mipmaps are invalid, need recreate */
139
 
#define IB_RECT_INVALID         (1 << 3)    /* float buffer changed, needs recreation of byte rect */
 
148
#define IB_BITMAPFONT                   (1 << 0)        /* this image is a font */
 
149
#define IB_BITMAPDIRTY                  (1 << 1)        /* image needs to be saved is not the same as filename */
 
150
#define IB_MIPMAP_INVALID               (1 << 2)        /* image mipmaps are invalid, need recreate */
 
151
#define IB_RECT_INVALID                 (1 << 3)        /* float buffer changed, needs recreation of byte rect */
 
152
#define IB_DISPLAY_BUFFER_INVALID       (1 << 4)        /* either float or byte buffer changed, need to re-calculate display buffers */
140
153
 
141
154
/**
142
155
 * \name Imbuf Component flags
157
170
#define IB_animdeinterlace      (1 << 9)
158
171
#define IB_tiles                        (1 << 10)
159
172
#define IB_tilecache            (1 << 11)
160
 
#define IB_premul                       (1 << 12)
161
 
#define IB_cm_predivide         (1 << 13)
 
173
#define IB_alphamode_premul     (1 << 12)  /* indicates whether image on disk have premul alpha */
 
174
#define IB_alphamode_detect     (1 << 13)  /* if this flag is set, alpha mode would be guessed from file */
 
175
#define IB_ignore_alpha         (1 << 14)  /* ignore alpha on load and substitude it with 1.0f */
162
176
 
163
177
/*
164
178
 * The bit flag is stored in the ImBuf.ftype variable.
165
 
 * Note that the lower 10 bits is used for storing custom flags 
 
179
 * Note that the lower 11 bits is used for storing custom flags
166
180
 */
 
181
#define IB_CUSTOM_FLAGS_MASK 0x7ff
 
182
 
167
183
#define PNG                             (1 << 30)
168
184
#define TGA                             (1 << 28)
169
185
#define JPG                             (1 << 27)
188
204
#ifdef WITH_CINEON
189
205
#define CINEON                  (1 << 21)
190
206
#define DPX                             (1 << 20)
 
207
#define CINEON_LOG              (1 << 8)
 
208
#define CINEON_16BIT    (1 << 7)
 
209
#define CINEON_12BIT    (1 << 6)
 
210
#define CINEON_10BIT    (1 << 5)
191
211
#endif
192
212
 
193
213
#ifdef WITH_DDS
201
221
#define JP2_YCC                 (1 << 15)
202
222
#define JP2_CINE                (1 << 14)
203
223
#define JP2_CINE_48FPS  (1 << 13) 
 
224
#define JP2_JP2 (1 << 12)
 
225
#define JP2_J2K (1 << 11)
204
226
#endif
205
227
 
 
228
#define PNG_16BIT                       (1 << 10)
 
229
 
206
230
#define RAWTGA          (TGA | 1)
207
231
 
208
232
#define JPG_STD         (JPG | (0 << 8))
222
246
#define IB_PROFILE_SRGB                 2
223
247
#define IB_PROFILE_CUSTOM               3
224
248
 
 
249
/* dds */
 
250
#ifdef WITH_DDS
 
251
#ifndef MAKEFOURCC
 
252
#define MAKEFOURCC(ch0, ch1, ch2, ch3)\
 
253
        ((unsigned long)(unsigned char)(ch0) | \
 
254
        ((unsigned long)(unsigned char)(ch1) << 8) | \
 
255
        ((unsigned long)(unsigned char)(ch2) << 16) | \
 
256
        ((unsigned long)(unsigned char)(ch3) << 24))
 
257
#endif  /* MAKEFOURCC */
 
258
 
 
259
/*
 
260
 * FOURCC codes for DX compressed-texture pixel formats
 
261
 */
 
262
 
 
263
#define FOURCC_DDS   (MAKEFOURCC('D','D','S',' '))
 
264
#define FOURCC_DXT1  (MAKEFOURCC('D','X','T','1'))
 
265
#define FOURCC_DXT2  (MAKEFOURCC('D','X','T','2'))
 
266
#define FOURCC_DXT3  (MAKEFOURCC('D','X','T','3'))
 
267
#define FOURCC_DXT4  (MAKEFOURCC('D','X','T','4'))
 
268
#define FOURCC_DXT5  (MAKEFOURCC('D','X','T','5'))
 
269
 
 
270
#endif  /* DDS */
225
271
extern const char *imb_ext_image[];
226
272
extern const char *imb_ext_image_qt[];
227
273
extern const char *imb_ext_movie[];
228
274
extern const char *imb_ext_audio[];
229
275
 
 
276
enum {
 
277
        IMB_COLORMANAGE_IS_DATA = (1 << 0)
 
278
};
 
279
 
230
280
#endif