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];
161 if (channels == 1 && (cp !=
nullptr || fp !=
nullptr)) {
165 else if (cp !=
nullptr) {
241 rgba[3] = linearcol[3];
244 if (use_default_view) {
253 SNPRINTF(
str,
" | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
266 col[0] =
col[1] =
col[2] = float(cp[0]) / 255.0f;
273 else if (channels == 3) {
277 else if (channels == 4) {
286 if (use_default_view) {
313 rcti color_rect_half;
314 int color_quater_x, color_quater_y;
316 color_rect_half = color_rect;
321 color_rect_half = color_rect;
329 color_rect_half.
xmin,
330 color_rect_half.
ymin,
331 color_rect_half.
xmax,
332 color_rect_half.
ymax);
338 if (fp !=
nullptr || cp !=
nullptr) {
363 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
368 float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f, &hue, &sat, &val);
370 float(cp[0]) / 255.0f,
371 float(cp[0]) / 255.0f,
387 else if (channels >= 3) {
388 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
422 float viewport_size[4];
449 if (ima && show_render) {
463 if (image ==
nullptr &&
mask ==
nullptr) {
466 if (
mask ==
nullptr) {
489 framelen = region->
winx / (efra - sfra + 1);
502 const int region_bottom = rect_visible->
ymin;
510 if (image !=
nullptr && image->
cache !=
nullptr &&
513 int num_segments = 0;
514 int *points =
nullptr;
516 std::scoped_lock
lock(image->
runtime->cache_mutex);
526 x = (cfra - sfra) / (efra - sfra + 1) * region->
winx;
535 cfra,
x + roundf(framelen / 2), region_bottom + 8.0f *
UI_SCALE_FAC);
537 if (
mask !=
nullptr) {
552 zoom_factor = (xzoom + yzoom) / 2.0f;
553 zoom_factor *= 256.0f /
powf(grid_dimension, 2);
560 const int grid_dimension)
565 switch (grid_shape_source) {
578 BLI_assert(pixel_width > 0 && pixel_height > 0);
579 grid_steps_x[
step] = 1.0f / pixel_width;
580 grid_steps_y[
step] = 1.0f / pixel_height;
591 const float zoom_factor)
600 float offset = (3.0f / 4.0f) * (grid_steps[
step] - (grid_steps[
step] / grid_dimensions));
602 if ((grid_steps[
step] - offset) > zoom_factor) {
603 return grid_steps[
step];
608 return grid_steps[0];
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(dst, format,...)
char * STRNCPY(char(&dst)[N], const char *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_blend(eGPUBlend blend)
void GPU_line_width(float width)
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)
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()
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 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
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct Histogram sample_line_hist
int custom_grid_subdiv[2]