Blender V4.5
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
8
9#include <cmath>
10#include <cstdlib>
11#include <cstring>
12
13#include "DNA_mask_types.h"
14#include "DNA_scene_types.h"
15#include "DNA_screen_types.h"
16#include "DNA_space_types.h"
17#include "DNA_view2d_types.h"
18
19#include "BLI_rect.h"
20#include "BLI_string.h"
21#include "BLI_threads.h"
22#include "BLI_utildefines.h"
23
25#include "IMB_imbuf_enums.h"
26#include "IMB_moviecache.hh"
27
28#include "BKE_context.hh"
29#include "BKE_image.hh"
30#include "BKE_paint.hh"
31
32#include "BIF_glutil.hh"
33
34#include "GPU_immediate.hh"
35#include "GPU_immediate_util.hh"
36#include "GPU_matrix.hh"
37#include "GPU_state.hh"
38
39#include "BLF_api.hh"
40
41#include "ED_gpencil_legacy.hh"
42#include "ED_image.hh"
43#include "ED_mask.hh"
44#include "ED_render.hh"
45#include "ED_screen.hh"
46#include "ED_util.hh"
47
48#include "UI_interface.hh"
49#include "UI_resources.hh"
50#include "UI_view2d.hh"
51
52#include "RE_engine.h"
53#include "RE_pipeline.h"
54
55#include "image_intern.hh"
56
57static void draw_render_info(
58 const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy)
59{
60 Render *re = RE_GetSceneRender(scene);
61 Scene *stats_scene = ED_render_job_get_scene(C);
62 if (stats_scene == nullptr) {
63 stats_scene = CTX_data_scene(C);
64 }
65
66 RenderResult *rr = BKE_image_acquire_renderresult(stats_scene, ima);
67
68 if (rr && rr->text) {
69 float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
70 ED_region_info_draw(region, rr->text, fill_color, true);
71 }
72
73 BKE_image_release_renderresult(stats_scene, ima, rr);
74
75 if (re) {
76 int total_tiles;
77 const rcti *tiles = RE_engine_get_current_tiles(re, &total_tiles);
78
79 if (total_tiles) {
80 /* find window pixel coordinates of origin */
81 int x, y;
82 UI_view2d_view_to_region(&region->v2d, 0.0f, 0.0f, &x, &y);
83
86 GPU_matrix_scale_2f(zoomx, zoomy);
87
92
93 GPU_line_width(1.0f);
94
95 const rcti *tile = tiles;
96 for (int i = 0; i < total_tiles; i++, tile++) {
97 immDrawBorderCorners(pos, tile, zoomx, zoomy);
98 }
99
101
103 }
104 }
105}
106
108 ARegion *region,
109 bool color_manage,
110 bool use_default_view,
111 int channels,
112 int x,
113 int y,
114 const uchar cp[4],
115 const float fp[4],
116 const float linearcol[4])
117{
118 rcti color_rect;
119 char str[256];
120 int dx = 6;
121 /* local coordinate visible rect inside region, to accommodate overlapping ui */
122 const rcti *rect = ED_region_visible_rect(region);
123 const int ymin = rect->ymin;
124 const int dy = ymin + 0.3f * UI_UNIT_Y;
125
126/* text colors */
127/* XXX colored text not allowed in Blender UI */
128#if 0
129 uchar red[3] = {255, 50, 50};
130 uchar green[3] = {0, 255, 0};
131 uchar blue[3] = {100, 100, 255};
132#else
133 const uchar red[3] = {255, 255, 255};
134 const uchar green[3] = {255, 255, 255};
135 const uchar blue[3] = {255, 255, 255};
136#endif
137 float hue = 0, sat = 0, val = 0, lum = 0, u = 0, v = 0;
138 float col[4], finalcol[4];
139
141
144
145 /* noisy, high contrast make impossible to read if lower alpha is used. */
146 immUniformColor4ub(0, 0, 0, 190);
147 immRectf(pos, 0, ymin, BLI_rcti_size_x(&region->winrct) + 1, ymin + UI_UNIT_Y);
148
150
152
154
155 BLF_color3ub(blf_mono_font, 255, 255, 255);
156 SNPRINTF(str, "X:%-4d Y:%-4d |", x, y);
157 BLF_position(blf_mono_font, dx, dy, 0);
158 BLF_draw(blf_mono_font, str, sizeof(str));
159 dx += BLF_width(blf_mono_font, str, sizeof(str));
160
161 if (channels == 1 && (cp != nullptr || fp != nullptr)) {
162 if (fp != nullptr) {
163 SNPRINTF(str, " Val:%-.3f |", fp[0]);
164 }
165 else if (cp != nullptr) {
166 SNPRINTF(str, " Val:%-.3f |", cp[0] / 255.0f);
167 }
168 BLF_color3ub(blf_mono_font, 255, 255, 255);
169 BLF_position(blf_mono_font, dx, dy, 0);
170 BLF_draw(blf_mono_font, str, sizeof(str));
171 dx += BLF_width(blf_mono_font, str, sizeof(str));
172 }
173
174 if (channels >= 3) {
176 if (fp) {
177 SNPRINTF(str, " R:%-.5f", fp[0]);
178 }
179 else if (cp) {
180 SNPRINTF(str, " R:%-3d", cp[0]);
181 }
182 else {
183 STRNCPY(str, " R:-");
184 }
185 BLF_position(blf_mono_font, dx, dy, 0);
186 BLF_draw(blf_mono_font, str, sizeof(str));
187 dx += BLF_width(blf_mono_font, str, sizeof(str));
188
190 if (fp) {
191 SNPRINTF(str, " G:%-.5f", fp[1]);
192 }
193 else if (cp) {
194 SNPRINTF(str, " G:%-3d", cp[1]);
195 }
196 else {
197 STRNCPY(str, " G:-");
198 }
199 BLF_position(blf_mono_font, dx, dy, 0);
200 BLF_draw(blf_mono_font, str, sizeof(str));
201 dx += BLF_width(blf_mono_font, str, sizeof(str));
202
204 if (fp) {
205 SNPRINTF(str, " B:%-.5f", fp[2]);
206 }
207 else if (cp) {
208 SNPRINTF(str, " B:%-3d", cp[2]);
209 }
210 else {
211 STRNCPY(str, " B:-");
212 }
213 BLF_position(blf_mono_font, dx, dy, 0);
214 BLF_draw(blf_mono_font, str, sizeof(str));
215 dx += BLF_width(blf_mono_font, str, sizeof(str));
216
217 if (channels == 4) {
218 BLF_color3ub(blf_mono_font, 255, 255, 255);
219 if (fp) {
220 SNPRINTF(str, " A:%-.4f", fp[3]);
221 }
222 else if (cp) {
223 SNPRINTF(str, " A:%-3d", cp[3]);
224 }
225 else {
226 STRNCPY(str, "- ");
227 }
228 BLF_position(blf_mono_font, dx, dy, 0);
229 BLF_draw(blf_mono_font, str, sizeof(str));
230 dx += BLF_width(blf_mono_font, str, sizeof(str));
231 }
232
233 if (color_manage) {
234 float rgba[4];
235
236 copy_v3_v3(rgba, linearcol);
237 if (channels == 3) {
238 rgba[3] = 1.0f;
239 }
240 else {
241 rgba[3] = linearcol[3];
242 }
243
244 if (use_default_view) {
246 rgba, rgba, nullptr, &scene->display_settings);
247 }
248 else {
250 rgba, rgba, &scene->view_settings, &scene->display_settings);
251 }
252
253 SNPRINTF(str, " | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
254 BLF_position(blf_mono_font, dx, dy, 0);
255 BLF_draw(blf_mono_font, str, sizeof(str));
256 dx += BLF_width(blf_mono_font, str, sizeof(str));
257 }
258 }
259
260 /* color rectangle */
261 if (channels == 1) {
262 if (fp) {
263 col[0] = col[1] = col[2] = fp[0];
264 }
265 else if (cp) {
266 col[0] = col[1] = col[2] = float(cp[0]) / 255.0f;
267 }
268 else {
269 col[0] = col[1] = col[2] = 0.0f;
270 }
271 col[3] = 1.0f;
272 }
273 else if (channels == 3) {
274 copy_v3_v3(col, linearcol);
275 col[3] = 1.0f;
276 }
277 else if (channels == 4) {
278 copy_v4_v4(col, linearcol);
279 }
280 else {
281 BLI_assert(0);
282 zero_v4(col);
283 }
284
285 if (color_manage) {
286 if (use_default_view) {
288 finalcol, col, nullptr, &scene->display_settings);
289 }
290 else {
292 finalcol, col, &scene->view_settings, &scene->display_settings);
293 }
294 }
295 else {
296 copy_v4_v4(finalcol, col);
297 }
298
300 dx += 0.25f * UI_UNIT_X;
301
302 BLI_rcti_init(&color_rect,
303 dx,
304 dx + (1.5f * UI_UNIT_X),
305 ymin + 0.15f * UI_UNIT_Y,
306 ymin + 0.85f * UI_UNIT_Y);
307
308 /* BLF uses immediate mode too, so we must reset our vertex format */
311
312 if (channels == 4) {
313 rcti color_rect_half;
314 int color_quater_x, color_quater_y;
315
316 color_rect_half = color_rect;
317 color_rect_half.xmax = BLI_rcti_cent_x(&color_rect);
318 /* what color ??? */
319 immRectf(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
320
321 color_rect_half = color_rect;
322 color_rect_half.xmin = BLI_rcti_cent_x(&color_rect);
323
324 color_quater_x = BLI_rcti_cent_x(&color_rect_half);
325 color_quater_y = BLI_rcti_cent_y(&color_rect_half);
326
329 color_rect_half.xmin,
330 color_rect_half.ymin,
331 color_rect_half.xmax,
332 color_rect_half.ymax);
333
335 immRectf(pos, color_quater_x, color_quater_y, color_rect_half.xmax, color_rect_half.ymax);
336 immRectf(pos, color_rect_half.xmin, color_rect_half.ymin, color_quater_x, color_quater_y);
337
338 if (fp != nullptr || cp != nullptr) {
340 immUniformColor3fvAlpha(finalcol, fp ? fp[3] : (cp[3] / 255.0f));
341 immRectf(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
343 }
344 }
345 else {
346 immUniformColor3fv(finalcol);
347 immRectf(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
348 }
350
351 /* draw outline */
354 immUniformColor3ub(128, 128, 128);
355 imm_draw_box_wire_2d(pos, color_rect.xmin, color_rect.ymin, color_rect.xmax, color_rect.ymax);
357
358 dx += 1.75f * UI_UNIT_X;
359
360 BLF_color3ub(blf_mono_font, 255, 255, 255);
361 if (channels == 1) {
362 if (fp) {
363 rgb_to_hsv(fp[0], fp[0], fp[0], &hue, &sat, &val);
364 rgb_to_yuv(fp[0], fp[0], fp[0], &lum, &u, &v, BLI_YUV_ITU_BT709);
365 }
366 else if (cp) {
368 float(cp[0]) / 255.0f, float(cp[0]) / 255.0f, float(cp[0]) / 255.0f, &hue, &sat, &val);
369 rgb_to_yuv(float(cp[0]) / 255.0f,
370 float(cp[0]) / 255.0f,
371 float(cp[0]) / 255.0f,
372 &lum,
373 &u,
374 &v,
376 }
377
378 SNPRINTF(str, "V:%-.4f", val);
379 BLF_position(blf_mono_font, dx, dy, 0);
380 BLF_draw(blf_mono_font, str, sizeof(str));
381 dx += BLF_width(blf_mono_font, str, sizeof(str));
382
383 SNPRINTF(str, " L:%-.4f", lum);
384 BLF_position(blf_mono_font, dx, dy, 0);
385 BLF_draw(blf_mono_font, str, sizeof(str));
386 }
387 else if (channels >= 3) {
388 rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
389 rgb_to_yuv(finalcol[0], finalcol[1], finalcol[2], &lum, &u, &v, BLI_YUV_ITU_BT709);
390
391 SNPRINTF(str, "H:%-.4f", hue);
392 BLF_position(blf_mono_font, dx, dy, 0);
393 BLF_draw(blf_mono_font, str, sizeof(str));
394 dx += BLF_width(blf_mono_font, str, sizeof(str));
395
396 SNPRINTF(str, " S:%-.4f", sat);
397 BLF_position(blf_mono_font, dx, dy, 0);
398 BLF_draw(blf_mono_font, str, sizeof(str));
399 dx += BLF_width(blf_mono_font, str, sizeof(str));
400
401 SNPRINTF(str, " V:%-.4f", val);
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, " L:%-.4f", lum);
407 BLF_position(blf_mono_font, dx, dy, 0);
408 BLF_draw(blf_mono_font, str, sizeof(str));
409 }
410}
412{
414 Histogram *hist = &sima->sample_line_hist;
415
417 uint shdr_dashed_pos = GPU_vertformat_attr_add(
419
421
422 float viewport_size[4];
423 GPU_viewport_size_get_f(viewport_size);
425 "viewport_size", viewport_size[2] / UI_SCALE_FAC, viewport_size[3] / UI_SCALE_FAC);
426
427 immUniform1i("colors_len", 2); /* Advanced dashes. */
428 immUniform4f("color", 1.0f, 1.0f, 1.0f, 1.0f);
429 immUniform4f("color2", 0.0f, 0.0f, 0.0f, 1.0f);
430 immUniform1f("dash_width", 2.0f);
431 immUniform1f("udash_factor", 0.5f);
432
434 immVertex2fv(shdr_dashed_pos, hist->co[0]);
435 immVertex2fv(shdr_dashed_pos, hist->co[1]);
436 immEnd();
437
439 }
440}
441
443{
445 Image *ima = ED_space_image(sima);
446
447 const bool show_viewer = (ima && ima->source == IMA_SRC_VIEWER) != 0;
448 const bool show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT) != 0;
449 if (ima && show_render) {
450 float zoomx, zoomy;
451 ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
452 draw_render_info(C, sima->iuser.scene, ima, region, zoomx, zoomy);
453 }
454}
455
457{
458 Image *image = ED_space_image(sima);
459 Mask *mask = nullptr;
460 if (sima->mode == SI_MODE_MASK) {
462 }
463 if (image == nullptr && mask == nullptr) {
464 return false;
465 }
466 if (mask == nullptr) {
467 return ELEM(image->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE);
468 }
469 return true;
470}
471
473 ARegion *region,
474 const int mval[2])
475{
476 const rcti *rect_visible = ED_region_visible_rect(region);
477 if (mval[1] > rect_visible->ymin + (16 * UI_SCALE_FAC)) {
478 return false;
479 }
480 return ED_space_image_show_cache(sima);
481}
482
483void draw_image_cache(const bContext *C, ARegion *region)
484{
486 Scene *scene = CTX_data_scene(C);
487 Image *image = ED_space_image(sima);
488 float x, cfra = scene->r.cfra, sfra = scene->r.sfra, efra = scene->r.efra,
489 framelen = region->winx / (efra - sfra + 1);
490 Mask *mask = nullptr;
491
492 if (!ED_space_image_show_cache(sima)) {
493 return;
494 }
495
496 if (sima->mode == SI_MODE_MASK) {
498 }
499
500 /* Local coordinate visible rect inside region, to accommodate overlapping ui. */
501 const rcti *rect_visible = ED_region_visible_rect(region);
502 const int region_bottom = rect_visible->ymin;
503
505
506 /* Draw cache background. */
508
509 /* Draw cached segments. */
510 if (image != nullptr && image->cache != nullptr &&
512 {
513 int num_segments = 0;
514 int *points = nullptr;
515
516 std::scoped_lock lock(image->runtime->cache_mutex);
517 IMB_moviecache_get_cache_segments(image->cache, IMB_PROXY_NONE, 0, &num_segments, &points);
518
520 region, num_segments, points, sfra + sima->iuser.offset, efra + sima->iuser.offset);
521 }
522
524
525 /* Draw current frame. */
526 x = (cfra - sfra) / (efra - sfra + 1) * region->winx;
527
531 immRectf(pos, x, region_bottom, x + ceilf(framelen), region_bottom + 8 * UI_SCALE_FAC);
533
535 cfra, x + roundf(framelen / 2), region_bottom + 8.0f * UI_SCALE_FAC);
536
537 if (mask != nullptr) {
538 ED_mask_draw_frames(mask, region, cfra, sfra, efra);
539 }
540}
541
542float ED_space_image_zoom_level(const View2D *v2d, const int grid_dimension)
543{
544 /* UV-space length per pixel */
545 float xzoom = (v2d->cur.xmax - v2d->cur.xmin) / float(v2d->mask.xmax - v2d->mask.xmin);
546 float yzoom = (v2d->cur.ymax - v2d->cur.ymin) / float(v2d->mask.ymax - v2d->mask.ymin);
547
548 /* Zoom_factor for UV/Image editor is calculated based on:
549 * - Default grid size on startup, which is 256x256 pixels
550 * - How blend factor for grid lines is set up in the fragment shader `grid_frag.glsl`. */
551 float zoom_factor;
552 zoom_factor = (xzoom + yzoom) / 2.0f; /* Average for accuracy. */
553 zoom_factor *= 256.0f / powf(grid_dimension, 2);
554 return zoom_factor;
555}
556
558 float grid_steps_x[SI_GRID_STEPS_LEN],
559 float grid_steps_y[SI_GRID_STEPS_LEN],
560 const int grid_dimension)
561{
563 sima->grid_shape_source);
564 for (int step = 0; step < SI_GRID_STEPS_LEN; step++) {
565 switch (grid_shape_source) {
567 grid_steps_x[step] = powf(grid_dimension, step - SI_GRID_STEPS_LEN);
568 grid_steps_y[step] = powf(grid_dimension, step - SI_GRID_STEPS_LEN);
569 break;
571 grid_steps_x[step] = 1.0f / sima->custom_grid_subdiv[0];
572 grid_steps_y[step] = 1.0f / sima->custom_grid_subdiv[1];
573 break;
574 case SI_GRID_SHAPE_PIXEL: {
575 int pixel_width = IMG_SIZE_FALLBACK;
576 int pixel_height = IMG_SIZE_FALLBACK;
577 ED_space_image_get_size(sima, &pixel_width, &pixel_height);
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;
581 break;
582 }
583 default:
585 }
586 }
587}
588
589float ED_space_image_increment_snap_value(const int grid_dimensions,
590 const float grid_steps[SI_GRID_STEPS_LEN],
591 const float zoom_factor)
592{
593 /* Small offset on each grid_steps[] so that snapping value doesn't change until grid lines are
594 * significantly visible.
595 * `Offset = 3/4 * (grid_steps[i] - (grid_steps[i] / grid_dimensions))`
596 *
597 * Refer `grid_frag.glsl` to find out when grid lines actually start appearing */
598
599 for (int step = 0; step < SI_GRID_STEPS_LEN; step++) {
600 float offset = (3.0f / 4.0f) * (grid_steps[step] - (grid_steps[step] / grid_dimensions));
601
602 if ((grid_steps[step] - offset) > zoom_factor) {
603 return grid_steps[step];
604 }
605 }
606
607 /* Fallback */
608 return grid_steps[0];
609}
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy)
Definition glutil.cc:618
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:440
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
Definition blf.cc:473
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:582
int blf_mono_font
Definition blf.cc:48
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:805
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
Definition blf.cc:490
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:385
#define BLI_assert_unreachable()
Definition BLI_assert.h:93
#define BLI_assert(a)
Definition BLI_assert.h:46
#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.cc:414
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:194
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
Definition BLI_rect.h:181
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
Definition BLI_rect.h:177
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:599
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
unsigned char uchar
unsigned int uint
#define ELEM(...)
@ HISTO_FLAG_SAMPLELINE
@ IMA_SRC_MOVIE
@ IMA_SRC_VIEWER
@ IMA_SRC_SEQUENCE
@ IMA_TYPE_R_RESULT
#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:772
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:3942
void ED_region_cache_draw_cached_segments(ARegion *region, int num_segments, const int *points, int sfra, int efra)
Definition area.cc:4174
const rcti * ED_region_visible_rect(ARegion *region)
Definition area.cc:4114
void ED_region_cache_draw_background(ARegion *region)
Definition area.cc:4125
void ED_region_cache_draw_curfra_label(int framenr, float x, float y)
Definition area.cc:4138
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 immRectf(uint pos, float x1, float y1, float x2, float 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:166
void GPU_viewport_size_get_f(float coords[4])
Definition gpu_state.cc:273
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, blender::StringRef name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
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
void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_flags, int *r_totseg, int **r_points)
#define C
Definition RandGen.cpp:29
#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:1722
volatile int lock
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define powf(x, y)
#define ceilf(x)
#define str(s)
uint pos
uint col
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)
Definition image_draw.cc:57
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
format
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
Render * RE_GetSceneRender(const Scene *scene)
float co[2][2]
struct Scene * scene
struct MovieCache * cache
short source
ImageRuntimeHandle * runtime
ColorManagedViewSettings view_settings
struct RenderData r
ColorManagedDisplaySettings display_settings
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
i
Definition text_draw.cc:230