1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*/
/** \file DNA_image_types.h
* \ingroup DNA
*/
#ifndef __DNA_IMAGE_TYPES_H__
#define __DNA_IMAGE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
#include "DNA_color_types.h" /* for color management */
struct GPUTexture;
struct MovieCache;
struct PackedFile;
struct RenderResult;
struct Scene;
struct anim;
/* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
/* should be used in conjunction with an ID * to Image. */
typedef struct ImageUser {
struct Scene *scene; /* to retrieve render result */
int framenr; /* movies, sequences: current to display */
int frames; /* total amount of frames to use */
int offset, sfra; /* offset within movie, start frame in global time */
char fie_ima, cycl; /* fields/image in movie, cyclic flag */
char ok;
char multiview_eye; /* multiview current eye - for internal use of drawing routines */
short pass;
short pad;
short multi_index, view, layer; /* listbase indices, for menu browsing or retrieve buffer */
short flag;
} ImageUser;
typedef struct ImageAnim {
struct ImageAnim *next, *prev;
struct anim *anim;
} ImageAnim;
typedef struct ImageView {
struct ImageView *next, *prev;
char name[64]; /* MAX_NAME */
char filepath[1024]; /* 1024 = FILE_MAX */
} ImageView;
typedef struct ImagePackedFile {
struct ImagePackedFile *next, *prev;
struct PackedFile *packedfile;
char filepath[1024]; /* 1024 = FILE_MAX */
} ImagePackedFile;
typedef struct RenderSlot {
char name[64]; /* 64 = MAX_NAME */
} RenderSlot;
/* iuser->flag */
#define IMA_ANIM_ALWAYS (1 << 0)
#define IMA_ANIM_REFRESHED (1 << 1)
/* #define IMA_DO_PREMUL (1 << 2) */
#define IMA_NEED_FRAME_RECALC (1 << 3)
#define IMA_SHOW_STEREO (1 << 4)
enum {
TEXTARGET_TEXTURE_2D = 0,
TEXTARGET_TEXTURE_CUBE_MAP = 1,
TEXTARGET_COUNT = 2,
};
typedef struct Image {
ID id;
char name[1024]; /* file path, 1024 = FILE_MAX */
struct MovieCache *cache; /* not written in file */
struct GPUTexture *gputexture[2]; /* not written in file 2 = TEXTARGET_COUNT */
/* sources from: */
ListBase anims;
struct RenderResult *rr;
struct RenderResult *renders[8]; /* IMA_MAX_RENDER_SLOT */
short render_slot, last_render_slot;
int flag;
short source, type;
int lastframe;
/* texture page */
short tpageflag, totbind;
short xrep, yrep;
short twsta, twend;
unsigned int bindcode[2]; /* only for current image... 2 = TEXTARGET_COUNT */
char pad1[4];
unsigned int *repbind; /* for repeat of parts of images */
struct PackedFile *packedfile DNA_DEPRECATED; /* deprecated */
struct ListBase packedfiles;
struct PreviewImage *preview;
/* game engine tile animation */
float lastupdate;
int lastused;
short animspeed;
short ok;
/* for generated images */
int gen_x, gen_y;
char gen_type, gen_flag;
short gen_depth;
float gen_color[4];
/* display aspect - for UV editing images resized for faster openGL display */
float aspx, aspy;
/* color management */
ColorManagedColorspaceSettings colorspace_settings;
char alpha_mode;
char pad[5];
/* Multiview */
char eye; /* for viewer node stereoscopy */
char views_format;
ListBase views; /* ImageView */
struct Stereo3dFormat *stereo3d_format;
RenderSlot render_slots[8]; /* 8 = IMA_MAX_RENDER_SLOT */
} Image;
/* **************** IMAGE ********************* */
/* Image.flag */
enum {
IMA_FIELDS = (1 << 0),
IMA_STD_FIELD = (1 << 1),
#ifdef DNA_DEPRECATED
IMA_DO_PREMUL = (1 << 2), /* deprecated, should not be used */
#endif
IMA_REFLECT = (1 << 4),
IMA_NOCOLLECT = (1 << 5),
//IMA_DONE_TAG = (1 << 6), // UNUSED
IMA_OLD_PREMUL = (1 << 7),
// IMA_CM_PREDIVIDE = (1 << 8), /* deprecated, should not be used */
IMA_USED_FOR_RENDER = (1 << 9),
IMA_USER_FRAME_IN_RANGE = (1 << 10), /* for image user, but these flags are mixed */
IMA_VIEW_AS_RENDER = (1 << 11),
IMA_IGNORE_ALPHA = (1 << 12),
IMA_DEINTERLACE = (1 << 13),
IMA_USE_VIEWS = (1 << 14),
// IMA_IS_STEREO = (1 << 15), /* deprecated */
// IMA_IS_MULTIVIEW = (1 << 16), /* deprecated */
};
/* Image.tpageflag */
#define IMA_TILES (1 << 0)
#define IMA_TWINANIM (1 << 1)
#define IMA_COLCYCLE (1 << 2) /* Depreciated */
#define IMA_MIPMAP_COMPLETE (1 << 3) /* all mipmap levels in OpenGL texture set? */
#define IMA_CLAMP_U (1 << 4)
#define IMA_CLAMP_V (1 << 5)
#define IMA_TPAGE_REFRESH (1 << 6)
#define IMA_GLBIND_IS_DATA (1 << 7) /* opengl image texture bound as non-color data */
/* ima->type and ima->source moved to BKE_image.h, for API */
/* render */
#define IMA_MAX_RENDER_TEXT (1 << 9)
#define IMA_MAX_RENDER_SLOT (1 << 3)
/* gen_flag */
#define IMA_GEN_FLOAT 1
/* alpha_mode */
enum {
IMA_ALPHA_STRAIGHT = 0,
IMA_ALPHA_PREMUL = 1,
};
#endif
|