71 if (stats_scene ==
nullptr) {
78 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
105 for (
int i = 0; i < total_tiles; i++,
tile++) {
119 bool use_default_view,
125 const float linearcol[4])
132 const int ymin = rect->
ymin;
139 uchar green[3] = {0, 255, 0};
140 uchar blue[3] = {100, 100, 255};
142 const uchar red[3] = {255, 255, 255};
143 const uchar green[3] = {255, 255, 255};
144 const uchar blue[3] = {255, 255, 255};
146 float hue = 0, sat = 0, val = 0, lum = 0, u = 0,
v = 0;
147 float col[4], finalcol[4];
171 if (channels == 1 && (cp !=
nullptr || fp !=
nullptr)) {
175 else if (cp !=
nullptr) {
251 rgba[3] = linearcol[3];
254 if (use_default_view) {
256 rgba, rgba,
nullptr, &scene->display_settings);
260 rgba, rgba, &scene->view_settings, &scene->display_settings);
263 SNPRINTF(
str,
" | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
283 else if (channels == 3) {
287 else if (channels == 4) {
296 if (use_default_view) {
298 finalcol,
col,
nullptr, &scene->display_settings);
302 finalcol,
col, &scene->view_settings, &scene->display_settings);
323 rcti color_rect_half;
324 int color_quater_x, color_quater_y;
326 color_rect_half = color_rect;
331 color_rect_half = color_rect;
339 color_rect_half.
xmin,
340 color_rect_half.
ymin,
341 color_rect_half.
xmax,
342 color_rect_half.
ymax);
348 if (fp !=
nullptr || cp !=
nullptr) {
373 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
378 float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f,
float(cp[0]) / 255.0f, &hue, &sat, &val);
380 float(cp[0]) / 255.0f,
381 float(cp[0]) / 255.0f,
397 else if (channels >= 3) {
398 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
432 float viewport_size[4];
459 if (ima && show_render) {
469 Mask *mask =
nullptr;
473 if (image ==
nullptr && mask ==
nullptr) {
476 if (mask ==
nullptr) {
498 float x, cfra = scene->r.cfra, sfra = scene->r.sfra, efra = scene->r.efra,
499 framelen = region->winx / (efra - sfra + 1);
500 Mask *mask =
nullptr;
512 const int region_bottom = rect_visible->
ymin;
520 if (image !=
nullptr && image->cache !=
nullptr &&
523 int num_segments = 0;
524 int *points =
nullptr;
537 x = (cfra - sfra) / (efra - sfra + 1) * region->winx;
548 if (mask !=
nullptr) {
563 zoom_factor = (xzoom + yzoom) / 2.0f;
564 zoom_factor *= 256.0f /
powf(grid_dimension, 2);
571 const int grid_dimension)
576 switch (grid_shape_source) {
589 BLI_assert(pixel_width > 0 && pixel_height > 0);
590 grid_steps_x[step] = 1.0f / pixel_width;
591 grid_steps_y[step] = 1.0f / pixel_height;
602 const float zoom_factor)
611 float offset = (3.0f / 4.0f) * (grid_steps[step] - (grid_steps[step] / grid_dimensions));
613 if ((grid_steps[step] - offset) > zoom_factor) {
614 return grid_steps[step];
619 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 STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
pthread_mutex_t ThreadMutex
Platform independent time functions.
Object is a sort of wrapper for general info.
#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)
Contains defines and structs used throughout the imbuf module.
void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
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 Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves 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 Invert a producing a negative Combine Generate a color from its red
#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
draw_view in_light_buf[] float
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
ccl_global const KernelWorkTile * tile
Render * RE_GetSceneRender(const Scene *scene)
struct Histogram sample_line_hist
int custom_grid_subdiv[2]