62 if (stats_scene ==
nullptr) {
69 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
96 for (
int i = 0;
i < total_tiles;
i++,
tile++) {
110 bool use_default_view,
116 const float linearcol[4])
123 const int ymin = rect->
ymin;
129 uchar red[3] = {255, 50, 50};
130 uchar green[3] = {0, 255, 0};
131 uchar blue[3] = {100, 100, 255};
133 const uchar red[3] = {255, 255, 255};
134 const uchar green[3] = {255, 255, 255};
135 const uchar blue[3] = {255, 255, 255};
137 float hue = 0, sat = 0, val = 0, lum = 0, u = 0,
v = 0;
138 float col[4], finalcol[4];
162 if (channels == 1 && (cp !=
nullptr || fp !=
nullptr)) {
166 else if (cp !=
nullptr) {
242 rgba[3] = linearcol[3];
247 (use_default_view) ?
nullptr :
252 SNPRINTF_UTF8(
str,
" | Display R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
272 else if (channels == 3) {
276 else if (channels == 4) {
287 (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);
335 if (fp !=
nullptr || cp !=
nullptr) {
361 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
366 float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f, &hue, &sat, &val);
368 float(cp[0]) / 255.0f,
369 float(cp[0]) / 255.0f,
385 else if (channels >= 3) {
386 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
416 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
420 float viewport_size[4];
447 if (ima && show_render) {
469 if (image ==
nullptr &&
mask ==
nullptr) {
472 if (
mask ==
nullptr) {
495 framelen = region->
winx / (efra - sfra + 1);
508 const int region_bottom = rect_visible->
ymin;
516 if (image !=
nullptr && image->
cache !=
nullptr &&
519 int num_segments = 0;
520 int *points =
nullptr;
522 std::scoped_lock
lock(image->
runtime->cache_mutex);
532 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);
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy)
SpaceImage * CTX_wm_space_image(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
void BKE_image_release_renderresult(Scene *scene, Image *ima, RenderResult *render_result)
RenderResult * BKE_image_acquire_renderresult(Scene *scene, Image *ima)
void BLF_size(int fontid, float size)
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_unreachable()
#define BLI_YUV_ITU_BT709
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void rgb_to_yuv(float r, float g, float b, float *r_y, float *r_u, float *r_v, int colorspace)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v4(float r[4])
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
#define SI_GRID_STEPS_LEN
eSpaceImage_GridShapeSource
#define IMG_SIZE_FALLBACK
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
void ED_space_image_get_zoom(SpaceImage *sima, const ARegion *region, float *r_zoomx, float *r_zoomy)
Image * ED_space_image(const SpaceImage *sima)
Mask * ED_space_image_get_mask(const SpaceImage *sima)
void ED_mask_draw_frames(Mask *mask, ARegion *region, int cfra, int sfra, int efra)
Scene * ED_render_job_get_scene(const bContext *C)
void ED_region_info_draw(ARegion *region, const char *text, const float fill_color[4], bool full_redraw)
void ED_region_cache_draw_cached_segments(ARegion *region, int num_segments, const int *points, int sfra, int efra)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_region_cache_draw_background(ARegion *region)
void ED_region_cache_draw_curfra_label(int framenr, float x, float y)
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_line_width(float width)
void GPU_blend(GPUBlend blend)
void GPU_viewport_size_get_f(float coords[4])
void IMB_colormanagement_pixel_to_display_space_v4(float result[4], const float pixel[4], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, const ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
@ DISPLAY_SPACE_COLOR_INSPECTION
void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
void UI_view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void UI_view2d_view_to_region_rcti(const View2D *v2d, const rctf *rect_src, rcti *rect_dst) ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
bool ED_space_image_show_cache(const SpaceImage *sima)
static void draw_render_info(const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy)
void draw_image_main_helpers(const bContext *C, 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 uchar cp[4], const float fp[4], const float linearcol[4])
void draw_image_uv_custom_region(const ARegion *region, const rctf &custom_region)
void ED_space_image_grid_steps(SpaceImage *sima, float grid_steps_x[SI_GRID_STEPS_LEN], float grid_steps_y[SI_GRID_STEPS_LEN], const int grid_dimension)
float ED_space_image_zoom_level(const View2D *v2d, const int grid_dimension)
void draw_image_cache(const bContext *C, ARegion *region)
void draw_image_sample_line(SpaceImage *sima)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
float ED_space_image_increment_snap_value(const int grid_dimensions, const float grid_steps[SI_GRID_STEPS_LEN], const float zoom_factor)
const rcti * RE_engine_get_current_tiles(Render *re, int *r_total_tiles)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
const ccl_global KernelWorkTile * tile
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
Render * RE_GetSceneRender(const Scene *scene)
struct MovieCache * cache
ImageRuntimeHandle * runtime
struct ToolSettings * toolsettings
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct Histogram sample_line_hist
int custom_grid_subdiv[2]