Blender V4.3
ED_image.hh File Reference
#include "DNA_listBase.h"
#include "DNA_space_types.h"
#include "BLI_string_ref.hh"

Go to the source code of this file.

Classes

struct  ImageFrameRange
 

Functions

float ED_space_image_zoom_level (const View2D *v2d, int grid_dimension)
 
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)
 
float ED_space_image_increment_snap_value (int grid_dimensions, const float grid_steps[SI_GRID_STEPS_LEN], float zoom_factor)
 
ImageED_space_image (const SpaceImage *sima)
 
void ED_space_image_set (Main *bmain, SpaceImage *sima, Image *ima, bool automatic)
 
void ED_space_image_sync (Main *bmain, Image *image, bool ignore_render_viewer)
 
void ED_space_image_auto_set (const bContext *C, SpaceImage *sima)
 
MaskED_space_image_get_mask (const SpaceImage *sima)
 
void ED_space_image_set_mask (bContext *C, SpaceImage *sima, Mask *mask)
 
bool ED_space_image_get_position (SpaceImage *sima, ARegion *region, const int mval[2], float r_fpos[2])
 
bool ED_space_image_color_sample (SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
 
ImBufED_space_image_acquire_buffer (SpaceImage *sima, void **r_lock, int tile)
 
int ED_space_image_get_display_channel_mask (ImBuf *ibuf)
 
void ED_space_image_release_buffer (SpaceImage *sima, ImBuf *ibuf, void *lock)
 
bool ED_space_image_has_buffer (SpaceImage *sima)
 
void ED_space_image_get_size (SpaceImage *sima, int *r_width, int *r_height)
 
void ED_space_image_get_size_fl (SpaceImage *sima, float r_size[2])
 
void ED_space_image_get_aspect (SpaceImage *sima, float *r_aspx, float *r_aspy)
 
void ED_space_image_get_zoom (SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
 
void ED_space_image_get_uv_aspect (SpaceImage *sima, float *r_aspx, float *r_aspy)
 
void ED_space_image_scopes_update (const bContext *C, SpaceImage *sima, ImBuf *ibuf, bool use_view_settings)
 
void ED_space_image_paint_update (Main *bmain, wmWindowManager *wm, Scene *scene)
 
void ED_image_get_uv_aspect (Image *ima, ImageUser *iuser, float *r_aspx, float *r_aspy)
 
void ED_image_mouse_pos (SpaceImage *sima, const ARegion *region, const int mval[2], float co[2])
 
void ED_image_view_center_to_point (SpaceImage *sima, float x, float y)
 
void ED_image_point_pos (SpaceImage *sima, const ARegion *region, float x, float y, float *r_x, float *r_y)
 
void ED_image_point_pos__reverse (SpaceImage *sima, const ARegion *region, const float co[2], float r_co[2])
 
bool ED_image_slot_cycle (Image *image, int direction)
 
bool ED_space_image_show_render (const SpaceImage *sima)
 
bool ED_space_image_show_paint (const SpaceImage *sima)
 
bool ED_space_image_show_uvedit (const SpaceImage *sima, Object *obedit)
 
bool ED_space_image_paint_curve (const bContext *C)
 
bool ED_space_image_check_show_maskedit (SpaceImage *sima, Object *obedit)
 
bool ED_space_image_maskedit_poll (bContext *C)
 
bool ED_space_image_maskedit_visible_splines_poll (bContext *C)
 
bool ED_space_image_maskedit_mask_poll (bContext *C)
 
bool ED_space_image_maskedit_mask_visible_splines_poll (bContext *C)
 
bool ED_space_image_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_show_cache (const SpaceImage *sima)
 
bool ED_space_image_show_cache_and_mval_over (const SpaceImage *sima, ARegion *region, const int mval[2])
 
bool ED_image_should_save_modified (const Main *bmain)
 
int ED_image_save_all_modified_info (const Main *bmain, ReportList *reports)
 
bool ED_image_save_all_modified (const bContext *C, ReportList *reports)
 
ListBase ED_image_filesel_detect_sequences (blender::StringRefNull root_path, wmOperator *op, bool detect_udim)
 
bool ED_image_tools_paint_poll (bContext *C)
 
void ED_paint_cursor_start (Paint *paint, bool(*poll)(bContext *C))
 

Function Documentation

◆ ED_image_draw_info()

◆ ED_image_filesel_detect_sequences()

◆ ED_image_get_uv_aspect()

void ED_image_get_uv_aspect ( Image * ima,
ImageUser * iuser,
float * r_aspx,
float * r_aspy )

◆ ED_image_mouse_pos()

void ED_image_mouse_pos ( SpaceImage * sima,
const ARegion * region,
const int mval[2],
float co[2] )

Takes event->mval.

Definition at line 325 of file image_edit.cc.

References ED_space_image_get_size(), ED_space_image_get_zoom(), and UI_view2d_view_to_region().

Referenced by ED_mask_mouse_pos().

◆ ED_image_point_pos()

void ED_image_point_pos ( SpaceImage * sima,
const ARegion * region,
float x,
float y,
float * r_x,
float * r_y )

◆ ED_image_point_pos__reverse()

void ED_image_point_pos__reverse ( SpaceImage * sima,
const ARegion * region,
const float co[2],
float r_co[2] )

◆ ED_image_save_all_modified()

◆ ED_image_save_all_modified_info()

◆ ED_image_should_save_modified()

◆ ED_image_slot_cycle()

bool ED_image_slot_cycle ( Image * image,
int direction )

This is more a user-level functionality, for going to next/prev used slot, Stepping onto the last unused slot too.

Definition at line 383 of file image_edit.cc.

References BKE_image_get_renderslot(), BKE_image_partial_update_mark_full_update(), BLI_assert, BLI_listbase_count(), ELEM, and RenderSlot::render.

Referenced by image_cycle_render_slot_exec(), and ui_imageuser_slot_menu_step().

◆ ED_image_tools_paint_poll()

◆ ED_image_view_center_to_point()

void ED_image_view_center_to_point ( SpaceImage * sima,
float x,
float y )

◆ ED_paint_cursor_start()

◆ ED_space_image()

◆ ED_space_image_acquire_buffer()

◆ ED_space_image_auto_set()

◆ ED_space_image_check_show_maskedit()

bool ED_space_image_check_show_maskedit ( SpaceImage * sima,
Object * obedit )

Matches clip function.

Definition at line 484 of file image_edit.cc.

References ED_space_image_show_uvedit(), SpaceImage::mode, and SI_MODE_MASK.

Referenced by ED_space_image_maskedit_poll(), image_listener(), and image_view_selected_exec().

◆ ED_space_image_color_sample()

◆ ED_space_image_cursor_poll()

◆ ED_space_image_get_aspect()

◆ ED_space_image_get_display_channel_mask()

int ED_space_image_get_display_channel_mask ( ImBuf * ibuf)

Get the SpaceImage flag that is valid for the given ibuf.

Definition at line 191 of file image_edit.cc.

References ImBuf::channels, result, SI_SHOW_ALPHA, SI_SHOW_B, SI_SHOW_G, SI_SHOW_R, SI_SHOW_ZBUF, and SI_USE_ALPHA.

Referenced by blender::draw::image_engine::SpaceImageAccessor::get_shader_parameters().

◆ ED_space_image_get_mask()

◆ ED_space_image_get_position()

bool ED_space_image_get_position ( SpaceImage * sima,
ARegion * region,
const int mval[2],
float r_fpos[2] )

Returns mouse position in image space.

Definition at line 3464 of file image_ops.cc.

References ED_space_image_acquire_buffer(), ED_space_image_release_buffer(), lock, and UI_view2d_region_to_view().

Referenced by eyedropper_cryptomatte_sample_fl().

◆ ED_space_image_get_size()

◆ ED_space_image_get_size_fl()

void ED_space_image_get_size_fl ( SpaceImage * sima,
float r_size[2] )

Definition at line 254 of file image_edit.cc.

References ED_space_image_get_size().

◆ ED_space_image_get_uv_aspect()

void ED_space_image_get_uv_aspect ( SpaceImage * sima,
float * r_aspx,
float * r_aspy )

◆ ED_space_image_get_zoom()

◆ ED_space_image_grid_steps()

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 )

◆ ED_space_image_has_buffer()

◆ ED_space_image_increment_snap_value()

float ED_space_image_increment_snap_value ( int grid_dimensions,
const float grid_steps[SI_GRID_STEPS_LEN],
float zoom_factor )

Calculate the increment snapping value for UV/image editor based on the zoom factor The code in here (except the offset part) is used in grid_frag.glsl (see grid_res) for drawing the grid overlay for the UV/Image editor.

Definition at line 600 of file image_draw.cc.

References SI_GRID_STEPS_LEN.

Referenced by transform_snap_grid_init().

◆ ED_space_image_maskedit_mask_poll()

bool ED_space_image_maskedit_mask_poll ( bContext * C)

Returns true when the following conditions are met:

  • Current space is Image Editor.
  • The image editor is not an UV Editor.
  • It is set to Mask mode.
  • The space has mask opened.

Definition at line 534 of file image_edit.cc.

References CTX_wm_space_image(), ED_space_image_maskedit_poll(), MaskSpaceInfo::mask, and SpaceImage::mask_info.

Referenced by ED_maskedit_mask_poll(), and ED_space_image_maskedit_mask_visible_splines_poll().

◆ ED_space_image_maskedit_mask_visible_splines_poll()

bool ED_space_image_maskedit_mask_visible_splines_poll ( bContext * C)

Returns true when the following conditions are met:

  • Current space is Image Editor.
  • The image editor is not an UV Editor.
  • It is set to Mask mode.
  • The space has mask opened.
  • Mask has visible and editable splines.

Definition at line 544 of file image_edit.cc.

References CTX_wm_space_image(), MaskSpaceInfo::draw_flag, ED_space_image_maskedit_mask_poll(), MASK_DRAWFLAG_SPLINE, and SpaceImage::mask_info.

Referenced by ED_maskedit_mask_visible_splines_poll().

◆ ED_space_image_maskedit_poll()

bool ED_space_image_maskedit_poll ( bContext * C)

Returns true when the following conditions are met:

  • Current space is Image Editor.
  • The image editor is not a UV Editor.
  • It is set to Mask mode.

It is not required to have mask opened for editing.

Definition at line 494 of file image_edit.cc.

References BKE_view_layer_edit_object_get(), BKE_view_layer_synced_ensure(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), and ED_space_image_check_show_maskedit().

Referenced by ED_maskedit_poll(), ED_space_image_cursor_poll(), ED_space_image_maskedit_mask_poll(), and ED_space_image_maskedit_visible_splines_poll().

◆ ED_space_image_maskedit_visible_splines_poll()

bool ED_space_image_maskedit_visible_splines_poll ( bContext * C)

Returns true when the following conditions are met:

  • Current space is Image Editor.
  • The image editor is not a UV Editor.
  • It is set to Mask mode.
  • Mask has visible and editable splines.

It is not required to have mask opened for editing.

Definition at line 509 of file image_edit.cc.

References CTX_wm_space_image(), MaskSpaceInfo::draw_flag, ED_space_image_maskedit_poll(), MASK_DRAWFLAG_SPLINE, and SpaceImage::mask_info.

Referenced by ED_maskedit_visible_splines_poll().

◆ ED_space_image_paint_curve()

bool ED_space_image_paint_curve ( const bContext * C)

◆ ED_space_image_paint_update()

void ED_space_image_paint_update ( Main * bmain,
wmWindowManager * wm,
Scene * scene )

Enable the paint cursor if it isn't already.

purpose is to make sure the paint cursor is shown if paint mode is enabled in the image editor. The paint poll will ensure that the cursor is hidden when not in paint mode.

Definition at line 476 of file paint_image.cc.

References BKE_paint_init(), ED_image_tools_paint_poll(), ED_paint_cursor_start(), LISTBASE_FOREACH, ImagePaintSettings::paint, paint_cursor_delete_textures(), PAINT_CURSOR_TEXTURE_PAINT, SI_MODE_PAINT, SPACE_IMAGE, Texture2D, wmWindowManager::windows, and WM_window_get_active_screen().

Referenced by ED_editors_init().

◆ ED_space_image_release_buffer()

◆ ED_space_image_scopes_update()

◆ ED_space_image_set()

◆ ED_space_image_set_mask()

void ED_space_image_set_mask ( bContext * C,
SpaceImage * sima,
Mask * mask )

◆ ED_space_image_show_cache()

bool ED_space_image_show_cache ( const SpaceImage * sima)

◆ ED_space_image_show_cache_and_mval_over()

bool ED_space_image_show_cache_and_mval_over ( const SpaceImage * sima,
ARegion * region,
const int mval[2] )

◆ ED_space_image_show_paint()

bool ED_space_image_show_paint ( const SpaceImage * sima)

Definition at line 452 of file image_edit.cc.

References ED_space_image_show_render(), SpaceImage::mode, and SI_MODE_PAINT.

◆ ED_space_image_show_render()

bool ED_space_image_show_render ( const SpaceImage * sima)

◆ ED_space_image_show_uvedit()

◆ ED_space_image_sync()

◆ ED_space_image_zoom_level()

float ED_space_image_zoom_level ( const View2D * v2d,
int grid_dimension )