2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file DNA_image_types.h
32 #ifndef __DNA_IMAGE_TYPES_H__
33 #define __DNA_IMAGE_TYPES_H__
37 #include "DNA_color_types.h" /* for color management */
46 /* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
47 /* should be used in conjunction with an ID * to Image. */
48 typedef struct ImageUser {
49 /** To retrieve render result. */
52 /** Movies, sequences: current to display. */
54 /** Total amount of frames to use. */
56 /** Offset within movie, start frame in global time. */
62 /** Multiview current eye - for internal use of drawing routines. */
67 /** Listbase indices, for menu browsing or retrieve buffer. */
68 short multi_index, view, layer;
72 typedef struct ImageAnim {
73 struct ImageAnim *next, *prev;
77 typedef struct ImageView {
78 struct ImageView *next, *prev;
81 /** 1024 = FILE_MAX. */
85 typedef struct ImagePackedFile {
86 struct ImagePackedFile *next, *prev;
87 struct PackedFile *packedfile;
88 /** 1024 = FILE_MAX. */
92 typedef struct RenderSlot {
93 struct RenderSlot *next, *prev;
96 struct RenderResult *render;
100 #define IMA_ANIM_ALWAYS (1 << 0)
101 #define IMA_ANIM_REFRESHED (1 << 1)
102 /* #define IMA_DO_PREMUL (1 << 2) */
103 #define IMA_NEED_FRAME_RECALC (1 << 3)
104 #define IMA_SHOW_STEREO (1 << 4)
107 TEXTARGET_TEXTURE_2D = 0,
108 TEXTARGET_TEXTURE_CUBE_MAP = 1,
112 typedef struct Image {
115 /** File path, 1024 = FILE_MAX. */
118 /** Not written in file. */
119 struct MovieCache *cache;
120 /** Not written in file 2 = TEXTARGET_COUNT. */
121 struct GPUTexture *gputexture[2];
125 struct RenderResult *rr;
127 ListBase renderslots;
128 short render_slot, last_render_slot;
140 struct PackedFile *packedfile DNA_DEPRECATED;
141 struct ListBase packedfiles;
142 struct PreviewImage *preview;
148 /* for generated images */
150 char gen_type, gen_flag;
154 /* display aspect - for UV editing images resized for faster openGL display */
157 /* color management */
158 ColorManagedColorspaceSettings colorspace_settings;
164 /** For viewer node stereoscopy. */
169 struct Stereo3dFormat *stereo3d_format;
173 /* **************** IMAGE ********************* */
177 IMA_FLAG_DEPRECATED_0 = (1 << 0), /* cleared */
178 IMA_FLAG_DEPRECATED_1 = (1 << 1), /* cleared */
179 #ifdef DNA_DEPRECATED
180 IMA_DO_PREMUL = (1 << 2),
182 IMA_FLAG_DEPRECATED_4 = (1 << 4), /* cleared */
183 IMA_NOCOLLECT = (1 << 5),
184 IMA_FLAG_DEPRECATED_6 = (1 << 6), /* cleared */
185 IMA_OLD_PREMUL = (1 << 7),
186 IMA_FLAG_DEPRECATED_8 = (1 << 8), /* cleared */
187 IMA_USED_FOR_RENDER = (1 << 9),
188 IMA_USER_FRAME_IN_RANGE = (1 << 10), /* for image user, but these flags are mixed */
189 IMA_VIEW_AS_RENDER = (1 << 11),
190 IMA_IGNORE_ALPHA = (1 << 12),
191 IMA_DEINTERLACE = (1 << 13),
192 IMA_USE_VIEWS = (1 << 14),
193 IMA_FLAG_DEPRECATED_15 = (1 << 15), /* cleared */
194 IMA_FLAG_DEPRECATED_16 = (1 << 16), /* cleared */
197 /* Image.tpageflag */
198 #define IMA_TPAGEFLAG_DEPRECATED_0 (1 << 0) /* cleared */
199 #define IMA_TPAGEFLAG_DEPRECATED_1 (1 << 1) /* cleared */
200 #define IMA_TPAGEFLAG_DEPRECATED_2 (1 << 2) /* cleared */
201 #define IMA_MIPMAP_COMPLETE (1 << 3) /* all mipmap levels in OpenGL texture set? */
202 #define IMA_TPAGEFLAG_DEPRECATED_4 (1 << 4) /* cleared */
203 #define IMA_TPAGEFLAG_DEPRECATED_5 (1 << 5) /* cleared */
204 #define IMA_TPAGE_REFRESH (1 << 6)
205 #define IMA_GLBIND_IS_DATA (1 << 7) /* opengl image texture bound as non-color data */
207 /* ima->type and ima->source moved to BKE_image.h, for API */
210 #define IMA_MAX_RENDER_TEXT (1 << 9)
213 #define IMA_GEN_FLOAT 1
217 IMA_ALPHA_STRAIGHT = 0,
218 IMA_ALPHA_PREMUL = 1,