64 if (stats_scene ==
nullptr) {
71 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
98 for (
int i = 0; i < total_tiles; i++,
tile++) {
112 bool use_default_view,
118 const float linearcol[4])
125 const int ymin = rect->
ymin;
131 uchar red[3] = {255, 50, 50};
132 uchar green[3] = {0, 255, 0};
133 uchar blue[3] = {100, 100, 255};
135 const uchar red[3] = {255, 255, 255};
136 const uchar green[3] = {255, 255, 255};
137 const uchar blue[3] = {255, 255, 255};
139 float hue = 0, sat = 0, val = 0, lum = 0, u = 0,
v = 0;
140 float col[4], finalcol[4];
163 if (channels == 1 && (cp !=
nullptr || fp !=
nullptr)) {
167 else if (cp !=
nullptr) {
243 rgba[3] = linearcol[3];
248 (use_default_view) ?
nullptr :
253 SNPRINTF_UTF8(
str,
" | Display R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
263 col[0] = col[1] = col[2] = fp[0];
266 col[0] = col[1] = col[2] =
float(cp[0]) / 255.0f;
269 col[0] = col[1] = col[2] = 0.0f;
273 else if (channels == 3) {
277 else if (channels == 4) {
288 (use_default_view) ?
nullptr :
310 rcti color_rect_half;
311 int color_quater_x, color_quater_y;
313 color_rect_half = color_rect;
318 color_rect_half = color_rect;
326 color_rect_half.
xmin,
327 color_rect_half.
ymin,
328 color_rect_half.
xmax,
329 color_rect_half.
ymax);
332 immRectf(pos, color_quater_x, color_quater_y, color_rect_half.
xmax, color_rect_half.
ymax);
333 immRectf(pos, color_rect_half.
xmin, color_rect_half.
ymin, color_quater_x, color_quater_y);
335 if (fp !=
nullptr || cp !=
nullptr) {
360 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
365 float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f, &hue, &sat, &val);
367 float(cp[0]) / 255.0f,
368 float(cp[0]) / 255.0f,
384 else if (channels >= 3) {
385 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
418 float viewport_size[4];
443 const bool show_viewer = (ima && ima->source ==
IMA_SRC_VIEWER) != 0;
445 if (ima && show_render) {
467 if (
image ==
nullptr &&
mask ==
nullptr) {
470 if (
mask ==
nullptr) {
494 framelen = region->
winx / (efra - sfra + 1);
509 const int region_bottom = rect_visible->
ymin;
517 if (
image !=
nullptr &&
image->runtime->cache !=
nullptr &&
520 int num_segments = 0;
521 int *points =
nullptr;
523 std::scoped_lock
lock(
image->runtime->cache_mutex);
533 x = (cfra - sfra) / (efra - sfra + 1) * region->
winx;
544 if (
mask !=
nullptr) {
559 zoom_factor = (xzoom + yzoom) / 2.0f;
560 zoom_factor *= 256.0f /
powf(grid_dimension, 2);
567 const int grid_dimension)
572 switch (grid_shape_source) {
585 BLI_assert(pixel_width > 0 && pixel_height > 0);
586 grid_steps_x[
step] = 1.0f / pixel_width;
587 grid_steps_y[
step] = 1.0f / pixel_height;
598 const float zoom_factor)
607 float offset = (3.0f / 4.0f) * (grid_steps[
step] - (grid_steps[
step] / grid_dimensions));
609 if ((grid_steps[
step] - offset) > zoom_factor) {
610 return grid_steps[
step];
615 return grid_steps[0];
627 float viewport_size[4];
640 shdr_pos, region_rect.
xmin, region_rect.
ymin, region_rect.
xmax, region_rect.
ymax);
#define BLI_YUV_ITU_BT709
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
#define SI_GRID_STEPS_LEN
#define IMG_SIZE_FALLBACK
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
#define BLI_assert_unreachable()
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
const ccl_global KernelWorkTile * tile
void view2d_view_to_region_rcti(const View2D *v2d, const rctf *rect_src, rcti *rect_dst) ATTR_NONNULL()
void view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
Scene * ED_render_job_get_scene(const bContext *C)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
RenderResult * BKE_image_acquire_renderresult(Scene *scene, Image *ima)
ScrArea * CTX_wm_area(const bContext *C)
void draw_image_cache(const bContext *C, ARegion *region)
void BLF_position(int fontid, float x, float y, float z)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy)
void IMB_cache_get_cache_segments(ImBufCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
void BKE_image_release_renderresult(Scene *scene, Image *ima, RenderResult *render_result)
void immUniformColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
bool ED_space_image_show_cache(const SpaceImage *sima)
void immUniform2f(const char *name, float x, float y)
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
GPUVertFormat * immVertexFormat()
void ED_region_cache_draw_background(ARegion *region)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
void draw_image_main_helpers(const bContext *C, ARegion *region)
void immBegin(GPUPrimType, uint vertex_len)
static void draw_render_info(const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy)
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
ATTR_WARN_UNUSED_RESULT const BMVert * v
const rcti * ED_region_visible_rect(ARegion *region)
void ED_image_draw_info(Scene *scene, 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])
void ED_region_cache_draw_cached_segments(ARegion *region, int num_segments, const int *points, int sfra, int efra)
void GPU_line_width(float width)
void GPU_matrix_scale_2f(float x, float y)
MINLINE void zero_v4(float r[4])
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
Render * RE_GetSceneRender(const Scene *scene)
void immUniformThemeColor(int color_id)
void BLF_size(int fontid, float size)
void immUniform1f(const char *name, float x)
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
float ED_space_image_zoom_level(const View2D *v2d, int grid_dimension)
void GPU_viewport_size_get_f(float coords[4])
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void draw_image_sample_line(SpaceImage *sima)
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
void GPU_matrix_translate_2f(float x, float y)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
const rcti * RE_engine_get_current_tiles(Render *re, int *r_total_tiles)
eSpaceImage_GridShapeSource
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
SpaceImage * CTX_wm_space_image(const bContext *C)
void immUniform4f(const char *name, float x, float y, float z, float w)
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void ED_mask_draw_frames(Mask *mask, ARegion *region, int cfra, int sfra, int efra)
void ED_area_hud_region_set_padding_flag(ScrArea *area, ARegion *changed_region, const bool set_padding=false)
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
Scene * CTX_data_scene(const bContext *C)
MINLINE void copy_v4_v4(float r[4], const float a[4])
void immUniformColor3fv(const float rgb[3])
float ED_space_image_increment_snap_value(int grid_dimensions, const float grid_steps[SI_GRID_STEPS_LEN], float zoom_factor)
void GPU_blend(GPUBlend blend)
void immUniform1i(const char *name, int x)
@ DISPLAY_SPACE_COLOR_INSPECTION
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
void immVertex2fv(uint attr_id, const float data[2])
void immUniformColor3fvAlpha(const float rgb[3], float a)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
void ED_region_cache_draw_curfra_label(int framenr, float x, float y)
Image * ED_space_image(const SpaceImage *sima)
void IMB_colormanagement_pixel_to_display_space_v4(float result[4], const float pixel[4], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
void ED_region_info_draw(ARegion *region, const char *text, const float fill_color[4], bool full_redraw)
void draw_image_uv_custom_region(const ARegion *region, const rctf &custom_region)
Mask * ED_space_image_get_mask(const SpaceImage *sima)
void ED_space_image_grid_steps(SpaceImage *sima, float grid_steps_x[SI_GRID_STEPS_LEN], float grid_steps_y[SI_GRID_STEPS_LEN], int grid_dimension)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct ToolSettings * toolsettings
eSpaceImage_GridShapeSource grid_shape_source
struct Histogram sample_line_hist
int custom_grid_subdiv[2]