|
Blender
V2.93
|
#include "DNA_node_types.h"#include "BLI_math.h"#include "BLI_rect.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "BKE_image.h"#include "BKE_main.h"#include "BKE_node.h"#include "BKE_screen.h"#include "ED_image.h"#include "ED_node.h"#include "ED_screen.h"#include "ED_space_api.h"#include "RNA_access.h"#include "RNA_define.h"#include "WM_api.h"#include "WM_types.h"#include "UI_view2d.h"#include "MEM_guardedalloc.h"#include "IMB_colormanagement.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "node_intern.h"Go to the source code of this file.
Classes | |
| struct | NodeViewMove |
| struct | ImageSampleInfo |
Functions | |
View All Operator | |
| int | space_node_view_flag (bContext *C, SpaceNode *snode, ARegion *region, const int node_flag, const int smooth_viewtx) |
| static int | node_view_all_exec (bContext *C, wmOperator *op) |
| void | NODE_OT_view_all (wmOperatorType *ot) |
View Selected Operator | |
| static int | node_view_selected_exec (bContext *C, wmOperator *op) |
| void | NODE_OT_view_selected (wmOperatorType *ot) |
Background Image Zoom | |
| static int | backimage_zoom_exec (bContext *C, wmOperator *op) |
| void | NODE_OT_backimage_zoom (wmOperatorType *ot) |
Background Image Fit | |
| static int | backimage_fit_exec (bContext *C, wmOperator *UNUSED(op)) |
| void | NODE_OT_backimage_fit (wmOperatorType *ot) |
Background Image Operators | |
| typedef struct NodeViewMove | NodeViewMove |
| static int | snode_bg_viewmove_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | snode_bg_viewmove_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | snode_bg_viewmove_cancel (bContext *UNUSED(C), wmOperator *op) |
| void | NODE_OT_backimage_move (wmOperatorType *ot) |
Sample Backdrop Operator | |
| typedef struct ImageSampleInfo | ImageSampleInfo |
| static void | sample_draw (const bContext *C, ARegion *region, void *arg_info) |
| bool | ED_space_node_get_position (Main *bmain, SpaceNode *snode, struct ARegion *ar, const int mval[2], float fpos[2]) |
| bool | ED_space_node_color_sample (Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3]) |
| static void | sample_apply (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | sample_exit (bContext *C, wmOperator *op) |
| static int | sample_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | sample_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | sample_cancel (bContext *C, wmOperator *op) |
| void | NODE_OT_backimage_sample (wmOperatorType *ot) |
| typedef struct ImageSampleInfo ImageSampleInfo |
| typedef struct NodeViewMove NodeViewMove |
|
static |
Definition at line 343 of file node_view.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), BKE_image_release_ibuf(), C, CTX_data_main(), CTX_wm_region(), CTX_wm_space_node(), ED_region_tag_redraw(), IMA_TYPE_COMPOSITE, min_ff(), NC_NODE, NC_SPACE, ND_DISPLAY, ND_SPACE_NODE_VIEW, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, ARegion::sizex, ARegion::sizey, WM_main_add_notifier(), ImBuf::x, SpaceNode::xof, ImBuf::y, SpaceNode::yof, and SpaceNode::zoom.
Referenced by NODE_OT_backimage_fit().
|
static |
Definition at line 304 of file node_view.c.
References C, CTX_wm_region(), CTX_wm_space_node(), ED_region_tag_redraw(), NC_NODE, NC_SPACE, ND_DISPLAY, ND_SPACE_NODE_VIEW, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_float_get(), WM_main_add_notifier(), and SpaceNode::zoom.
Referenced by NODE_OT_backimage_zoom().
| bool ED_space_node_color_sample | ( | Main * | bmain, |
| SpaceNode * | snode, | ||
| ARegion * | region, | ||
| const int | mval[2], | ||
| float | r_col[3] | ||
| ) |
Definition at line 475 of file node_view.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), BKE_image_release_ibuf(), ImBuf::channels, CLAMP, copy_v3_v3(), ED_node_is_compositor(), SpaceNode::flag, float(), IMA_TYPE_COMPOSITE, IMB_colormanagement_colorspace_to_scene_linear_v3(), NULL, ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, ret, rgb_uchar_to_float(), SNODE_BACKDRAW, ARegion::winx, ARegion::winy, x, ImBuf::x, SpaceNode::xof, y, ImBuf::y, SpaceNode::yof, and SpaceNode::zoom.
Referenced by eyedropper_color_sample_fl().
| bool ED_space_node_get_position | ( | Main * | bmain, |
| SpaceNode * | snode, | ||
| struct ARegion * | ar, | ||
| const int | mval[2], | ||
| float | fpos[2] | ||
| ) |
Definition at line 447 of file node_view.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), BKE_image_release_ibuf(), ED_node_is_compositor(), SpaceNode::flag, float(), IMA_TYPE_COMPOSITE, NULL, SNODE_BACKDRAW, ARegion::winx, ARegion::winy, ImBuf::x, SpaceNode::xof, ImBuf::y, SpaceNode::yof, and SpaceNode::zoom.
Referenced by eyedropper_cryptomatte_sample_fl().
| void NODE_OT_backimage_fit | ( | wmOperatorType * | ot | ) |
Definition at line 383 of file node_view.c.
References backimage_fit_exec(), composite_node_active(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_BLOCKING, ot, and wmOperatorType::poll.
Referenced by node_operatortypes().
| void NODE_OT_backimage_move | ( | wmOperatorType * | ot | ) |
Definition at line 281 of file node_view.c.
References wmOperatorType::cancel, composite_node_active(), wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_GRAB_CURSOR_XY, ot, wmOperatorType::poll, snode_bg_viewmove_cancel(), snode_bg_viewmove_invoke(), and snode_bg_viewmove_modal().
Referenced by node_operatortypes().
| void NODE_OT_backimage_sample | ( | wmOperatorType * | ot | ) |
Definition at line 683 of file node_view.c.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_node_active(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, wmOperatorType::poll, sample_cancel(), sample_invoke(), and sample_modal().
Referenced by node_operatortypes().
| void NODE_OT_backimage_zoom | ( | wmOperatorType * | ot | ) |
Definition at line 318 of file node_view.c.
References backimage_zoom_exec(), composite_node_active(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_BLOCKING, ot, wmOperatorType::poll, RNA_def_float(), and wmOperatorType::srna.
Referenced by node_operatortypes().
| void NODE_OT_view_all | ( | wmOperatorType * | ot | ) |
Definition at line 140 of file node_view.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_view_all_exec(), ot, and wmOperatorType::poll.
Referenced by node_operatortypes().
| void NODE_OT_view_selected | ( | wmOperatorType * | ot | ) |
Definition at line 173 of file node_view.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_view_selected_exec(), ot, and wmOperatorType::poll.
Referenced by node_operatortypes().
|
static |
Definition at line 124 of file node_view.c.
References C, CTX_wm_region(), CTX_wm_space_node(), OPERATOR_CANCELLED, OPERATOR_FINISHED, space_node_view_flag(), WM_operator_smooth_viewtx_get(), SpaceNode::xof, and SpaceNode::yof.
Referenced by NODE_OT_view_all().
|
static |
Definition at line 161 of file node_view.c.
References C, CTX_wm_region(), CTX_wm_space_node(), NODE_SELECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, space_node_view_flag(), and WM_operator_smooth_viewtx_get().
Referenced by NODE_OT_view_selected().
|
static |
Definition at line 530 of file node_view.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), BKE_image_release_ibuf(), C, ImageSampleInfo::channels, ImBuf::channels, CLAMP, ImageSampleInfo::col, ImageSampleInfo::colf, ImageSampleInfo::color_manage, copy_v4_v4(), CTX_data_main(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_node(), wmOperator::customdata, ImageSampleInfo::draw, ED_area_tag_redraw(), ED_node_sample_set(), float(), IMA_TYPE_COMPOSITE, IMB_colormanagement_colorspace_to_scene_linear_v4(), IMB_rect_from_float(), ImageSampleInfo::linearcol, wmEvent::mval, NULL, ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, ARegion::winx, ARegion::winy, x, ImageSampleInfo::x, ImBuf::x, SpaceNode::xof, ImageSampleInfo::y, y, ImBuf::y, SpaceNode::yof, ImageSampleInfo::z, ImBuf::zbuf, ImBuf::zbuf_float, ImageSampleInfo::zf, ImageSampleInfo::zfp, SpaceNode::zoom, and ImageSampleInfo::zp.
Referenced by sample_invoke(), and sample_modal().
|
static |
Definition at line 678 of file node_view.c.
References C, and sample_exit().
Referenced by NODE_OT_backimage_sample().
Definition at line 425 of file node_view.c.
References C, ImageSampleInfo::channels, ImageSampleInfo::col, ImageSampleInfo::colf, ImageSampleInfo::color_manage, CTX_data_scene(), ImageSampleInfo::draw, ED_image_draw_info(), ImageSampleInfo::linearcol, scene, ImageSampleInfo::x, ImageSampleInfo::y, ImageSampleInfo::zfp, and ImageSampleInfo::zp.
Referenced by sample_invoke().
|
static |
Definition at line 627 of file node_view.c.
References ImageSampleInfo::art, C, CTX_wm_area(), wmOperator::customdata, ImageSampleInfo::draw_handle, ED_area_tag_redraw(), ED_node_sample_set(), ED_region_draw_cb_exit(), MEM_freeN, and NULL.
Referenced by sample_cancel(), and sample_modal().
|
static |
Definition at line 637 of file node_view.c.
References ImageSampleInfo::art, C, CTX_wm_region(), CTX_wm_space_node(), wmOperator::customdata, ImageSampleInfo::draw_handle, ED_node_is_compositor(), ED_region_draw_cb_activate(), SpaceNode::flag, MEM_callocN, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, REGION_DRAW_POST_PIXEL, sample_apply(), sample_draw(), SNODE_BACKDRAW, ARegion::type, and WM_event_add_modal_handler().
Referenced by NODE_OT_backimage_sample().
|
static |
Definition at line 660 of file node_view.c.
References C, KM_RELEASE, LEFTMOUSE, MOUSEMOVE, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, sample_apply(), sample_exit(), wmEvent::type, and wmEvent::val.
Referenced by NODE_OT_backimage_sample().
|
static |
Definition at line 275 of file node_view.c.
References wmOperator::customdata, MEM_freeN, and NULL.
Referenced by NODE_OT_backimage_move().
|
static |
Definition at line 237 of file node_view.c.
References BKE_image_acquire_ibuf(), BKE_image_ensure_viewer(), BKE_image_release_ibuf(), C, CTX_data_main(), CTX_wm_region(), CTX_wm_space_node(), wmOperator::customdata, IMA_TYPE_COMPOSITE, MEM_callocN, NodeViewMove::mvalo, NULL, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, ARegion::winx, ARegion::winy, WM_event_add_modal_handler(), ImBuf::x, NodeViewMove::xmax, NodeViewMove::xmin, ImBuf::y, NodeViewMove::ymax, NodeViewMove::ymin, and SpaceNode::zoom.
Referenced by NODE_OT_backimage_move().
|
static |
Definition at line 199 of file node_view.c.
References C, CLAMP, CTX_wm_region(), CTX_wm_space_node(), wmOperator::customdata, ED_region_tag_redraw(), KM_RELEASE, LEFTMOUSE, MEM_freeN, MIDDLEMOUSE, MOUSEMOVE, NodeViewMove::mvalo, NC_NODE, NC_SPACE, ND_DISPLAY, ND_SPACE_NODE_VIEW, NULL, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, wmEvent::type, wmEvent::val, WM_main_add_notifier(), NodeViewMove::xmax, NodeViewMove::xmin, SpaceNode::xof, NodeViewMove::ymax, NodeViewMove::ymin, and SpaceNode::yof.
Referenced by NODE_OT_backimage_move().
| int space_node_view_flag | ( | bContext * | C, |
| SpaceNode * | snode, | ||
| ARegion * | region, | ||
| const int | node_flag, | ||
| const int | smooth_viewtx | ||
| ) |
Definition at line 61 of file node_view.c.
References BLI_rctf_init_minmax(), BLI_rctf_resize(), BLI_rctf_scale(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rctf_union(), C, View2D::cur, SpaceNode::edittree, ListBase::first, height, node, NODE_FRAME, bNodeTree::nodes, UI_view2d_smooth_view(), ARegion::v2d, width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by node_find_exec_fn(), node_select_same_type_step_exec(), node_view_all_exec(), and node_view_selected_exec().