Blender V4.3
image_draw.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cmath>
10#include <cstdlib>
11#include <cstring>
12
13#include "MEM_guardedalloc.h"
14
15#include "DNA_brush_types.h"
16#include "DNA_camera_types.h"
17#include "DNA_mask_types.h"
18#include "DNA_object_types.h"
19#include "DNA_scene_types.h"
20#include "DNA_screen_types.h"
21#include "DNA_space_types.h"
22#include "DNA_view2d_types.h"
23
24#include "BLI_listbase.h"
25#include "BLI_rect.h"
26#include "BLI_string.h"
27#include "BLI_threads.h"
28#include "BLI_time.h"
29#include "BLI_utildefines.h"
30
32#include "IMB_imbuf.hh"
33#include "IMB_imbuf_types.hh"
34#include "IMB_moviecache.hh"
35
36#include "BKE_context.hh"
37#include "BKE_image.hh"
38#include "BKE_paint.hh"
39
40#include "BIF_glutil.hh"
41
42#include "GPU_framebuffer.hh"
43#include "GPU_immediate.hh"
44#include "GPU_immediate_util.hh"
45#include "GPU_matrix.hh"
46#include "GPU_state.hh"
47
48#include "BLF_api.hh"
49
50#include "ED_gpencil_legacy.hh"
51#include "ED_image.hh"
52#include "ED_mask.hh"
53#include "ED_render.hh"
54#include "ED_screen.hh"
55#include "ED_util.hh"
56
57#include "UI_interface.hh"
58#include "UI_resources.hh"
59#include "UI_view2d.hh"
60
61#include "RE_engine.h"
62#include "RE_pipeline.h"
63
64#include "image_intern.hh"
65
66static void draw_render_info(
67 const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy)
68{
69 Render *re = RE_GetSceneRender(scene);
70 Scene *stats_scene = ED_render_job_get_scene(C);
71 if (stats_scene == nullptr) {
72 stats_scene = CTX_data_scene(C);
73 }
74
75 RenderResult *rr = BKE_image_acquire_renderresult(stats_scene, ima);
76
77 if (rr && rr->text) {
78 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
79 ED_region_info_draw(region, rr->text, fill_color, true);
80 }
81
82 BKE_image_release_renderresult(stats_scene, ima, rr);
83
84 if (re) {
85 int total_tiles;
86 const rcti *tiles = RE_engine_get_current_tiles(re, &total_tiles);
87
88 if (total_tiles) {
89 /* find window pixel coordinates of origin */
90 int x, y;
91 UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &x, &y);
92
95 GPU_matrix_scale_2f(zoomx, zoomy);
96
101
102 GPU_line_width(1.0f);
103
104 const rcti *tile = tiles;
105 for (int i = 0; i < total_tiles; i++, tile++) {
106 immDrawBorderCorners(pos, tile, zoomx, zoomy);
107 }
108
110
112 }
113 }
114}
115
117 ARegion *region,
118 bool color_manage,
119 bool use_default_view,
120 int channels,
121 int x,
122 int y,
123 const uchar cp[4],
124 const float fp[4],
125 const float linearcol[4])
126{
127 rcti color_rect;
128 char str[256];
129 int dx = 6;
130 /* local coordinate visible rect inside region, to accommodate overlapping ui */
131 const rcti *rect = ED_region_visible_rect(region);
132 const int ymin = rect->ymin;
133 const int dy = ymin + 0.3f * UI_UNIT_Y;
134
135/* text colors */
136/* XXX colored text not allowed in Blender UI */
137#if 0
138 uchar red[3] = {255, 50, 50};
139 uchar green[3] = {0, 255, 0};
140 uchar blue[3] = {100, 100, 255};
141#else
142 const uchar red[3] = {255, 255, 255};
143 const uchar green[3] = {255, 255, 255};
144 const uchar blue[3] = {255, 255, 255};
145#endif
146 float hue = 0, sat = 0, val = 0, lum = 0, u = 0, v = 0;
147 float col[4], finalcol[4];
148
150
154
155 /* noisy, high contrast make impossible to read if lower alpha is used. */
156 immUniformColor4ub(0, 0, 0, 190);
157 immRecti(pos, 0, ymin, BLI_rcti_size_x(&region->winrct) + 1, ymin + UI_UNIT_Y);
158
160
162
164
165 BLF_color3ub(blf_mono_font, 255, 255, 255);
166 SNPRINTF(str, "X:%-4d Y:%-4d |", x, y);
167 BLF_position(blf_mono_font, dx, dy, 0);
168 BLF_draw(blf_mono_font, str, sizeof(str));
169 dx += BLF_width(blf_mono_font, str, sizeof(str));
170
171 if (channels == 1 && (cp != nullptr || fp != nullptr)) {
172 if (fp != nullptr) {
173 SNPRINTF(str, " Val:%-.3f |", fp[0]);
174 }
175 else if (cp != nullptr) {
176 SNPRINTF(str, " Val:%-.3f |", cp[0] / 255.0f);
177 }
178 BLF_color3ub(blf_mono_font, 255, 255, 255);
179 BLF_position(blf_mono_font, dx, dy, 0);
180 BLF_draw(blf_mono_font, str, sizeof(str));
181 dx += BLF_width(blf_mono_font, str, sizeof(str));
182 }
183
184 if (channels >= 3) {
186 if (fp) {
187 SNPRINTF(str, " R:%-.5f", fp[0]);
188 }
189 else if (cp) {
190 SNPRINTF(str, " R:%-3d", cp[0]);
191 }
192 else {
193 STRNCPY(str, " R:-");
194 }
195 BLF_position(blf_mono_font, dx, dy, 0);
196 BLF_draw(blf_mono_font, str, sizeof(str));
197 dx += BLF_width(blf_mono_font, str, sizeof(str));
198
200 if (fp) {
201 SNPRINTF(str, " G:%-.5f", fp[1]);
202 }
203 else if (cp) {
204 SNPRINTF(str, " G:%-3d", cp[1]);
205 }
206 else {
207 STRNCPY(str, " G:-");
208 }
209 BLF_position(blf_mono_font, dx, dy, 0);
210 BLF_draw(blf_mono_font, str, sizeof(str));
211 dx += BLF_width(blf_mono_font, str, sizeof(str));
212
214 if (fp) {
215 SNPRINTF(str, " B:%-.5f", fp[2]);
216 }
217 else if (cp) {
218 SNPRINTF(str, " B:%-3d", cp[2]);
219 }
220 else {
221 STRNCPY(str, " B:-");
222 }
223 BLF_position(blf_mono_font, dx, dy, 0);
224 BLF_draw(blf_mono_font, str, sizeof(str));
225 dx += BLF_width(blf_mono_font, str, sizeof(str));
226
227 if (channels == 4) {
228 BLF_color3ub(blf_mono_font, 255, 255, 255);
229 if (fp) {
230 SNPRINTF(str, " A:%-.4f", fp[3]);
231 }
232 else if (cp) {
233 SNPRINTF(str, " A:%-3d", cp[3]);
234 }
235 else {
236 STRNCPY(str, "- ");
237 }
238 BLF_position(blf_mono_font, dx, dy, 0);
239 BLF_draw(blf_mono_font, str, sizeof(str));
240 dx += BLF_width(blf_mono_font, str, sizeof(str));
241 }
242
243 if (color_manage) {
244 float rgba[4];
245
246 copy_v3_v3(rgba, linearcol);
247 if (channels == 3) {
248 rgba[3] = 1.0f;
249 }
250 else {
251 rgba[3] = linearcol[3];
252 }
253
254 if (use_default_view) {
256 rgba, rgba, nullptr, &scene->display_settings);
257 }
258 else {
260 rgba, rgba, &scene->view_settings, &scene->display_settings);
261 }
262
263 SNPRINTF(str, " | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
264 BLF_position(blf_mono_font, dx, dy, 0);
265 BLF_draw(blf_mono_font, str, sizeof(str));
266 dx += BLF_width(blf_mono_font, str, sizeof(str));
267 }
268 }
269
270 /* color rectangle */
271 if (channels == 1) {
272 if (fp) {
273 col[0] = col[1] = col[2] = fp[0];
274 }
275 else if (cp) {
276 col[0] = col[1] = col[2] = float(cp[0]) / 255.0f;
277 }
278 else {
279 col[0] = col[1] = col[2] = 0.0f;
280 }
281 col[3] = 1.0f;
282 }
283 else if (channels == 3) {
284 copy_v3_v3(col, linearcol);
285 col[3] = 1.0f;
286 }
287 else if (channels == 4) {
288 copy_v4_v4(col, linearcol);
289 }
290 else {
291 BLI_assert(0);
292 zero_v4(col);
293 }
294
295 if (color_manage) {
296 if (use_default_view) {
298 finalcol, col, nullptr, &scene->display_settings);
299 }
300 else {
302 finalcol, col, &scene->view_settings, &scene->display_settings);
303 }
304 }
305 else {
306 copy_v4_v4(finalcol, col);
307 }
308
310 dx += 0.25f * UI_UNIT_X;
311
312 BLI_rcti_init(&color_rect,
313 dx,
314 dx + (1.5f * UI_UNIT_X),
315 ymin + 0.15f * UI_UNIT_Y,
316 ymin + 0.85f * UI_UNIT_Y);
317
318 /* BLF uses immediate mode too, so we must reset our vertex format */
321
322 if (channels == 4) {
323 rcti color_rect_half;
324 int color_quater_x, color_quater_y;
325
326 color_rect_half = color_rect;
327 color_rect_half.xmax = BLI_rcti_cent_x(&color_rect);
328 /* what color ??? */
329 immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
330
331 color_rect_half = color_rect;
332 color_rect_half.xmin = BLI_rcti_cent_x(&color_rect);
333
334 color_quater_x = BLI_rcti_cent_x(&color_rect_half);
335 color_quater_y = BLI_rcti_cent_y(&color_rect_half);
336
339 color_rect_half.xmin,
340 color_rect_half.ymin,
341 color_rect_half.xmax,
342 color_rect_half.ymax);
343
345 immRecti(pos, color_quater_x, color_quater_y, color_rect_half.xmax, color_rect_half.ymax);
346 immRecti(pos, color_rect_half.xmin, color_rect_half.ymin, color_quater_x, color_quater_y);
347
348 if (fp != nullptr || cp != nullptr) {
350 immUniformColor3fvAlpha(finalcol, fp ? fp[3] : (cp[3] / 255.0f));
351 immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
353 }
354 }
355 else {
356 immUniformColor3fv(finalcol);
357 immRecti(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
358 }
360
361 /* draw outline */
364 immUniformColor3ub(128, 128, 128);
365 imm_draw_box_wire_2d(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
367
368 dx += 1.75f * UI_UNIT_X;
369
370 BLF_color3ub(blf_mono_font, 255, 255, 255);
371 if (channels == 1) {
372 if (fp) {
373 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
374 rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v, BLI_YUV_ITU_BT709);
375 }
376 else if (cp) {
378 float(cp[0]) / 255.0f, float(cp[0]) / 255.0f, float(cp[0]) / 255.0f, &hue, &sat, &val);
379 rgb_to_yuv(float(cp[0]) / 255.0f,
380 float(cp[0]) / 255.0f,
381 float(cp[0]) / 255.0f,
382 &lum,
383 &u,
384 &v,
386 }
387
388 SNPRINTF(str, "V:%-.4f", val);
389 BLF_position(blf_mono_font, dx, dy, 0);
390 BLF_draw(blf_mono_font, str, sizeof(str));
391 dx += BLF_width(blf_mono_font, str, sizeof(str));
392
393 SNPRINTF(str, " L:%-.4f", lum);
394 BLF_position(blf_mono_font, dx, dy, 0);
395 BLF_draw(blf_mono_font, str, sizeof(str));
396 }
397 else if (channels >= 3) {
398 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
399 rgb_to_yuv(finalcol[0], finalcol[1], finalcol[2], &lum, &u, &v, BLI_YUV_ITU_BT709);
400
401 SNPRINTF(str, "H:%-.4f", hue);
402 BLF_position(blf_mono_font, dx, dy, 0);
403 BLF_draw(blf_mono_font, str, sizeof(str));
404 dx += BLF_width(blf_mono_font, str, sizeof(str));
405
406 SNPRINTF(str, " S:%-.4f", sat);
407 BLF_position(blf_mono_font, dx, dy, 0);
408 BLF_draw(blf_mono_font, str, sizeof(str));
409 dx += BLF_width(blf_mono_font, str, sizeof(str));
410
411 SNPRINTF(str, " V:%-.4f", val);
412 BLF_position(blf_mono_font, dx, dy, 0);
413 BLF_draw(blf_mono_font, str, sizeof(str));
414 dx += BLF_width(blf_mono_font, str, sizeof(str));
415
416 SNPRINTF(str, " L:%-.4f", lum);
417 BLF_position(blf_mono_font, dx, dy, 0);
418 BLF_draw(blf_mono_font, str, sizeof(str));
419 }
420}
422{
424 Histogram *hist = &sima->sample_line_hist;
425
427 uint shdr_dashed_pos = GPU_vertformat_attr_add(
429
431
432 float viewport_size[4];
433 GPU_viewport_size_get_f(viewport_size);
435 "viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC);
436
437 immUniform1i("colors_len", 2); /* Advanced dashes. */
438 immUniform4f("color", 1.0f, 1.0f, 1.0f, 1.0f);
439 immUniform4f("color2", 0.0f, 0.0f, 0.0f, 1.0f);
440 immUniform1f("dash_width", 2.0f);
441 immUniform1f("udash_factor", 0.5f);
442
444 immVertex2fv(shdr_dashed_pos, hist->co[0]);
445 immVertex2fv(shdr_dashed_pos, hist->co[1]);
446 immEnd();
447
449 }
450}
451
453{
455 Image *ima = ED_space_image(sima);
456
457 const bool show_viewer = (ima && ima->source == IMA_SRC_VIEWER) != 0;
458 const bool show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT) != 0;
459 if (ima && show_render) {
460 float zoomx, zoomy;
461 ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
462 draw_render_info(C, sima->iuser.scene, ima, region, zoomx, zoomy);
463 }
464}
465
467{
468 Image *image = ED_space_image(sima);
469 Mask *mask = nullptr;
470 if (sima->mode == SI_MODE_MASK) {
471 mask = ED_space_image_get_mask(sima);
472 }
473 if (image == nullptr && mask == nullptr) {
474 return false;
475 }
476 if (mask == nullptr) {
477 return ELEM(image->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE);
478 }
479 return true;
480}
481
483 ARegion *region,
484 const int mval[2])
485{
486 const rcti *rect_visible = ED_region_visible_rect(region);
487 if (mval[1] > rect_visible->ymin + (16 * UI_SCALE_FAC)) {
488 return false;
489 }
490 return ED_space_image_show_cache(sima);
491}
492
493void draw_image_cache(const bContext *C, ARegion *region)
494{
496 Scene *scene = CTX_data_scene(C);
497 Image *image = ED_space_image(sima);
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;
501
502 if (!ED_space_image_show_cache(sima)) {
503 return;
504 }
505
506 if (sima->mode == SI_MODE_MASK) {
507 mask = ED_space_image_get_mask(sima);
508 }
509
510 /* Local coordinate visible rect inside region, to accommodate overlapping ui. */
511 const rcti *rect_visible = ED_region_visible_rect(region);
512 const int region_bottom = rect_visible->ymin;
513
515
516 /* Draw cache background. */
518
519 /* Draw cached segments. */
520 if (image != nullptr && image->cache != nullptr &&
521 ELEM(image->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
522 {
523 int num_segments = 0;
524 int *points = nullptr;
525
526 BLI_mutex_lock(static_cast<ThreadMutex *>(image->runtime.cache_mutex));
527 IMB_moviecache_get_cache_segments(image->cache, IMB_PROXY_NONE, 0, &num_segments, &points);
528 BLI_mutex_unlock(static_cast<ThreadMutex *>(image->runtime.cache_mutex));
529
531 region, num_segments, points, sfra + sima->iuser.offset, efra + sima->iuser.offset);
532 }
533
535
536 /* Draw current frame. */
537 x = (cfra - sfra) / (efra - sfra + 1) * region->winx;
538
543 immRecti(pos, x, region_bottom, x + ceilf(framelen), region_bottom + 8 * UI_SCALE_FAC);
545
546 ED_region_cache_draw_curfra_label(cfra, x, region_bottom + 8.0f * UI_SCALE_FAC);
547
548 if (mask != nullptr) {
549 ED_mask_draw_frames(mask, region, cfra, sfra, efra);
550 }
551}
552
553float ED_space_image_zoom_level(const View2D *v2d, const int grid_dimension)
554{
555 /* UV-space length per pixel */
556 float xzoom = (v2d->cur.xmax - v2d->cur.xmin) / float(v2d->mask.xmax - v2d->mask.xmin);
557 float yzoom = (v2d->cur.ymax - v2d->cur.ymin) / float(v2d->mask.ymax - v2d->mask.ymin);
558
559 /* Zoom_factor for UV/Image editor is calculated based on:
560 * - Default grid size on startup, which is 256x256 pixels
561 * - How blend factor for grid lines is set up in the fragment shader `grid_frag.glsl`. */
562 float zoom_factor;
563 zoom_factor = (xzoom + yzoom) / 2.0f; /* Average for accuracy. */
564 zoom_factor *= 256.0f / powf(grid_dimension, 2);
565 return zoom_factor;
566}
567
569 float grid_steps_x[SI_GRID_STEPS_LEN],
570 float grid_steps_y[SI_GRID_STEPS_LEN],
571 const int grid_dimension)
572{
574 sima->grid_shape_source);
575 for (int step = 0; step < SI_GRID_STEPS_LEN; step++) {
576 switch (grid_shape_source) {
578 grid_steps_x[step] = powf(grid_dimension, step - SI_GRID_STEPS_LEN);
579 grid_steps_y[step] = powf(grid_dimension, step - SI_GRID_STEPS_LEN);
580 break;
582 grid_steps_x[step] = 1.0f / sima->custom_grid_subdiv[0];
583 grid_steps_y[step] = 1.0f / sima->custom_grid_subdiv[1];
584 break;
585 case SI_GRID_SHAPE_PIXEL: {
586 int pixel_width = IMG_SIZE_FALLBACK;
587 int pixel_height = IMG_SIZE_FALLBACK;
588 ED_space_image_get_size(sima, &pixel_width, &pixel_height);
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;
592 break;
593 }
594 default:
596 }
597 }
598}
599
600float ED_space_image_increment_snap_value(const int grid_dimensions,
601 const float grid_steps[SI_GRID_STEPS_LEN],
602 const float zoom_factor)
603{
604 /* Small offset on each grid_steps[] so that snapping value doesn't change until grid lines are
605 * significantly visible.
606 * `Offset = 3/4 * (grid_steps[i] - (grid_steps[i] / grid_dimensions))`
607 *
608 * Refer `grid_frag.glsl` to find out when grid lines actually start appearing */
609
610 for (int step = 0; step < SI_GRID_STEPS_LEN; step++) {
611 float offset = (3.0f / 4.0f) * (grid_steps[step] - (grid_steps[step] / grid_dimensions));
612
613 if ((grid_steps[step] - offset) > zoom_factor) {
614 return grid_steps[step];
615 }
616 }
617
618 /* Fallback */
619 return grid_steps[0];
620}
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy)
Definition glutil.cc:623
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)
Definition blf.cc:426
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
Definition blf.cc:459
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:568
int blf_mono_font
Definition blf.cc:51
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
Definition blf.cc:791
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
Definition blf.cc:476
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:371
#define BLI_assert_unreachable()
Definition BLI_assert.h:97
#define BLI_assert(a)
Definition BLI_assert.h:50
#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)
Definition math_color.cc:67
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)
Definition rct.c:418
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
Definition BLI_rect.h:176
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
Definition BLI_rect.h:172
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
unsigned char uchar
unsigned int uint
void BLI_mutex_lock(ThreadMutex *mutex)
Definition threads.cc:345
void BLI_mutex_unlock(ThreadMutex *mutex)
Definition threads.cc:350
pthread_mutex_t ThreadMutex
Definition BLI_threads.h:83
Platform independent time functions.
#define ELEM(...)
@ HISTO_FLAG_SAMPLELINE
@ IMA_SRC_MOVIE
@ IMA_SRC_VIEWER
@ IMA_SRC_SEQUENCE
@ IMA_TYPE_R_RESULT
Object is a sort of wrapper for general info.
#define SI_GRID_STEPS_LEN
eSpaceImage_GridShapeSource
@ SI_GRID_SHAPE_FIXED
@ SI_GRID_SHAPE_PIXEL
@ SI_GRID_SHAPE_DYNAMIC
@ SI_MODE_MASK
#define IMG_SIZE_FALLBACK
#define UI_SCALE_FAC
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)
Definition image_edit.cc:40
Mask * ED_space_image_get_mask(const SpaceImage *sima)
void ED_mask_draw_frames(Mask *mask, ARegion *region, int cfra, int sfra, int efra)
Definition mask_draw.cc:771
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)
Definition area.cc:3838
void ED_region_cache_draw_cached_segments(ARegion *region, int num_segments, const int *points, int sfra, int efra)
Definition area.cc:4060
const rcti * ED_region_visible_rect(ARegion *region)
Definition area.cc:4010
void ED_region_cache_draw_background(ARegion *region)
Definition area.cc:4021
void ED_region_cache_draw_curfra_label(int framenr, float x, float y)
Definition area.cc:4035
void immUniform4f(const char *name, float x, float y, float z, float w)
void immEnd()
void immUnbindProgram()
void immUniform2f(const char *name, float x, float y)
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void immUniformThemeColor(int color_id)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immVertex2fv(uint attr_id, const float data[2])
void immUniform1i(const char *name, int x)
void immUniform1f(const char *name, float x)
void immUniformColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
GPUVertFormat * immVertexFormat()
void immBegin(GPUPrimType, uint vertex_len)
void immUniformColor3fvAlpha(const float rgb[3], float a)
void immUniformColor3fv(const float rgb[3])
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void immRecti(uint pos, int x1, int y1, int x2, int y2)
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push()
void GPU_matrix_pop()
void GPU_matrix_translate_2f(float x, float y)
@ GPU_PRIM_LINES
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_BLEND_NONE
Definition GPU_state.hh:85
@ GPU_BLEND_ALPHA
Definition GPU_state.hh:87
void GPU_blend(eGPUBlend blend)
Definition gpu_state.cc:42
void GPU_line_width(float width)
Definition gpu_state.cc:161
void GPU_viewport_size_get_f(float coords[4])
Definition gpu_state.cc:262
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_I32
void IMB_colormanagement_pixel_to_display_space_v4(float result[4], const float pixel[4], const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
@ IMB_PROXY_NONE
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_UNIT_Y
#define UI_ALPHA_CHECKER_DARK
#define UI_UNIT_X
@ TH_FACE_SELECT
@ TH_CFRAME
void UI_view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
Definition view2d.cc:1718
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define powf(x, y)
#define ceilf(x)
draw_view in_light_buf[] float
#define str(s)
uint col
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)
Definition image_draw.cc:66
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
format
Render * RE_GetSceneRender(const Scene *scene)
float co[2][2]
struct Scene * scene
short source
struct Histogram sample_line_hist
int custom_grid_subdiv[2]
struct ImageUser iuser
float xmax
float xmin
float ymax
float ymin
int ymin
int ymax
int xmin
int xmax