Blender V5.0
space_image.cc File Reference
#include "DNA_defaults.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_image_types.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_string_utf8.h"
#include "BLI_threads.h"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_image.hh"
#include "BKE_layer.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "IMB_imbuf_types.hh"
#include "ED_asset_shelf.hh"
#include "ED_image.hh"
#include "ED_mask.hh"
#include "ED_node.hh"
#include "ED_render.hh"
#include "ED_screen.hh"
#include "ED_space_api.hh"
#include "ED_transform.hh"
#include "ED_util.hh"
#include "ED_uvedit.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "UI_view2d.hh"
#include "BLO_read_write.hh"
#include "DRW_engine.hh"
#include "image_intern.hh"

Go to the source code of this file.

Functions

static void image_scopes_tag_refresh (ScrArea *area)
static void image_user_refresh_scene (const bContext *C, SpaceImage *sima)
static SpaceLinkimage_create (const ScrArea *, const Scene *)
static void image_free (SpaceLink *sl)
static void image_init (wmWindowManager *, ScrArea *area)
static SpaceLinkimage_duplicate (SpaceLink *sl)
static void image_operatortypes ()
static void image_keymap (wmKeyConfig *keyconf)
static void image_dropboxes ()
static void image_refresh (const bContext *C, ScrArea *area)
static void image_listener (const wmSpaceTypeListenerParams *params)
static int image_context (const bContext *C, const char *member, bContextDataResult *result)
static void IMAGE_GGT_gizmo2d (wmGizmoGroupType *gzgt)
static void IMAGE_GGT_gizmo2d_translate (wmGizmoGroupType *gzgt)
static void IMAGE_GGT_gizmo2d_resize (wmGizmoGroupType *gzgt)
static void IMAGE_GGT_gizmo2d_rotate (wmGizmoGroupType *gzgt)
static void IMAGE_GGT_navigate (wmGizmoGroupType *gzgt)
static void image_widgets ()
static void image_main_region_set_view2d (SpaceImage *sima, ARegion *region)
static void image_main_region_init (wmWindowManager *wm, ARegion *region)
static void image_main_region_draw (const bContext *C, ARegion *region)
static void image_main_region_listener (const wmRegionListenerParams *params)
static void image_buttons_region_init (wmWindowManager *wm, ARegion *region)
static void image_buttons_region_layout (const bContext *C, ARegion *region)
static void image_buttons_region_draw (const bContext *C, ARegion *region)
static void image_buttons_region_listener (const wmRegionListenerParams *params)
static void image_tools_region_init (wmWindowManager *wm, ARegion *region)
static void image_tools_region_draw (const bContext *C, ARegion *region)
static void image_tools_region_listener (const wmRegionListenerParams *params)
static void image_tools_header_region_draw (const bContext *C, ARegion *region)
static void image_header_region_init (wmWindowManager *, ARegion *region)
static void image_header_region_draw (const bContext *C, ARegion *region)
static void image_header_region_listener (const wmRegionListenerParams *params)
static void image_asset_shelf_region_init (wmWindowManager *wm, ARegion *region)
static void image_id_remap (ScrArea *, SpaceLink *slink, const blender::bke::id::IDRemapper &mappings)
static void image_foreach_id (SpaceLink *space_link, LibraryForeachIDData *data)
static int image_space_subtype_get (ScrArea *area)
static void image_space_subtype_set (ScrArea *area, int value)
static void image_space_subtype_item_extend (bContext *, EnumPropertyItem **item, int *totitem)
static blender::StringRefNull image_space_name_get (const ScrArea *area)
static int image_space_icon_get (const ScrArea *area)
static void image_space_blend_read_data (BlendDataReader *, SpaceLink *sl)
static void image_space_blend_write (BlendWriter *writer, SpaceLink *sl)
void ED_spacetype_image ()

Variables

const char * image_context_dir [] = {"edit_image", "edit_mask", nullptr}

Function Documentation

◆ ED_spacetype_image()

void ED_spacetype_image ( )

Definition at line 1222 of file space_image.cc.

References BKE_spacetype_register(), BLI_addhead(), ARegionType::context, blender::ed::asset::shelf::context(), ARegionType::draw, ARegionType::duplicate, ED_area_do_mgs_subscribe_for_tool_header(), ED_area_do_mgs_subscribe_for_tool_ui(), ED_area_type_hud(), ED_KEYMAP_ASSET_SHELF, ED_KEYMAP_FOOTER, ED_KEYMAP_FRAMES, ED_KEYMAP_GIZMO, ED_KEYMAP_GPENCIL, ED_KEYMAP_HEADER, ED_KEYMAP_TOOL, ED_KEYMAP_UI, ED_KEYMAP_VIEW2D, ED_region_generic_panel_region_snap_size(), ED_region_generic_tools_region_message_subscribe(), ED_region_generic_tools_region_snap_size(), ED_uvedit_buttons_register(), ARegionType::free, blender::ed::asset::shelf::header_region(), blender::ed::asset::shelf::header_region_init(), blender::ed::asset::shelf::header_region_listen(), HEADERY, image_asset_shelf_region_init(), image_buttons_region_draw(), image_buttons_region_init(), image_buttons_region_layout(), image_buttons_region_listener(), image_buttons_register(), image_context(), image_create(), image_dropboxes(), image_duplicate(), image_foreach_id(), image_free(), image_header_region_draw(), image_header_region_init(), image_header_region_listener(), image_id_remap(), image_init(), image_keymap(), image_listener(), image_main_region_draw(), image_main_region_init(), image_main_region_listener(), image_operatortypes(), image_refresh(), image_space_blend_read_data(), image_space_blend_write(), image_space_icon_get(), image_space_name_get(), image_space_subtype_get(), image_space_subtype_item_extend(), image_space_subtype_set(), image_tools_header_region_draw(), image_tools_region_draw(), image_tools_region_init(), image_tools_region_listener(), image_widgets(), ARegionType::init, ARegionType::keymapflag, ARegionType::layout, ARegionType::listener, ARegionType::lock, MEM_callocN(), ARegionType::message_subscribe, ARegionType::on_poll_success, ARegionType::on_user_resize, ARegionType::poll, ARegionType::prefsizex, ARegionType::prefsizey, blender::ed::asset::shelf::region_draw(), REGION_DRAW_LOCK_BAKING, blender::ed::asset::shelf::region_duplicate(), blender::ed::asset::shelf::region_free(), blender::ed::asset::shelf::region_layout(), blender::ed::asset::shelf::region_listen(), blender::ed::asset::shelf::region_message_subscribe(), blender::ed::asset::shelf::region_on_poll_success(), blender::ed::asset::shelf::region_on_user_resize(), blender::ed::asset::shelf::region_snap(), ARegionType::regionid, blender::ed::asset::shelf::regions_poll(), RGN_TYPE_ASSET_SHELF, RGN_TYPE_ASSET_SHELF_HEADER, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_WINDOW, ARegionType::snap_size, SPACE_IMAGE, STRNCPY_UTF8, blender::ed::asset::shelf::types_register(), UI_SIDEBAR_PANEL_WIDTH, and UI_TOOLBAR_WIDTH.

Referenced by ED_spacetypes_init().

◆ image_asset_shelf_region_init()

void image_asset_shelf_region_init ( wmWindowManager * wm,
ARegion * region )
static

◆ image_buttons_region_draw()

◆ image_buttons_region_init()

◆ image_buttons_region_layout()

◆ image_buttons_region_listener()

◆ image_context()

◆ image_create()

◆ image_dropboxes()

void image_dropboxes ( )
static

Definition at line 274 of file space_image.cc.

Referenced by ED_spacetype_image().

◆ image_duplicate()

SpaceLink * image_duplicate ( SpaceLink * sl)
static

Definition at line 200 of file space_image.cc.

References BKE_scopes_new(), MEM_dupallocN(), and SpaceImage::scopes.

Referenced by ED_spacetype_image().

◆ image_foreach_id()

◆ image_free()

void image_free ( SpaceLink * sl)
static

Definition at line 184 of file space_image.cc.

References BKE_scopes_free(), and SpaceImage::scopes.

Referenced by ED_spacetype_image().

◆ IMAGE_GGT_gizmo2d()

◆ IMAGE_GGT_gizmo2d_resize()

◆ IMAGE_GGT_gizmo2d_rotate()

◆ IMAGE_GGT_gizmo2d_translate()

◆ IMAGE_GGT_navigate()

void IMAGE_GGT_navigate ( wmGizmoGroupType * gzgt)
static

Definition at line 529 of file space_image.cc.

References VIEW2D_GGT_navigate_impl().

Referenced by image_widgets().

◆ image_header_region_draw()

void image_header_region_draw ( const bContext * C,
ARegion * region )
static

◆ image_header_region_init()

void image_header_region_init ( wmWindowManager * ,
ARegion * region )
static

Definition at line 1041 of file space_image.cc.

References ED_region_header_init().

Referenced by ED_spacetype_image().

◆ image_header_region_listener()

◆ image_id_remap()

◆ image_init()

void image_init ( wmWindowManager * ,
ScrArea * area )
static

◆ image_keymap()

void image_keymap ( wmKeyConfig * keyconf)
static

Definition at line 267 of file space_image.cc.

References RGN_TYPE_WINDOW, SPACE_IMAGE, and WM_keymap_ensure().

Referenced by ED_spacetype_image().

◆ image_listener()

◆ image_main_region_draw()

void image_main_region_draw ( const bContext * C,
ARegion * region )
static

Definition at line 638 of file space_image.cc.

References BKE_render_resolution(), MaskSpaceInfo::blend_factor, BLI_rctf_init(), BLI_rcti_init(), BLI_thread_lock(), BLI_thread_unlock(), C, CTX_data_edit_object(), CTX_data_expect_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_space_image(), depsgraph, MaskSpaceInfo::draw_flag, draw_image_cache(), draw_image_main_helpers(), draw_image_sample_line(), MaskSpaceInfo::draw_type, DRW_draw_view(), ED_mask_draw_region(), ED_region_image_metadata_draw(), ED_region_image_overlay_info_text_draw(), ED_region_image_render_region_draw(), ED_region_visible_rect(), ED_space_image(), ED_space_image_acquire_buffer(), ED_space_image_get_aspect(), ED_space_image_get_mask(), ED_space_image_get_size(), ED_space_image_get_zoom(), ED_space_image_release_buffer(), ED_space_image_show_uvedit(), ELEM, SpaceImage::flag, SpaceImageOverlay::flag, SpaceImage::gizmo_flag, IMA_SRC_VIEWER, IMA_TYPE_COMPOSITE, image_main_region_set_view2d(), image_user_refresh_scene(), lock, LOCK_DRAW_IMAGE, mask(), MASK_DRAWFLAG_OVERLAY, SpaceImage::mask_info, SpaceImage::mode, SpaceImage::overlay, MaskSpaceInfo::overlay_mode, SpaceImageOverlay::passepartout_alpha, Scene::r, R_COMP_CROP, ARegion::runtime, RenderData::scemode, SI_DRAW_METADATA, SI_GIZMO_HIDE, SI_MODE_MASK, SI_MODE_VIEW, SI_OVERLAY_DRAW_RENDER_REGION, SI_OVERLAY_DRAW_TEXT_INFO, SI_OVERLAY_SHOW_OVERLAYS, Image::source, Image::type, U, UI_view2d_view_ortho(), UI_view2d_view_restore(), UI_view2d_view_to_region(), ARegion::v2d, WM_gizmomap_draw(), WM_GIZMOMAP_DRAWSTEP_2D, ImBuf::x, x, rcti::xmin, ImBuf::y, y, and rcti::ymax.

Referenced by ED_spacetype_image().

◆ image_main_region_init()

◆ image_main_region_listener()

◆ image_main_region_set_view2d()

◆ image_operatortypes()

◆ image_refresh()

void image_refresh ( const bContext * C,
ScrArea * area )
static

◆ image_scopes_tag_refresh()

void image_scopes_tag_refresh ( ScrArea * area)
static

◆ image_space_blend_read_data()

◆ image_space_blend_write()

void image_space_blend_write ( BlendWriter * writer,
SpaceLink * sl )
static

Definition at line 1215 of file space_image.cc.

References BLO_write_struct.

Referenced by ED_spacetype_image().

◆ image_space_icon_get()

int image_space_icon_get ( const ScrArea * area)
static

◆ image_space_name_get()

◆ image_space_subtype_get()

int image_space_subtype_get ( ScrArea * area)
static
Note
Used for splitting out a subset of modes is more involved, The previous non-uv-edit mode is stored so switching back to the image doesn't always reset the sub-mode.

Definition at line 1143 of file space_image.cc.

References ListBase::first, SpaceImage::mode, SI_MODE_UV, SI_MODE_VIEW, and ScrArea::spacedata.

Referenced by ED_spacetype_image().

◆ image_space_subtype_item_extend()

void image_space_subtype_item_extend ( bContext * ,
EnumPropertyItem ** item,
int * totitem )
static

Definition at line 1163 of file space_image.cc.

References RNA_enum_items_add(), and rna_enum_space_image_mode_items.

Referenced by ED_spacetype_image().

◆ image_space_subtype_set()

void image_space_subtype_set ( ScrArea * area,
int value )
static

◆ image_tools_header_region_draw()

void image_tools_header_region_draw ( const bContext * C,
ARegion * region )
static

◆ image_tools_region_draw()

void image_tools_region_draw ( const bContext * C,
ARegion * region )
static

Definition at line 978 of file space_image.cc.

References C, and ED_region_panels().

Referenced by ED_spacetype_image().

◆ image_tools_region_init()

◆ image_tools_region_listener()

◆ image_user_refresh_scene()

◆ image_widgets()

Variable Documentation

◆ image_context_dir

const char* image_context_dir[] = {"edit_image", "edit_mask", nullptr}

Definition at line 447 of file space_image.cc.