80 float r_col_linear[4])
82 const uchar *cp = (
unsigned char *)(ibuf->
rect + coord[1] * ibuf->
x + coord[0]);
103 float r_col_linear[4])
105 uint col_accum_ub[4] = {0, 0, 0, 0};
109 for (coord[0] = rect->
xmin; coord[0] <= rect->
xmax; coord[0]++) {
110 for (coord[1] = rect->
ymin; coord[1] <= rect->
ymax; coord[1]++) {
111 float col_temp_fl[4];
112 uchar col_temp_ub[4];
115 col_accum_ub[0] += (
uint)col_temp_ub[0];
116 col_accum_ub[1] += (
uint)col_temp_ub[1];
117 col_accum_ub[2] += (
uint)col_temp_ub[2];
118 col_accum_ub[3] += (
uint)col_temp_ub[3];
122 mul_v4_fl(r_col_linear, 1.0 / (
float)col_tot);
124 r_col[0] =
MIN2(col_accum_ub[0] / col_tot, 255);
125 r_col[1] =
MIN2(col_accum_ub[1] / col_tot, 255);
126 r_col[2] =
MIN2(col_accum_ub[2] / col_tot, 255);
127 r_col[3] =
MIN2(col_accum_ub[3] / col_tot, 255);
135 for (coord[0] = rect->
xmin; coord[0] <= rect->
xmax; coord[0]++) {
136 for (coord[1] = rect->
ymin; coord[1] <= rect->
ymax; coord[1]++) {
137 float col_temp_fl[4];
174 if (uv[0] >= 0.0f && uv[1] >= 0.0f && uv[0] < 1.0f && uv[1] < 1.0f) {
175 int x = (int)(uv[0] * ibuf->
x),
y = (int)(uv[1] * ibuf->
y);
216 info->
colf[3] = 1.0f;
221 info->
colf[3] = 1.0f;
232 info->
z = ibuf->
zbuf[
y * ibuf->
x +
x];
234 if (ibuf->
zbuf == (
int *)ibuf->
rect) {
241 info->
zfp = &info->
zf;
247 if (curve_mapping && ibuf->
channels == 4) {
255 else if (
point == 0) {
267 node_curvemap_sample(fp);
270 areawinset(
area->win);
271 scrarea_do_windraw(
area);
274 node_curvemap_sample(
NULL);
312 if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->
x && fy < ibuf->
y) {
315 int x = (int)fx,
y = (
int)fy;
326 cp = (
unsigned char *)(ibuf->
rect +
y * ibuf->
x +
x);
328 info->
col[0] = cp[0];
329 info->
col[1] = cp[1];
330 info->
col[2] = cp[2];
331 info->
col[3] = cp[3];
349 info->
colf[0] = fp[0];
350 info->
colf[1] = fp[1];
351 info->
colf[2] = fp[2];
352 info->
colf[3] = fp[3];
377 switch (
area->spacetype) {
430 const float color[3] = {1, 1, 1};
445 (
float)sample_rect_fl.
xmin,
446 (
float)sample_rect_fl.
ymin,
447 (
float)sample_rect_fl.
xmax,
448 (
float)sample_rect_fl.
ymax);
471 switch (
area->spacetype) {
508 switch (event->
type) {
536 switch (
area->spacetype) {
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 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)
bool ED_space_image_show_uvedit(const struct SpaceImage *sima, struct Object *obedit)
struct Image * ED_space_image(const struct SpaceImage *sima)
bool ED_space_image_show_cache_and_mval_over(const struct SpaceImage *sima, struct ARegion *region, const int mval[2])
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
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
_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)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
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)
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
ccl_global const KernelWorkTile * tile
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
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(const Scene *scene)
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)