87 if (stats_scene ==
NULL) {
94 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
102 bool need_free_tiles;
129 for (
int i = 0; i < total_tiles; i++, tile++) {
135 if (need_free_tiles) {
148 bool use_default_view,
154 const float linearcol[4],
163 const int ymin = rect->
ymin;
169 uchar red[3] = {255, 50, 50};
173 const uchar red[3] = {255, 255, 255};
177 float hue = 0, sat = 0, val = 0, lum = 0, u = 0,
v = 0;
178 float col[4], finalcol[4];
204 SNPRINTF(
str,
" Z:%-.4f |", 0.5f + 0.5f * (((
float)*zp) / (
float)0x7fffffff));
217 if (channels == 1 && (cp !=
NULL || fp !=
NULL)) {
221 else if (cp !=
NULL) {
297 rgba[3] = linearcol[3];
300 if (use_default_view) {
308 SNPRINTF(
str,
" | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
328 else if (channels == 3) {
332 else if (channels == 4) {
341 if (use_default_view) {
367 rcti color_rect_half;
368 int color_quater_x, color_quater_y;
370 color_rect_half = color_rect;
375 color_rect_half = color_rect;
383 color_rect_half.
xmin,
384 color_rect_half.
ymin,
385 color_rect_half.
xmax,
386 color_rect_half.
ymax);
415 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
420 (
float)cp[0] / 255.0f, (
float)cp[0] / 255.0f, (
float)cp[0] / 255.0f, &hue, &sat, &val);
422 (
float)cp[0] / 255.0f,
423 (
float)cp[0] / 255.0f,
439 else if (channels >= 3) {
440 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
466 float x1,
float y1,
int rectx,
int recty,
const int *rect,
float zoomx,
float zoomy)
468 const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
471 float *rectf =
MEM_mallocN(rectx * recty *
sizeof(
float),
"temp");
472 for (
int a = rectx * recty - 1;
a >= 0;
a--) {
474 rectf[
a] = rect[
a] * 0.5f + 0.5f;
481 immDrawPixelsTex(&
state, x1,
y1, rectx, recty,
GPU_R16F,
false, rectf, zoomx, zoomy,
NULL);
491 const float *rect_float,
495 float bias, scale, *rectf, clip_end;
497 const float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
502 scale = 1.0f / (clip_end - bias);
510 rectf =
MEM_mallocN(rectx * recty *
sizeof(
float),
"temp");
511 for (
a = rectx * recty - 1;
a >= 0;
a--) {
512 if (rect_float[
a] > clip_end) {
515 else if (rect_float[
a] < bias) {
519 rectf[
a] = 1.0f - (rect_float[
a] - bias) * scale;
520 rectf[
a] *= rectf[
a];
528 immDrawPixelsTex(&
state, x1,
y1, rectx, recty,
GPU_R16F,
false, rectf, zoomx, zoomy,
NULL);
548 if (textwidth < 0.5f * (stepx - 10)) {
551 else if (textwidth < (stepx - 10)) {
552 opacity = 2.0f - 2.0f * (textwidth / (stepx - 10));
597 int clip_max_x, clip_max_y;
610 ED_draw_imbuf_ctx_clipping(
C, ibuf,
x,
y,
false, 0, 0, clip_max_x, clip_max_y, zoomx, zoomy);
613 float shuffle[4] = {0.0f, 0.0f, 0.0f, 0.0f};
614 uchar *display_buffer;
638 ibuf, view_settings, display_settings, &cache_handle);
640 if (display_buffer) {
684 for (
int x = xmin;
x < xmax;
x++) {
685 for (
int y = ymin;
y < ymax;
y++) {
726 float viewport_size[4];
732 "colors", (
float *)(
float[][4]){{1.0f, 1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, 0.0f, 1.0f}}, 2);
752 const float color[3])
756 const int gridpos[5][2] = {{0, 0}, {0, 1}, {1, 1}, {1, 0}, {0, 0}};
757 for (
int i = 0; i < 4; i++) {
759 immVertex2f(pos_attr, x1 + gridpos[i][0] * stepx,
y1 + gridpos[i][1] * stepy);
761 immVertex2f(pos_attr, x1 + gridpos[i + 1][0] * stepx,
y1 + gridpos[i + 1][1] * stepy);
789 float theme_color[3], selected_color[3];
797 if (tile != cur_tile) {
798 int x = (tile->tile_number - 1001) % 10;
799 int y = (tile->tile_number - 1001) / 10;
804 if (cur_tile !=
NULL) {
831 bool show_viewer, show_stereo3d, show_multilayer;
839 ED_image_get_aspect(sima->
image, &xuser_asp, &yuser_asp);
845 BKE_image_user_calc_imanr(iuser,
scene->
r.
cfra, 0);
846 sima->
iuser = *iuser;
850 ibuf = ED_space_image_buffer(sima);
877 if (show_multilayer) {
895 int x = (tile->tile_number - 1001) % 10;
896 int y = (tile->tile_number - 1001) / 10;
940 if (tile->tile_number == 1001) {
946 int x_pos = (tile->tile_number - 1001) % 10;
947 int y_pos = (tile->tile_number - 1001) / 10;
948 char label[
sizeof(tile->label)];
951 float tile_zoomx = (zoomx * main_w) / ibuf->
x;
952 float tile_zoomy = (zoomy * main_h) / ibuf->
y;
975 if (ima && show_render) {
1003 float x, cfra =
CFRA, sfra =
SFRA, efra =
EFRA, framelen = region->
winx / (efra - sfra + 1);
1016 const int region_bottom = rect_visible->
ymin;
1026 int num_segments = 0;
1037 x = (cfra - sfra) / (efra - sfra + 1) * region->
winx;
typedef float(TangentPoint)[2]
void immDrawPixelsTex_clipping(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float xzoom, float yzoom, const float color[4])
void immDrawPixelsTex(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, void *rect, float xzoom, float yzoom, const float color[4])
void ED_draw_imbuf_ctx_clipping(const struct bContext *C, struct ImBuf *ibuf, float x, float y, bool use_filter, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float zoom_x, float zoom_y)
void immDrawBorderCorners(unsigned int pos, const struct rcti *border, float zoomx, float zoomy)
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
struct Scene * CTX_data_scene(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
void BKE_image_multiview_index(struct Image *ima, struct ImageUser *iuser)
bool BKE_image_is_stereo(struct Image *ima)
struct RenderResult * BKE_image_acquire_renderresult(struct Scene *scene, struct Image *ima)
bool BKE_image_is_multilayer(struct Image *ima)
struct RenderPass * BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser)
void BKE_image_release_renderresult(struct Scene *scene, struct Image *ima)
void BKE_image_get_tile_label(struct Image *ima, struct ImageTile *tile, char *label, int len_label)
void BKE_image_tag_time(struct Image *ima)
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
float BLF_width(int fontid, const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLF_draw_ascii(int fontid, const char *str, size_t len) ATTR_NONNULL(2)
void BLF_size(int fontid, int size, int dpi)
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
void BLF_color4ub(int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha)
void BLF_position(int fontid, float x, float y, float z)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#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])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float 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 float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
#define STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
void BLI_thread_unlock(int type)
void BLI_thread_lock(int type)
Object is a sort of wrapper for general info.
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock)
struct Mask * ED_space_image_get_mask(struct SpaceImage *sima)
struct Image * ED_space_image(struct SpaceImage *sima)
void ED_space_image_get_zoom(struct SpaceImage *sima, const struct ARegion *region, float *r_zoomx, float *r_zoomy)
int ED_space_image_get_display_channel_mask(struct ImBuf *ibuf)
struct ImBuf * ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock, int tile)
void ED_mask_draw_frames(struct Mask *mask, struct ARegion *region, const int cfra, const int sfra, const int efra)
struct Scene * ED_render_job_get_scene(const struct bContext *C)
void ED_region_info_draw(struct ARegion *region, const char *text, float fill_color[4], const bool full_redraw)
void ED_region_grid_draw(struct ARegion *region, float zoomx, float zoomy, float x0, float y0)
void ED_region_cache_draw_background(struct ARegion *region)
void ED_region_cache_draw_curfra_label(const int framenr, const float x, const float y)
void ED_region_cache_draw_cached_segments(struct ARegion *region, const int num_segments, const int *points, const int sfra, const int efra)
const rcti * ED_region_visible_rect(ARegion *region)
void ED_region_image_metadata_draw(int x, int y, struct ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy)
struct GPUFrameBuffer GPUFrameBuffer
void GPU_framebuffer_bind_no_srgb(GPUFrameBuffer *fb)
GPUFrameBuffer * GPU_framebuffer_active_get(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
_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 GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_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
_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 blue
_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 green
void GPU_matrix_pop(void)
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push(void)
void GPU_matrix_translate_2f(float x, float y)
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, const float *value)
@ GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_2D_UNIFORM_COLOR
@ GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR
@ GPU_SHADER_2D_FLAT_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 struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings)
void IMB_colormanagement_display_settings_from_ctx(const struct bContext *C, struct ColorManagedViewSettings **r_view_settings, struct ColorManagedDisplaySettings **r_display_settings)
void IMB_display_buffer_release(void *cache_handle)
unsigned char * IMB_display_buffer_acquire(struct ImBuf *ibuf, const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, void **cache_handle)
Contains defines and structs used throughout the imbuf module.
void IMB_moviecache_get_cache_segments(struct MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
Read Guarded memory(de)allocation.
Platform independent time functions.
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
void UI_GetThemeColor3fv(int colorid, float col[3])
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
void UI_view2d_view_to_region_fl(const struct View2D *v2d, float x, float y, float *r_region_x, float *r_region_y) ATTR_NONNULL()
void UI_view2d_view_to_region(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void ED_annotation_draw_2dimage(const bContext *C)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
ATTR_WARN_UNUSED_RESULT const BMVert * v
struct MovieCache * cache
RenderData * RE_engine_get_render_data(Render *re)
rcti * RE_engine_get_current_tiles(Render *re, int *r_total_tiles, bool *r_needs_free)
static void draw_render_info(const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy)
static void draw_image_buffer_repeated(const bContext *C, SpaceImage *sima, ARegion *region, Scene *scene, ImBuf *ibuf, float zoomx, float zoomy)
static void sima_draw_zbuffloat_pixels(Scene *scene, float x1, float y1, int rectx, int recty, const float *rect_float, float zoomx, float zoomy)
void draw_image_grease_pencil(bContext *C, bool onlyv2d)
static void draw_udim_tile_grids(ARegion *region, SpaceImage *sima, Image *ima)
static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, const int *rect, float zoomx, float zoomy)
void draw_image_main_helpers(const bContext *C, ARegion *region)
static void draw_udim_tile_grid(uint pos_attr, uint color_attr, ARegion *region, int x, int y, float stepx, float stepy, const float color[3])
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], const int *zp, const float *zpf)
void draw_image_cache(const bContext *C, ARegion *region)
static void draw_udim_label(ARegion *region, float fx, float fy, const char *label)
void draw_image_main(const bContext *C, ARegion *region)
bool ED_space_image_show_cache(SpaceImage *sima)
void draw_image_sample_line(SpaceImage *sima)
static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *region, Scene *scene, ImBuf *ibuf, float fx, float fy, float zoomx, float zoomy)
BLI_INLINE float fb(float length, float L)
void * BKE_image_get_tile
static void shuffle(float2 points[], int size, int rng_seed)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
Render * RE_GetSceneRender(const Scene *scene)
struct bNodeTree * nodetree
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct Histogram sample_line_hist
double PIL_check_seconds_timer(void)
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)