Blender V5.0
DNA_image_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_ID.h"
12#include "DNA_color_types.h" /* for color management */
13#include "DNA_defs.h"
14
15#ifdef __cplusplus
16namespace blender::bke {
17struct ImageRuntime;
18} // namespace blender::bke
20
21namespace blender::gpu {
22class Texture;
23} // namespace blender::gpu
25#else
27typedef struct GPUTexture GPUTexture;
28#endif
29
30struct MovieReader;
31struct MovieCache;
32struct PackedFile;
33struct RenderResult;
34struct Scene;
35
40typedef struct ImageUser {
42 struct Scene *scene;
43
47 int frames;
51 char cycl;
52
55 short pass;
56
57 int tile;
58
61 short flag;
63
64typedef struct ImageAnim {
65 struct ImageAnim *next, *prev;
68
69typedef struct ImageView {
70 struct ImageView *next, *prev;
71 char name[/*MAX_NAME*/ 64];
72 char filepath[/*FILE_MAX*/ 1024];
74
75typedef struct ImagePackedFile {
78
79 /* Which view and tile this ImagePackedFile represents. Normal images will use 0 and 1001
80 * respectively when creating their ImagePackedFile. Must be provided for each packed image. */
81 int view;
83 char filepath[/*FILE_MAX*/ 1024];
85
86typedef struct RenderSlot {
87 struct RenderSlot *next, *prev;
88 char name[/*MAX_NAME*/ 64];
91
98
99typedef struct ImageTile {
100 struct ImageTile *next, *prev;
101
103
105
106 /* for generated images */
110 float gen_color[4];
111
112 char label[64];
114
116enum {
119 // IMA_UNUSED_2 = 1 << 2,
122 // IMA_UNUSED_5 = 1 << 5,
123};
124
125/* Used to get the correct gpu texture from an Image datablock. */
132
133typedef struct Image {
134#ifdef __cplusplus
136 static constexpr ID_Type id_type = ID_IM;
137#endif
138
140 struct AnimData *adt;
141
143 char filepath[/*FILE_MAX*/ 1024];
144
148 GPUTexture *gputexture[/*TEXTARGET_COUNT*/ 3][2];
149
150 /* sources from: */
153
156
157 int flag;
158 short source, type;
160
161 /* GPU texture flag. */
163 short gpuflag;
164 short gpu_pass;
166 short gpu_view;
167
168 /* Number of iterations to perform when extracting mask for uv seam fixing. */
170
171 char _pad2[2];
172
174 struct PackedFile *packedfile DNA_DEPRECATED;
177
179
180 /* for generated images */
182 char gen_type DNA_DEPRECATED, gen_flag DNA_DEPRECATED;
183 short gen_depth DNA_DEPRECATED;
184 float gen_color[4] DNA_DEPRECATED;
185
186 /* display aspect - for UV editing images resized for faster openGL display */
187 float aspx, aspy;
188
189 /* color management */
192
193 char _pad;
194
195 /* Multiview */
197 char eye;
199
200 /* ImageTile list for UDIMs. */
203
207
210
211/* **************** IMAGE ********************* */
212
214enum {
216 IMA_FLAG_UNUSED_1 = (1 << 1), /* cleared */
217#ifdef DNA_DEPRECATED_ALLOW
218 IMA_DO_PREMUL = (1 << 2),
219#endif
220 IMA_FLAG_UNUSED_4 = (1 << 4), /* cleared */
221 IMA_NOCOLLECT = (1 << 5),
222 IMA_FLAG_UNUSED_6 = (1 << 6), /* cleared */
223 IMA_OLD_PREMUL = (1 << 7),
224 IMA_FLAG_UNUSED_8 = (1 << 8), /* cleared */
229 IMA_FLAG_UNUSED_12 = (1 << 12), /* cleared */
230 IMA_DEINTERLACE = (1 << 13),
231 IMA_USE_VIEWS = (1 << 14),
232 IMA_FLAG_UNUSED_15 = (1 << 15), /* cleared */
233 IMA_FLAG_UNUSED_16 = (1 << 16), /* cleared */
234};
235
237enum {
240};
241
242/* Image.source, where the image comes from */
243typedef enum eImageSource {
244 /* IMA_SRC_CHECK = 0, */ /* UNUSED */
252
253/* Image.type, how to handle or generate the image */
263
265enum {
269};
270
272#define IMA_MAX_RENDER_TEXT_SIZE 512
273
275enum {
276 IMA_GEN_FLOAT = (1 << 0),
277 IMA_GEN_TILE = (1 << 1),
278};
279
281enum {
286};
287
288/* Image gpu runtime defaults */
289#define IMAGE_GPU_FRAME_NONE INT_MAX
290#define IMAGE_GPU_PASS_NONE SHRT_MAX
291#define IMAGE_GPU_LAYER_NONE SHRT_MAX
292#define IMAGE_GPU_VIEW_NONE SHRT_MAX
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_IM
struct GPUTexture GPUTexture
@ IMA_GPU_MIPMAP_COMPLETE
@ IMA_GEN_TILE
@ IMA_GEN_FLOAT
eImageSource
@ IMA_SRC_FILE
@ IMA_SRC_MOVIE
@ IMA_SRC_GENERATED
@ IMA_SRC_VIEWER
@ IMA_SRC_TILED
@ IMA_SRC_SEQUENCE
@ IMA_GENTYPE_GRID_COLOR
@ IMA_GENTYPE_GRID
@ IMA_GENTYPE_BLANK
@ 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_ALPHA_IGNORE
@ IMA_ALPHA_STRAIGHT
@ IMA_ALPHA_PREMUL
@ IMA_ALPHA_CHANNEL_PACKED
eImageType
@ IMA_TYPE_MULTILAYER
@ IMA_TYPE_UV_TEST
@ IMA_TYPE_R_RESULT
@ IMA_TYPE_COMPOSITE
@ IMA_TYPE_IMAGE
@ IMA_SHOW_SEQUENCER_SCENE
@ IMA_ANIM_ALWAYS
@ IMA_NEED_FRAME_RECALC
@ IMA_SHOW_STEREO
struct ImageRuntimeHandle ImageRuntimeHandle
eGPUTextureTarget
@ TEXTARGET_2D
@ TEXTARGET_2D_ARRAY
@ TEXTARGET_COUNT
@ TEXTARGET_TILE_MAPPING
Definition DNA_ID.h:414
struct ImageAnim * next
struct ImageAnim * prev
struct MovieReader * anim
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
float gen_color[4]
short multi_index
struct Scene * scene
char name[64]
char filepath[1024]
struct ImageView * next
struct ImageView * prev
short gpuflag
struct MovieCache * cache
GPUTexture * gputexture[3][2]
struct ListBase packedfiles
struct PreviewImage * preview
short last_render_slot
ListBase anims
ColorManagedColorspaceSettings colorspace_settings
short gpu_pass
ListBase renderslots
short gpu_layer
char views_format
short gpu_view
char filepath[1024]
ListBase tiles
short source
short render_slot
struct RenderResult * rr
short seam_margin
ListBase views
struct AnimData * adt
char alpha_mode
struct Stereo3dFormat * stereo3d_format
ImageRuntimeHandle * runtime
char _pad2[2]
int active_tile_index
struct PackedFile *packedfile DNA_DEPRECATED
struct RenderResult * render
struct RenderSlot * next
char name[64]
struct RenderSlot * prev