96 float r_col_linear[4])
98 const uchar *cp = (
unsigned char *)(ibuf->
rect + coord[1] * ibuf->
x + coord[0]);
119 float r_col_linear[4])
121 uint col_accum_ub[4] = {0, 0, 0, 0};
125 for (coord[0] = rect->
xmin; coord[0] <= rect->
xmax; coord[0]++) {
126 for (coord[1] = rect->
ymin; coord[1] <= rect->
ymax; coord[1]++) {
127 float col_temp_fl[4];
128 uchar col_temp_ub[4];
131 col_accum_ub[0] += (
uint)col_temp_ub[0];
132 col_accum_ub[1] += (
uint)col_temp_ub[1];
133 col_accum_ub[2] += (
uint)col_temp_ub[2];
134 col_accum_ub[3] += (
uint)col_temp_ub[3];
138 mul_v4_fl(r_col_linear, 1.0 / (
float)col_tot);
140 r_col[0] =
MIN2(col_accum_ub[0] / col_tot, 255);
141 r_col[1] =
MIN2(col_accum_ub[1] / col_tot, 255);
142 r_col[2] =
MIN2(col_accum_ub[2] / col_tot, 255);
143 r_col[3] =
MIN2(col_accum_ub[3] / col_tot, 255);
151 for (coord[0] = rect->
xmin; coord[0] <= rect->
xmax; coord[0]++) {
152 for (coord[1] = rect->
ymin; coord[1] <= rect->
ymax; coord[1]++) {
153 float col_temp_fl[4];
190 if (uv[0] >= 0.0f && uv[1] >= 0.0f && uv[0] < 1.0f && uv[1] < 1.0f) {
191 int x = (int)(uv[0] * ibuf->
x),
y = (int)(uv[1] * ibuf->
y);
232 info->
colf[3] = 1.0f;
237 info->
colf[3] = 1.0f;
248 info->
z = ibuf->
zbuf[
y * ibuf->
x +
x];
250 if (ibuf->
zbuf == (
int *)ibuf->
rect) {
257 info->
zfp = &info->
zf;
263 if (curve_mapping && ibuf->
channels == 4) {
271 else if (point == 0) {
283 node_curvemap_sample(fp);
284 for (sa =
G.curscreen->areabase.first; sa; sa = sa->
next) {
287 scrarea_do_windraw(sa);
290 node_curvemap_sample(
NULL);
329 if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->
x && fy < ibuf->
y) {
332 int x = (int)fx,
y = (
int)fy;
343 cp = (
unsigned char *)(ibuf->
rect +
y * ibuf->
x +
x);
345 info->
col[0] = cp[0];
346 info->
col[1] = cp[1];
347 info->
col[2] = cp[2];
348 info->
col[3] = cp[3];
366 info->
colf[0] = fp[0];
367 info->
colf[1] = fp[1];
368 info->
colf[2] = fp[2];
369 info->
colf[3] = fp[3];
441 const float color[3] = {1, 1, 1};
456 (
float)sample_rect_fl.
xmin,
457 (
float)sample_rect_fl.
ymin,
458 (
float)sample_rect_fl.
xmax,
459 (
float)sample_rect_fl.
ymax);
515 switch (event->
type) {
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct SpaceSeq * CTX_wm_space_seq(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct SpaceLink * CTX_wm_space_data(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
int BKE_image_get_tile_from_pos(struct Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void zero_v4(float r[4])
void BLI_rctf_init_pt_radius(struct rctf *rect, const float xy[2], float size)
struct Depsgraph Depsgraph
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
bool ED_space_image_has_buffer(struct SpaceImage *sima)
void ED_image_draw_info(struct Scene *scene, struct 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], const int *zp, const float *zpf)
struct Image * ED_space_image(struct SpaceImage *sima)
bool ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit)
bool ED_space_image_show_cache(struct SpaceImage *sima)
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
void ED_area_tag_redraw(ScrArea *area)
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_PIXEL
void ED_region_draw_cb_exit(struct ARegionType *, void *)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_line_width(float width)
void GPU_logic_op_xor_set(bool enable)
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, struct ColorSpace *colorspace)
void IMB_freeImBuf(struct ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
const Depsgraph * depsgraph
void ED_imbuf_sample_exit(bContext *C, wmOperator *op)
struct ImageSampleInfo ImageSampleInfo
static void image_sample_rect_color_ubyte(const ImBuf *ibuf, const rcti *rect, uchar r_col[4], float r_col_linear[4])
static void ed_imbuf_sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
void ED_imbuf_sample_cancel(bContext *C, wmOperator *op)
static void sequencer_sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
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_rect_color_float(ImBuf *ibuf, const rcti *rect, float r_col[4])
int ED_imbuf_sample_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_imbuf_sample_draw(const bContext *C, ARegion *region, void *arg_info)
bool ED_imbuf_sample_poll(bContext *C)
static void image_sample_pixel_color_float(ImBuf *ibuf, const int coord[2], float r_col[4])
static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
int ED_imbuf_sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void SEQ_render_pixel_from_sequencer_space_v4(struct Scene *scene, float pixel[4])
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
Editing * SEQ_editing_get(Scene *scene, bool alloc)
ImBuf * sequencer_ibuf_get(struct Main *bmain, ARegion *region, struct Depsgraph *depsgraph, Scene *scene, SpaceSeq *sseq, int timeline_frame, int frame_ofs, const char *viewname)
struct ARegionType * type
struct CurveMapping * curve_mapping
struct ColorSpace * rect_colorspace
ColorManagedViewSettings view_settings
struct wmEvent * eventstate
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)