Blender V5.3
ED_image.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <array>
12
13#include "DNA_listBase.h"
14#include "DNA_space_types.h"
15
16#include "BLI_string_ref.hh"
17
18namespace blender {
19
20struct ARegion;
21struct ImBuf;
22struct Image;
23struct ImageUser;
24struct Main;
25struct ReportList;
26struct Scene;
27struct SpaceImage;
28struct View2D;
29struct bContext;
30struct Paint;
31struct wmOperator;
32struct wmWindowManager;
33
34/* `image_draw.cc` */
35
36float ED_space_image_zoom_level(const View2D *v2d, int grid_dimension);
38 float grid_steps_x[SI_GRID_STEPS_LEN],
39 float grid_steps_y[SI_GRID_STEPS_LEN],
40 int grid_dimension);
46float ED_space_image_increment_snap_value(int grid_dimensions,
47 const float grid_steps[SI_GRID_STEPS_LEN],
48 float zoom_factor);
49
50/* `image_edit.cc`, exported for transform. */
51
52Image *ED_space_image(const SpaceImage *sima);
53void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic);
54void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer);
58
63 ARegion *region,
64 const int mval[2],
65 float r_fpos[2]);
70 SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data);
71/* Acquires the image buffer of the given tile of the image in the given space. See the info on the
72 * BKE_image_acquire_ibuf function for information on the lock. Also see the image_acquire_ibuf
73 * function for the ensure_host_buffer argument. */
75 void **r_lock,
76 int tile,
77 const bool ensure_host_buffer);
82void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock);
84
85void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height);
86void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2]);
87void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy);
89 const ARegion *region,
90 float *r_zoomx,
91 float *r_zoomy);
92void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy);
93
95 SpaceImage *sima,
96 ImBuf *ibuf,
97 bool use_view_settings);
98
106
107void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy);
109void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2]);
110void ED_image_view_center_to_point(SpaceImage *sima, float x, float y);
112 SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y);
114 const ARegion *region,
115 const float co[2],
116 float r_co[2]);
121bool ED_image_slot_cycle(Image *image, int direction);
122
123bool ED_space_image_show_render(const SpaceImage *sima);
124bool ED_space_image_show_paint(const SpaceImage *sima);
125bool ED_space_image_show_mask(const SpaceImage *sima);
126bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit);
127
129
134
144
155
164
174
177
181void ED_image_draw_info(Scene *scene,
182 ARegion *region,
183 bool color_manage,
184 bool use_default_view,
185 int channels,
186 int x,
187 int y,
188 const unsigned char cp[4],
189 const float fp[4],
190 const float linearcol[4]);
191
192bool ED_space_image_show_cache(const SpaceImage *sima);
194 ARegion *region,
195 const int mval[2]);
196
197bool ED_image_should_save_modified(const Main *bmain);
198int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports);
199bool ED_image_save_all_modified(const bContext *C, ReportList *reports);
200void ED_image_internal_autosave_flush(const Main *bmain);
201
202/* `image_sequence.cc` */
203
204struct ImageFrame;
205
208
215 /* Sequence parameters. */
216 int length; /* Does not include placeholders, stops at gaps in sequence. */
218 int max_framenr; /* Allows for calculating length including placeholders. */
219
220 /* UDIM tiles. */
222 ListBaseT<LinkData> udim_tiles;
223
224 /* Temporary data. */
225 ListBaseT<ImageFrame> frames;
226};
227
232
242ListBaseT<ImageFrameRange> ED_image_filesel_detect_sequences(StringRefNull blendfile_path,
243 StringRefNull root_path,
244 wmOperator *op,
245 bool detect_udim);
246
248
249std::array<const char *, 4> ED_image_buttons_contexts(const bContext *C);
250
251} // namespace blender
#define FILE_MAX
These structs are the foundation for all linked lists in the library system.
#define SI_GRID_STEPS_LEN
#define C
Definition RandGen.cpp:29
volatile int lock
const ccl_global KernelWorkTile * tile
BMesh Iterators.
bool ED_space_image_maskedit_mask_poll(bContext *C)
bool ED_image_slot_cycle(Image *image, int direction)
void ED_space_image_auto_set(const bContext *C, SpaceImage *sima)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
bool ED_space_image_check_show_maskedit(SpaceImage *sima, Object *obedit)
void ED_space_image_sync(Main *bmain, Image *image, bool ignore_render_viewer)
Definition image_edit.cc:79
bool ED_space_image_show_cache(const SpaceImage *sima)
bool ED_space_image_maskedit_mask_visible_splines_poll(bContext *C)
ImBuf * ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock, int tile, const bool ensure_host_buffer)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
bool ED_space_image_region_cursor_poll(bContext *C)
void ED_image_draw_info(Scene *scene, 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])
bool ED_space_image_get_position(SpaceImage *sima, ARegion *region, const int mval[2], float r_fpos[2])
void ED_space_image_release_buffer(SpaceImage *sima, ImBuf *ibuf, void *lock)
void ED_space_image_set(Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
Definition image_edit.cc:49
bool ED_image_save_all_modified(const bContext *C, ReportList *reports)
void ED_image_point_pos(SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
bool ED_space_image_paint_curve(const bContext *C)
bool ED_space_image_show_paint(const SpaceImage *sima)
bool ED_space_image_show_render(const SpaceImage *sima)
ListBaseT< ImageFrameRange > ED_image_filesel_detect_sequences(StringRefNull blendfile_path, StringRefNull root_path, wmOperator *op, bool detect_udim)
void ED_space_image_get_size_fl(SpaceImage *sima, float r_size[2])
void ED_image_mouse_pos(SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
bool ED_space_image_maskedit_visible_splines_poll(bContext *C)
float ED_space_image_zoom_level(const View2D *v2d, int grid_dimension)
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
void ED_image_internal_autosave_flush(const Main *bmain)
bool ED_space_image_has_buffer(SpaceImage *sima)
int ED_space_image_get_display_channel_mask(ImBuf *ibuf)
bool ED_space_image_maskedit_poll(bContext *C)
void ED_space_image_scopes_update(const bContext *C, SpaceImage *sima, ImBuf *ibuf, bool use_view_settings)
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
bool ED_image_tools_paint_poll(bContext *C)
void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
float ED_space_image_increment_snap_value(int grid_dimensions, const float grid_steps[SI_GRID_STEPS_LEN], float zoom_factor)
void ED_space_image_paint_update(Main *bmain, wmWindowManager *wm, Scene *scene)
bool ED_space_image_cursor_poll(bContext *C)
void ED_image_view_center_to_point(SpaceImage *sima, float x, float y)
void ED_image_point_pos__reverse(SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports)
Image * ED_space_image(const SpaceImage *sima)
Definition image_edit.cc:43
bool ED_space_image_show_uvedit(const SpaceImage *sima, Object *obedit)
bool ED_image_should_save_modified(const Main *bmain)
Mask * ED_space_image_get_mask(const SpaceImage *sima)
bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
std::array< const char *, 4 > ED_image_buttons_contexts(const bContext *C)
bool ED_space_image_show_mask(const SpaceImage *sima)
void ED_space_image_grid_steps(SpaceImage *sima, float grid_steps_x[SI_GRID_STEPS_LEN], float grid_steps_y[SI_GRID_STEPS_LEN], int grid_dimension)
char filepath[FILE_MAX]
Definition ED_image.hh:214
ImageFrameRange * prev
Definition ED_image.hh:207
ListBaseT< ImageFrame > frames
Definition ED_image.hh:225
ImageFrameRange * next
Definition ED_image.hh:207
ListBaseT< LinkData > udim_tiles
Definition ED_image.hh:222
ImageFrame * next
Definition ED_image.hh:229
ImageFrame * prev
Definition ED_image.hh:229