Blender  V2.93
DNA_image_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_ID.h"
27 #include "DNA_color_types.h" /* for color management */
28 #include "DNA_defs.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 struct GPUTexture;
35 struct MovieCache;
36 struct PackedFile;
37 struct RenderResult;
38 struct Scene;
39 struct anim;
40 
41 /* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
42 /* should be used in conjunction with an ID * to Image. */
43 typedef struct ImageUser {
45  struct Scene *scene;
46 
48  int framenr;
50  int frames;
52  int offset, sfra;
54  char _pad0, cycl;
55  char ok;
56 
59  short pass;
60  char _pad1[2];
61 
62  int tile;
63  int _pad2;
64 
67  short flag;
69 
70 typedef struct ImageAnim {
71  struct ImageAnim *next, *prev;
72  struct anim *anim;
74 
75 typedef struct ImageView {
76  struct ImageView *next, *prev;
78  char name[64];
80  char filepath[1024];
82 
83 typedef struct ImagePackedFile {
87  char filepath[1024];
89 
90 typedef struct RenderSlot {
91  struct RenderSlot *next, *prev;
93  char name[64];
96 
97 typedef struct ImageTile_Runtime {
99  int _pad;
103 
104 typedef struct ImageTile {
105  struct ImageTile *next, *prev;
106 
107  struct ImageTile_Runtime runtime;
108 
109  char ok;
110  char _pad[3];
111 
113  char label[64];
115 
116 /* iuser->flag */
117 #define IMA_ANIM_ALWAYS (1 << 0)
118 /* #define IMA_UNUSED_1 (1 << 1) */
119 /* #define IMA_UNUSED_2 (1 << 2) */
120 #define IMA_NEED_FRAME_RECALC (1 << 3)
121 #define IMA_SHOW_STEREO (1 << 4)
122 /* Do not limit the resolution by the limit texture size option in the user preferences.
123  * Images in the image editor or used as a backdrop are always shown using the maximum
124  * possible resolution. */
125 #define IMA_SHOW_MAX_RESOLUTION (1 << 5)
126 
127 /* Used to get the correct gpu texture from an Image datablock. */
128 typedef enum eGPUTextureTarget {
134 
135 typedef struct Image {
137 
139  char filepath[1024];
140 
142  struct MovieCache *cache;
144  struct GPUTexture *gputexture[3][2];
145 
146  /* sources from: */
148  struct RenderResult *rr;
149 
152 
153  int flag;
154  short source, type;
156 
157  /* GPU texture flag. */
158  /* Contains `ImagePartialRefresh`. */
161  short gpuflag;
162  short gpu_pass;
163  short gpu_layer;
164  short gpu_view;
165  char _pad2[4];
166 
168  struct PackedFile *packedfile DNA_DEPRECATED;
169  struct ListBase packedfiles;
171 
172  int lastused;
173 
174  /* for generated images */
175  int gen_x, gen_y;
177  short gen_depth;
178  float gen_color[4];
179 
180  /* display aspect - for UV editing images resized for faster openGL display */
181  float aspx, aspy;
182 
183  /* color management */
186 
187  char _pad;
188 
189  /* Multiview */
191  char eye;
193 
194  /* ImageTile list for UDIMs. */
197 
201 } Image;
202 
203 /* **************** IMAGE ********************* */
204 
205 /* Image.flag */
206 enum {
207  IMA_HIGH_BITDEPTH = (1 << 0),
208  IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
209 #ifdef DNA_DEPRECATED_ALLOW
210  IMA_DO_PREMUL = (1 << 2),
211 #endif
212  IMA_FLAG_UNUSED_4 = (1 << 4), /* cleared */
213  IMA_NOCOLLECT = (1 << 5),
214  IMA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
215  IMA_OLD_PREMUL = (1 << 7),
216  IMA_FLAG_UNUSED_8 = (1 << 8), /* cleared */
220  IMA_VIEW_AS_RENDER = (1 << 11),
221  IMA_FLAG_UNUSED_12 = (1 << 12), /* cleared */
222  IMA_DEINTERLACE = (1 << 13),
223  IMA_USE_VIEWS = (1 << 14),
224  IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
225  IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
226 };
227 
228 /* Image.gpuflag */
229 enum {
231  IMA_GPU_REFRESH = (1 << 0),
238 };
239 
240 /* Image.source, where the image comes from */
241 enum {
242  /* IMA_SRC_CHECK = 0, */ /* UNUSED */
249 };
250 
251 /* Image.type, how to handle or generate the image */
252 enum {
255  /* generated */
257  /* viewers */
260 };
261 
262 /* Image.gen_type */
263 enum {
267 };
268 
269 /* render */
270 #define IMA_MAX_RENDER_TEXT (1 << 9)
271 
272 /* Image.gen_flag */
273 enum {
275 };
276 
277 /* Image.alpha_mode */
278 enum {
283 };
284 
285 #ifdef __cplusplus
286 }
287 #endif
ID and Library types, which are fundamental for sdna.
struct ImageTile_Runtime ImageTile_Runtime
struct ImageTile ImageTile
struct Image Image
@ IMA_FLAG_UNUSED_16
@ IMA_FLAG_UNUSED_8
@ IMA_NOCOLLECT
@ IMA_FLAG_UNUSED_6
@ IMA_DEINTERLACE
@ IMA_USED_FOR_RENDER
@ IMA_FLAG_UNUSED_12
@ IMA_FLAG_UNUSED_1
@ IMA_FLAG_UNUSED_15
@ IMA_HIGH_BITDEPTH
@ IMA_USER_FRAME_IN_RANGE
@ IMA_USE_VIEWS
@ IMA_FLAG_UNUSED_4
@ IMA_OLD_PREMUL
@ IMA_VIEW_AS_RENDER
struct ImageAnim ImageAnim
@ IMA_GPU_MAX_RESOLUTION
@ IMA_GPU_REFRESH
@ IMA_GPU_PARTIAL_REFRESH
@ IMA_GPU_MIPMAP_COMPLETE
@ IMA_GENTYPE_GRID_COLOR
@ IMA_GENTYPE_GRID
@ IMA_GENTYPE_BLANK
@ IMA_GEN_FLOAT
@ IMA_TYPE_MULTILAYER
@ IMA_TYPE_UV_TEST
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ IMA_TYPE_IMAGE
@ IMA_ALPHA_IGNORE
@ IMA_ALPHA_STRAIGHT
@ IMA_ALPHA_PREMUL
@ IMA_ALPHA_CHANNEL_PACKED
struct ImageUser ImageUser
struct ImageView ImageView
@ IMA_SRC_FILE
@ IMA_SRC_MOVIE
@ IMA_SRC_GENERATED
@ IMA_SRC_VIEWER
@ IMA_SRC_TILED
@ IMA_SRC_SEQUENCE
struct ImagePackedFile ImagePackedFile
struct RenderSlot RenderSlot
eGPUTextureTarget
@ TEXTARGET_2D
@ TEXTARGET_2D_ARRAY
@ TEXTARGET_COUNT
@ TEXTARGET_TILE_MAPPING
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
short gpuflag
struct MovieCache * cache
struct ListBase packedfiles
struct PreviewImage * preview
char gen_type
short last_render_slot
ListBase anims
ColorManagedColorspaceSettings colorspace_settings
int lastused
float aspy
short gpu_pass
ListBase renderslots
short gpu_layer
char views_format
short gpu_view
char filepath[1024]
int gpuframenr
ListBase tiles
short type
struct GPUTexture * gputexture[3][2]
short source
short render_slot
float aspx
short gen_depth
struct RenderResult * rr
ListBase gpu_refresh_areas
char gen_flag
ListBase views
char alpha_mode
int lastframe
char _pad2[4]
struct Stereo3dFormat * stereo3d_format
int active_tile_index
float gen_color[4]
struct PackedFile *packedfile DNA_DEPRECATED
Definition: DNA_ID.h:273
struct ImageAnim * next
struct anim * anim
struct ImageAnim * prev
struct PackedFile * packedfile
struct ImagePackedFile * next
char filepath[1024]
struct ImagePackedFile * prev
struct ImageTile * prev
char _pad[3]
char label[64]
struct ImageTile * next
struct ImageTile_Runtime runtime
char multiview_eye
short multi_index
char _pad1[2]
struct Scene * scene
char name[64]
char filepath[1024]
struct ImageView * next
struct ImageView * prev
struct RenderResult * render
struct RenderSlot * next
char name[64]
struct RenderSlot * prev
Definition: IMB_anim.h:87