Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_rect.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_screen.h"
#include "ED_image.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "GPU_immediate.h"
#include "GPU_state.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "SEQ_render.h"
#include "SEQ_sequencer.h"
#include "UI_view2d.h"
#include "WM_api.h"
#include "WM_types.h"
#include "sequencer_intern.h"
#include "ED_util_imbuf.h"
Go to the source code of this file.
Classes | |
struct | ImageSampleInfo |
Typedefs | |
Image Pixel Sample Struct (Operator Custom Data) | |
typedef struct ImageSampleInfo | ImageSampleInfo |
Functions | |
Image Pixel Sample | |
static void | image_sample_pixel_color_ubyte (const ImBuf *ibuf, const int coord[2], uchar r_col[4], float r_col_linear[4]) |
static void | image_sample_pixel_color_float (ImBuf *ibuf, const int coord[2], float r_col[4]) |
Image Pixel Region Sample | |
static void | image_sample_rect_color_ubyte (const ImBuf *ibuf, const rcti *rect, uchar r_col[4], float r_col_linear[4]) |
static void | image_sample_rect_color_float (ImBuf *ibuf, const rcti *rect, float r_col[4]) |
Image Pixel Sample (Internal Utilities) | |
static void | image_sample_apply (bContext *C, wmOperator *op, const wmEvent *event) |
static void | sequencer_sample_apply (bContext *C, wmOperator *op, const wmEvent *event) |
static void | ed_imbuf_sample_apply (bContext *C, wmOperator *op, const wmEvent *event) |
Image Pixel Sample (Public Operator Callback) | |
Callbacks for the sample operator, used by sequencer and image spaces. | |
void | ED_imbuf_sample_draw (const bContext *C, ARegion *region, void *arg_info) |
void | ED_imbuf_sample_exit (bContext *C, wmOperator *op) |
int | ED_imbuf_sample_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
int | ED_imbuf_sample_modal (bContext *C, wmOperator *op, const wmEvent *event) |
void | ED_imbuf_sample_cancel (bContext *C, wmOperator *op) |
bool | ED_imbuf_sample_poll (bContext *C) |
typedef struct ImageSampleInfo ImageSampleInfo |
|
static |
Definition at line 370 of file ed_util_imbuf.c.
References blender::compositor::area(), C, CTX_wm_area(), image_sample_apply(), NULL, sequencer_sample_apply(), SPACE_IMAGE, and SPACE_SEQ.
Referenced by ED_imbuf_sample_invoke(), and ED_imbuf_sample_modal().
void ED_imbuf_sample_cancel | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 524 of file ed_util_imbuf.c.
References C, and ED_imbuf_sample_exit().
Referenced by IMAGE_OT_curves_point_set(), IMAGE_OT_sample(), and SEQUENCER_OT_sample().
Definition at line 397 of file ed_util_imbuf.c.
References blender::compositor::area(), BLI_rctf_init_pt_radius(), C, ImageSampleInfo::channels, ImageSampleInfo::colfp, color, ImageSampleInfo::color_manage, ImageSampleInfo::colp, CTX_data_scene(), CTX_wm_area(), CTX_wm_space_image(), CTX_wm_window(), ImageSampleInfo::draw, ED_image_draw_info(), wmWindow::eventstate, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_logic_op_xor_set(), GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), imm_draw_box_wire_2d(), immBindBuiltinProgram(), immUnbindProgram(), immUniformColor3fv(), immVertexFormat(), ImageSampleInfo::linearcol, pos, ImageSampleInfo::sample_size, scene, SPACE_IMAGE, ImageSampleInfo::use_default_view, ARegion::winrct, ImageSampleInfo::x, rctf::xmax, rcti::xmin, rctf::xmin, ImageSampleInfo::y, rctf::ymax, rcti::ymin, rctf::ymin, ImageSampleInfo::zfp, SpaceImage::zoom, and ImageSampleInfo::zp.
Referenced by ED_imbuf_sample_invoke().
void ED_imbuf_sample_exit | ( | bContext * | C, |
wmOperator * | op | ||
) |
Definition at line 457 of file ed_util_imbuf.c.
References ImageSampleInfo::art, C, CTX_wm_area(), wmOperator::customdata, ImageSampleInfo::draw_handle, ED_area_tag_redraw(), ED_region_draw_cb_exit(), and MEM_freeN.
Referenced by ED_imbuf_sample_cancel(), and ED_imbuf_sample_modal().
int ED_imbuf_sample_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
const wmEvent * | event | ||
) |
Definition at line 466 of file ed_util_imbuf.c.
References blender::compositor::area(), ImageSampleInfo::art, C, CTX_wm_area(), CTX_wm_region(), wmOperator::customdata, ImageSampleInfo::draw_handle, ed_imbuf_sample_apply(), ED_imbuf_sample_draw(), ED_region_draw_cb_activate(), ED_space_image_has_buffer(), ED_space_image_show_cache_and_mval_over(), MEM_callocN, wmEvent::mval, OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, wmOperator::ptr, REGION_DRAW_POST_PIXEL, ARegion::regiontype, RGN_TYPE_WINDOW, RNA_int_get(), ImageSampleInfo::sample_size, SPACE_IMAGE, SPACE_SEQ, ARegion::type, and WM_event_add_modal_handler().
int ED_imbuf_sample_modal | ( | bContext * | C, |
wmOperator * | op, | ||
const wmEvent * | event | ||
) |
Definition at line 506 of file ed_util_imbuf.c.
References C, ed_imbuf_sample_apply(), ED_imbuf_sample_exit(), KM_RELEASE, LEFTMOUSE, MOUSEMOVE, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, RIGHTMOUSE, wmEvent::type, and wmEvent::val.
Definition at line 529 of file ed_util_imbuf.c.
References blender::compositor::area(), C, CTX_data_edit_object(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), ED_space_image_show_uvedit(), SpaceSeq::mainb, SpaceImage::mode, NULL, ARegion::regiontype, RGN_TYPE_PREVIEW, SEQ_DRAW_IMG_IMBUF, SEQ_editing_get(), SI_MODE_VIEW, SPACE_IMAGE, and SPACE_SEQ.
Referenced by IMAGE_OT_sample(), and SEQUENCER_OT_sample().
|
static |
Definition at line 152 of file ed_util_imbuf.c.
References blender::compositor::area(), BKE_curvemapping_set_black_white(), BKE_image_get_tile_from_pos(), C, ImageSampleInfo::channels, ImBuf::channels, CLAMP, ImageSampleInfo::col, ImageSampleInfo::colf, ImageSampleInfo::colfp, ImageSampleInfo::color_manage, ImageSampleInfo::colp, copy_v4_v4(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_image(), ColorManagedViewSettings::curve_mapping, wmOperator::customdata, ImageSampleInfo::draw, ED_area_tag_redraw(), ED_space_image(), ED_space_image_acquire_buffer(), ED_space_image_release_buffer(), G, ImageSampleInfo::height, IMA_VIEW_AS_RENDER, image(), SpaceImage::image, image_sample_rect_color_float(), image_sample_rect_color_ubyte(), ImageSampleInfo::linearcol, lock, max_ii(), min_ii(), wmEvent::mval, NC_WINDOW, NULL, point, wmOperator::ptr, ImBuf::rect, ImBuf::rect_float, rgba_uchar_to_float(), RNA_enum_get(), RNA_struct_find_property(), ImageSampleInfo::sample_size, scene, SPACE_NODE, tile, UI_view2d_region_to_view(), ImageSampleInfo::use_default_view, ARegion::v2d, Scene::view_settings, ImageSampleInfo::width, WM_event_add_notifier(), x, ImageSampleInfo::x, ImBuf::x, rcti::xmax, rcti::xmin, ImageSampleInfo::y, y, ImBuf::y, rcti::ymax, rcti::ymin, ImageSampleInfo::z, ImBuf::zbuf, ImBuf::zbuf_float, ImageSampleInfo::zf, ImageSampleInfo::zfp, and ImageSampleInfo::zp.
Referenced by ed_imbuf_sample_apply().
|
static |
Definition at line 88 of file ed_util_imbuf.c.
References ImBuf::channels, copy_v4_v4(), ImBuf::rect_float, and ImBuf::x.
Referenced by image_sample_rect_color_float().
|
static |
Definition at line 77 of file ed_util_imbuf.c.
References copy_v4_v4_uchar(), IMB_colormanagement_colorspace_to_scene_linear_v4(), ImBuf::rect, ImBuf::rect_colorspace, rgba_uchar_to_float(), and ImBuf::x.
Referenced by image_sample_rect_color_ubyte().
|
static |
Definition at line 130 of file ed_util_imbuf.c.
References add_v4_v4(), image_sample_pixel_color_float(), mul_v4_fl(), rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and zero_v4().
Referenced by image_sample_apply().
|
static |
Definition at line 100 of file ed_util_imbuf.c.
References add_v4_v4(), image_sample_pixel_color_ubyte(), MIN2, mul_v4_fl(), rcti::xmax, rcti::xmin, rcti::ymax, rcti::ymin, and zero_v4().
Referenced by image_sample_apply().
|
static |
Definition at line 287 of file ed_util_imbuf.c.
References C, RenderData::cfra, ImageSampleInfo::channels, ImBuf::channels, ImageSampleInfo::col, ImageSampleInfo::colf, ImageSampleInfo::colfp, ImageSampleInfo::color_manage, ImageSampleInfo::colp, copy_v4_v4(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_area(), CTX_wm_region(), CTX_wm_space_data(), wmOperator::customdata, depsgraph, ImageSampleInfo::draw, ED_area_tag_redraw(), float(), IMB_colormanagement_colorspace_to_scene_linear_v4(), IMB_freeImBuf(), ImageSampleInfo::linearcol, wmEvent::mval, NULL, Scene::r, ImBuf::rect, ImBuf::rect_colorspace, ImBuf::rect_float, scene, SEQ_render_pixel_from_sequencer_space_v4(), sequencer_ibuf_get(), UI_view2d_region_to_view(), ARegion::v2d, x, ImageSampleInfo::x, ImBuf::x, RenderData::xasp, RenderData::xsch, ImageSampleInfo::y, y, ImBuf::y, RenderData::yasp, and RenderData::ysch.
Referenced by ed_imbuf_sample_apply().