Blender  V3.3
DNA_image_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_ID.h"
11 #include "DNA_color_types.h" /* for color management */
12 #include "DNA_defs.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 struct GPUTexture;
19 struct MovieCache;
20 struct PackedFile;
21 struct RenderResult;
22 struct Scene;
23 struct anim;
24 
25 /* ImageUser is in Texture, in Nodes, Background Image, Image Window, .... */
26 /* should be used in conjunction with an ID * to Image. */
27 typedef struct ImageUser {
29  struct Scene *scene;
30 
32  int framenr;
34  int frames;
36  int offset, sfra;
38  char cycl;
39 
42  short pass;
43 
44  int tile;
45 
48  short flag;
50 
51 typedef struct ImageAnim {
52  struct ImageAnim *next, *prev;
53  struct anim *anim;
55 
56 typedef struct ImageView {
57  struct ImageView *next, *prev;
59  char name[64];
61  char filepath[1024];
63 
64 typedef struct ImagePackedFile {
67 
68  /* Which view and tile this ImagePackedFile represents. Normal images will use 0 and 1001
69  * respectively when creating their ImagePackedFile. Must be provided for each packed image. */
70  int view;
73  char filepath[1024];
75 
76 typedef struct RenderSlot {
77  struct RenderSlot *next, *prev;
79  char name[64];
82 
83 typedef struct ImageTile_Runtime {
85  int _pad;
89 
90 typedef struct ImageTile {
91  struct ImageTile *next, *prev;
92 
94 
95  char _pad[4];
97  char label[64];
99 
100 /* iuser->flag */
101 #define IMA_ANIM_ALWAYS (1 << 0)
102 /* #define IMA_UNUSED_1 (1 << 1) */
103 /* #define IMA_UNUSED_2 (1 << 2) */
104 #define IMA_NEED_FRAME_RECALC (1 << 3)
105 #define IMA_SHOW_STEREO (1 << 4)
106 /* #define IMA_UNUSED_5 (1 << 5) */
107 
108 /* Used to get the correct gpu texture from an Image datablock. */
109 typedef enum eGPUTextureTarget {
115 
116 /* Defined in BKE_image.h. */
117 struct PartialUpdateRegister;
118 struct PartialUpdateUser;
119 
120 typedef struct Image_Runtime {
121  /* Mutex used to guarantee thread-safe access to the cached ImBuf of the corresponding image ID.
122  */
123  void *cache_mutex;
124 
126  struct PartialUpdateRegister *partial_update_register;
128  struct PartialUpdateUser *partial_update_user;
129 
131 
132 typedef struct Image {
134 
136  char filepath[1024];
137 
139  struct MovieCache *cache;
141  struct GPUTexture *gputexture[3][2];
142 
143  /* sources from: */
145  struct RenderResult *rr;
146 
149 
150  int flag;
151  short source, type;
153 
154  /* GPU texture flag. */
156  short gpuflag;
157  short gpu_pass;
158  short gpu_layer;
159  short gpu_view;
160  char _pad2[4];
161 
163  struct PackedFile *packedfile DNA_DEPRECATED;
164  struct ListBase packedfiles;
166 
167  int lastused;
168 
169  /* for generated images */
170  int gen_x, gen_y;
172  short gen_depth;
173  float gen_color[4];
174 
175  /* display aspect - for UV editing images resized for faster openGL display */
176  float aspx, aspy;
177 
178  /* color management */
181 
182  char _pad;
183 
184  /* Multiview */
186  char eye;
188 
189  /* ImageTile list for UDIMs. */
192 
196 
199 
200 /* **************** IMAGE ********************* */
201 
203 enum {
204  IMA_HIGH_BITDEPTH = (1 << 0),
205  IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
206 #ifdef DNA_DEPRECATED_ALLOW
207  IMA_DO_PREMUL = (1 << 2),
208 #endif
209  IMA_FLAG_UNUSED_4 = (1 << 4), /* cleared */
210  IMA_NOCOLLECT = (1 << 5),
211  IMA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
212  IMA_OLD_PREMUL = (1 << 7),
213  IMA_FLAG_UNUSED_8 = (1 << 8), /* cleared */
217  IMA_VIEW_AS_RENDER = (1 << 11),
218  IMA_FLAG_UNUSED_12 = (1 << 12), /* cleared */
219  IMA_DEINTERLACE = (1 << 13),
220  IMA_USE_VIEWS = (1 << 14),
221  IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
222  IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
223 };
224 
226 enum {
229 };
230 
231 /* Image.source, where the image comes from */
232 typedef enum eImageSource {
233  /* IMA_SRC_CHECK = 0, */ /* UNUSED */
241 
242 /* Image.type, how to handle or generate the image */
243 typedef enum eImageType {
246  /* generated */
248  /* viewers */
252 
254 enum {
258 };
259 
260 /* render */
261 #define IMA_MAX_RENDER_TEXT (1 << 9)
262 
264 enum {
266 };
267 
269 enum {
274 };
275 
276 #ifdef __cplusplus
277 }
278 #endif
ID and Library types, which are fundamental for sdna.
struct ImageTile_Runtime ImageTile_Runtime
@ IMA_GPU_MIPMAP_COMPLETE
struct ImageTile ImageTile
@ IMA_GENTYPE_GRID_COLOR
@ IMA_GENTYPE_GRID
@ IMA_GENTYPE_BLANK
struct ImageAnim ImageAnim
@ 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
@ IMA_GEN_FLOAT
struct Image_Runtime Image_Runtime
@ IMA_ALPHA_IGNORE
@ IMA_ALPHA_STRAIGHT
@ IMA_ALPHA_PREMUL
@ IMA_ALPHA_CHANNEL_PACKED
eImageSource
@ IMA_SRC_FILE
@ IMA_SRC_MOVIE
@ IMA_SRC_GENERATED
@ IMA_SRC_VIEWER
@ IMA_SRC_TILED
@ IMA_SRC_SEQUENCE
struct ImageUser ImageUser
struct ImageView ImageView
eImageType
@ IMA_TYPE_MULTILAYER
@ IMA_TYPE_UV_TEST
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ IMA_TYPE_IMAGE
struct ImagePackedFile ImagePackedFile
struct Image Image
struct RenderSlot RenderSlot
eGPUTextureTarget
@ TEXTARGET_2D
@ TEXTARGET_2D_ARRAY
@ TEXTARGET_COUNT
@ TEXTARGET_TILE_MAPPING
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
short gpuflag
struct MovieCache * cache
struct ListBase packedfiles
struct PreviewImage * preview
char gen_type
short last_render_slot
Image_Runtime runtime
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
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:368
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 label[64]
struct ImageTile * next
struct ImageTile_Runtime runtime
char _pad[4]
char multiview_eye
short multi_index
struct Scene * scene
char name[64]
char filepath[1024]
struct ImageView * next
struct ImageView * prev
struct PartialUpdateUser * partial_update_user
Partial update user for GPUTextures stored inside the Image.
struct PartialUpdateRegister * partial_update_register
Register containing partial updates.
struct RenderResult * render
struct RenderSlot * next
char name[64]
struct RenderSlot * prev
Definition: IMB_anim.h:71