Blender  V3.3
ED_image.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_listBase.h"
11 #include "DNA_space_types.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 struct ARegion;
18 struct ImBuf;
19 struct Image;
20 struct ImageUser;
21 struct Main;
22 struct ReportList;
23 struct Scene;
24 struct SpaceImage;
25 struct View2D;
26 struct bContext;
27 struct Paint;
28 struct wmOperator;
29 struct wmWindowManager;
30 
31 /* image_draw.c */
32 
33 float ED_space_image_zoom_level(const struct View2D *v2d, int grid_dimension);
34 void ED_space_image_grid_steps(struct SpaceImage *sima,
35  float grid_steps[SI_GRID_STEPS_LEN],
36  int grid_dimension);
42 float ED_space_image_increment_snap_value(int grid_dimesnions,
43  const float grid_steps[SI_GRID_STEPS_LEN],
44  float zoom_factor);
45 
46 /* image_edit.c, exported for transform. */
47 
48 struct Image *ED_space_image(const struct SpaceImage *sima);
49 void ED_space_image_set(struct Main *bmain,
50  struct SpaceImage *sima,
51  struct Image *ima,
52  bool automatic);
53 void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima);
54 struct Mask *ED_space_image_get_mask(const struct SpaceImage *sima);
55 void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
56 
60 bool ED_space_image_get_position(struct SpaceImage *sima,
61  struct ARegion *region,
62  int mval[2],
63  float fpos[2]);
67 bool ED_space_image_color_sample(struct SpaceImage *sima,
68  struct ARegion *region,
69  const int mval[2],
70  float r_col[3],
71  bool *r_is_data);
72 struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile);
77 void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock);
78 bool ED_space_image_has_buffer(struct SpaceImage *sima);
79 
80 void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height);
81 void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2]);
82 void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
84  const struct ARegion *region,
85  float *r_zoomx,
86  float *r_zoomy);
87 void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy);
88 
89 void ED_space_image_scopes_update(const struct bContext *C,
90  struct SpaceImage *sima,
91  struct ImBuf *ibuf,
92  bool use_view_settings);
93 
100 void ED_space_image_paint_update(struct Main *bmain,
101  struct wmWindowManager *wm,
102  struct Scene *scene);
103 
104 void ED_image_get_uv_aspect(struct Image *ima,
105  struct ImageUser *iuser,
106  float *r_aspx,
107  float *r_aspy);
109 void ED_image_mouse_pos(struct SpaceImage *sima,
110  const struct ARegion *region,
111  const int mval[2],
112  float co[2]);
113 void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y);
114 void ED_image_point_pos(struct SpaceImage *sima,
115  const struct ARegion *region,
116  float x,
117  float y,
118  float *r_x,
119  float *r_y);
121  const struct ARegion *region,
122  const float co[2],
123  float r_co[2]);
128 bool ED_image_slot_cycle(struct Image *image, int direction);
129 
130 bool ED_space_image_show_render(const struct SpaceImage *sima);
131 bool ED_space_image_show_paint(const struct SpaceImage *sima);
132 bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit);
133 
135 
139 bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit);
140 
141 /* Returns true when the following conditions are met:
142  * - Current space is Image Editor.
143  * - The image editor is not a UV Editor.
144  * - It is set to Mask mode.
145  *
146  * It is not required to have mask opened for editing. */
148 
149 /* Returns true when the following conditions are met:
150  * - Current space is Image Editor.
151  * - The image editor is not a UV Editor.
152  * - It is set to Mask mode.
153  * - Mask has visible and editable splines.
154  *
155  * It is not required to have mask opened for editing. */
157 
158 /* Returns true when the following conditions are met:
159  * - Current space is Image Editor.
160  * - The image editor is not an UV Editor.
161  * - It is set to Mask mode.
162  * - The space has mask opened. */
164 
165 /* Returns true when the following conditions are met:
166  * - Current space is Image Editor.
167  * - The image editor is not an UV Editor.
168  * - It is set to Mask mode.
169  * - The space has mask opened.
170  * - Mask has visible and editable splines. */
172 
174 
178 void ED_image_draw_info(struct Scene *scene,
179  struct ARegion *region,
180  bool color_manage,
181  bool use_default_view,
182  int channels,
183  int x,
184  int y,
185  const unsigned char cp[4],
186  const float fp[4],
187  const float linearcol[4],
188  const int *zp,
189  const float *zpf);
190 
191 bool ED_space_image_show_cache(const struct SpaceImage *sima);
193  struct ARegion *region,
194  const int mval[2]);
195 
196 bool ED_image_should_save_modified(const struct Main *bmain);
197 int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports);
198 bool ED_image_save_all_modified(const struct bContext *C, struct ReportList *reports);
199 
200 /* image_sequence.c */
201 
202 typedef struct ImageFrameRange {
204 
207  /* Sequence parameters. */
208  int length;
209  int offset;
210  /* UDIM tiles. */
213 
214  /* Temporary data. */
217 
222  struct wmOperator *op,
223  bool detect_udim);
224 
225 bool ED_image_tools_paint_poll(struct bContext *C);
226 void ED_paint_cursor_start(struct Paint *p, bool (*poll)(struct bContext *C));
227 
228 #ifdef __cplusplus
229 }
230 #endif
#define FILE_MAX
These structs are the foundation for all linked lists in the library system.
#define SI_GRID_STEPS_LEN
struct Mask * ED_space_image_get_mask(const struct SpaceImage *sima)
void ED_image_point_pos(struct SpaceImage *sima, const struct ARegion *region, float x, float y, float *r_x, float *r_y)
bool ED_image_should_save_modified(const struct Main *bmain)
bool ED_space_image_maskedit_visible_splines_poll(struct bContext *C)
Definition: image_edit.c:481
bool ED_space_image_maskedit_mask_visible_splines_poll(struct bContext *C)
Definition: image_edit.c:516
float ED_space_image_increment_snap_value(int grid_dimesnions, const float grid_steps[SI_GRID_STEPS_LEN], float zoom_factor)
Definition: image_draw.c:604
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
Definition: image_edit.c:158
void ED_space_image_grid_steps(struct SpaceImage *sima, float grid_steps[SI_GRID_STEPS_LEN], int grid_dimension)
Definition: image_draw.c:587
void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask)
Definition: image_edit.c:106
void ED_image_get_uv_aspect(struct Image *ima, struct ImageUser *iuser, float *r_aspx, float *r_aspy)
Definition: image_edit.c:282
struct ImageFrameRange ImageFrameRange
bool ED_space_image_check_show_maskedit(struct SpaceImage *sima, struct Object *obedit)
Definition: image_edit.c:458
void ED_space_image_auto_set(const struct bContext *C, struct SpaceImage *sima)
bool ED_space_image_has_buffer(struct SpaceImage *sima)
Definition: image_edit.c:188
float ED_space_image_zoom_level(const struct View2D *v2d, int grid_dimension)
bool ED_space_image_maskedit_mask_poll(struct bContext *C)
Definition: image_edit.c:506
void ED_image_draw_info(struct Scene *scene, struct ARegion *region, bool color_manage, bool use_default_view, int channels, int x, int y, const unsigned char cp[4], const float fp[4], const float linearcol[4], const int *zp, const float *zpf)
Definition: image_draw.c:122
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:262
bool ED_space_image_show_cache(const struct SpaceImage *sima)
bool ED_space_image_color_sample(struct SpaceImage *sima, struct ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
Definition: image_ops.c:3215
bool ED_space_image_show_paint(const struct SpaceImage *sima)
bool ED_space_image_maskedit_poll(struct bContext *C)
Definition: image_edit.c:468
void ED_space_image_scopes_update(const struct bContext *C, struct SpaceImage *sima, struct ImBuf *ibuf, bool use_view_settings)
Definition: image_edit.c:391
bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit)
struct Image * ED_space_image(const struct SpaceImage *sima)
void ED_space_image_paint_update(struct Main *bmain, struct wmWindowManager *wm, struct Scene *scene)
Definition: paint_image.cc:438
bool ED_image_save_all_modified(const struct bContext *C, struct ReportList *reports)
ListBase ED_image_filesel_detect_sequences(struct Main *bmain, struct wmOperator *op, bool detect_udim)
void ED_image_view_center_to_point(struct SpaceImage *sima, float x, float y)
Definition: image_edit.c:313
void ED_space_image_get_zoom(struct SpaceImage *sima, const struct ARegion *region, float *r_zoomx, float *r_zoomy)
bool ED_space_image_paint_curve(const struct bContext *C)
bool ED_space_image_show_cache_and_mval_over(const struct SpaceImage *sima, struct ARegion *region, const int mval[2])
void ED_space_image_set(struct Main *bmain, struct SpaceImage *sima, struct Image *ima, bool automatic)
Definition: image_edit.c:45
void ED_image_point_pos__reverse(struct SpaceImage *sima, const struct ARegion *region, const float co[2], float r_co[2])
void ED_image_mouse_pos(struct SpaceImage *sima, const struct ARegion *region, const int mval[2], float co[2])
bool ED_space_image_get_position(struct SpaceImage *sima, struct ARegion *region, int mval[2], float fpos[2])
Definition: image_ops.c:3196
bool ED_image_slot_cycle(struct Image *image, int direction)
Definition: image_edit.c:357
int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf)
Definition: image_edit.c:165
void ED_paint_cursor_start(struct Paint *p, bool(*poll)(struct bContext *C))
void ED_space_image_get_size_fl(struct SpaceImage *sima, float r_size[2])
Definition: image_edit.c:228
int ED_image_save_all_modified_info(const struct Main *bmain, struct ReportList *reports)
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
Definition: image_edit.c:201
bool ED_image_tools_paint_poll(struct bContext *C)
Definition: paint_image.cc:291
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
Definition: image_edit.c:236
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
Definition: image_edit.c:118
bool ED_space_image_cursor_poll(struct bContext *C)
Definition: image_edit.c:526
bool ED_space_image_show_render(const struct SpaceImage *sima)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a producing a negative Combine Generate a color from its and blue channels(Deprecated)") DefNode(ShaderNode
#define C
Definition: RandGen.cpp:25
volatile int lock
Scene scene
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
ccl_global const KernelWorkTile * tile
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
struct ImageFrameRange * prev
Definition: ED_image.h:203
ListBase frames
Definition: ED_image.h:215
struct ImageFrameRange * next
Definition: ED_image.h:203
char filepath[FILE_MAX]
Definition: ED_image.h:206
bool udims_detected
Definition: ED_image.h:211
ListBase udim_tiles
Definition: ED_image.h:212
Definition: BKE_main.h:121