Blender V4.5
glutil.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 <cstdio>
10#include <cstring>
11
12#include "DNA_userdef_types.h"
13#include "DNA_vec_types.h"
14
15#include "BLI_utildefines.h"
16
17#include "BIF_glutil.hh"
18
20#include "IMB_imbuf_types.hh"
21
22#include "GPU_context.hh"
23#include "GPU_immediate.hh"
24#include "GPU_texture.hh"
25
26/* ******************************************** */
27
29{
30 GPUVertFormat *vert_format = immVertexFormat();
31 state->pos = GPU_vertformat_attr_add(vert_format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
33 vert_format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
34}
35
37{
40
42
43 /* Shader will be unbind by immUnbindProgram in a `immDrawPixelsTex` function. */
45 state.do_shader_unbind = true;
46
47 return state;
48}
49
51 const float x,
52 const float y,
53 const int img_w,
54 const int img_h,
55 const eGPUTextureFormat gpu_format,
56 const bool use_filter,
57 const void *rect,
58 const float scaleX,
59 const float scaleY,
60 const float xzoom,
61 const float yzoom,
62 const float color[4])
63{
64 static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
65 const float draw_width = img_w * scaleX * xzoom;
66 const float draw_height = img_h * scaleY * yzoom;
67 /* Down-scaling with regular bi-linear interpolation (i.e. #GL_LINEAR) doesn't give good
68 * filtering results. Mipmaps can be used to get better results (i.e. #GL_LINEAR_MIPMAP_LINEAR),
69 * so always use mipmaps when filtering. */
70 const bool use_mipmap = use_filter && ((draw_width < img_w) || (draw_height < img_h));
71 const int mip_len = use_mipmap ? 9999 : 1;
72
73 GPUTexture *tex = GPU_texture_create_2d(
74 "immDrawPixels", img_w, img_h, mip_len, gpu_format, GPU_TEXTURE_USAGE_SHADER_READ, nullptr);
75
76 const bool use_float_data = ELEM(gpu_format, GPU_RGBA16F, GPU_RGB16F, GPU_R16F);
77 eGPUDataFormat gpu_data_format = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
78 GPU_texture_update(tex, gpu_data_format, rect);
79
80 GPU_texture_filter_mode(tex, use_filter);
81 if (use_mipmap) {
83 GPU_texture_mipmap_mode(tex, true, true);
84 }
86
87 GPU_texture_bind(tex, 0);
88
89 /* optional */
90 /* NOTE: Shader could be null for GLSL OCIO drawing, it is fine, since
91 * it does not need color.
92 */
93 if (state->shader != nullptr && GPU_shader_get_uniform(state->shader, "color") != -1) {
94 immUniformColor4fv((color) ? color : white);
95 }
96
97 uint pos = state->pos, texco = state->texco;
98
100 immAttr2f(texco, 0.0f, 0.0f);
101 immVertex2f(pos, x, y);
102
103 immAttr2f(texco, 1.0f, 0.0f);
104 immVertex2f(pos, x + draw_width, y);
105
106 immAttr2f(texco, 1.0f, 1.0f);
107 immVertex2f(pos, x + draw_width, y + draw_height);
108
109 immAttr2f(texco, 0.0f, 1.0f);
110 immVertex2f(pos, x, y + draw_height);
111 immEnd();
112
113 if (state->do_shader_unbind) {
115 }
116
118 GPU_texture_free(tex);
119}
120
122 float x,
123 float y,
124 int img_w,
125 int img_h,
126 eGPUTextureFormat gpu_format,
127 bool use_filter,
128 const void *rect,
129 float scaleX,
130 float scaleY,
131 float clip_min_x,
132 float clip_min_y,
133 float clip_max_x,
134 float clip_max_y,
135 float xzoom,
136 float yzoom,
137 const float color[4])
138{
139 int subpart_x, subpart_y, tex_w = 256, tex_h = 256;
141 /* NOTE: These backend will keep all temporary texture memory within a command
142 * submission in-flight, so using a partial tile size does not provide any tangible memory
143 * reduction, but does incur additional API overhead and significant cache inefficiency on
144 * specific platforms.
145 *
146 * The Metal API also provides smart resource paging such that the application can
147 * still efficiently swap memory, even if system is low in physical memory. */
148 tex_w = img_w;
149 tex_h = img_h;
150 }
151 int seamless, offset_x, offset_y, nsubparts_x, nsubparts_y;
152 int components;
153 const bool use_clipping = ((clip_min_x < clip_max_x) && (clip_min_y < clip_max_y));
154 const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
155
156 if (ELEM(gpu_format, GPU_RGBA8, GPU_RGBA16F)) {
157 components = 4;
158 }
159 else if (ELEM(gpu_format, GPU_RGB16F)) {
160 components = 3;
161 }
162 else if (ELEM(gpu_format, GPU_R8, GPU_R16F)) {
163 components = 1;
164 }
165 else {
166 BLI_assert_msg(0, "Incompatible format passed to immDrawPixels");
167 return;
168 }
169
170 const bool use_float_data = ELEM(gpu_format, GPU_RGBA16F, GPU_RGB16F, GPU_R16F);
171 eGPUDataFormat gpu_data = (use_float_data) ? GPU_DATA_FLOAT : GPU_DATA_UBYTE;
172 size_t stride = components * ((use_float_data) ? sizeof(float) : sizeof(uchar));
173
174 GPUTexture *tex = GPU_texture_create_2d(
175 "immDrawPixels", tex_w, tex_h, 1, gpu_format, GPU_TEXTURE_USAGE_SHADER_READ, nullptr);
176
177 GPU_texture_filter_mode(tex, use_filter);
179
180 GPU_texture_bind(tex, 0);
181
182 /* setup seamless 2=on, 0=off */
183 seamless = ((tex_w < img_w || tex_h < img_h) && tex_w > 2 && tex_h > 2) ? 2 : 0;
184
185 offset_x = tex_w - seamless;
186 offset_y = tex_h - seamless;
187
188 nsubparts_x = (img_w + (offset_x - 1)) / (offset_x);
189 nsubparts_y = (img_h + (offset_y - 1)) / (offset_y);
190
191 /* optional */
192 /* NOTE: Shader could be null for GLSL OCIO drawing, it is fine, since
193 * it does not need color.
194 */
195 if (state->shader != nullptr && GPU_shader_get_uniform(state->shader, "color") != -1) {
196 immUniformColor4fv((color) ? color : white);
197 }
198
200
201 for (subpart_y = 0; subpart_y < nsubparts_y; subpart_y++) {
202 for (subpart_x = 0; subpart_x < nsubparts_x; subpart_x++) {
203 int remainder_x = img_w - subpart_x * offset_x;
204 int remainder_y = img_h - subpart_y * offset_y;
205 int subpart_w = (remainder_x < tex_w) ? remainder_x : tex_w;
206 int subpart_h = (remainder_y < tex_h) ? remainder_y : tex_h;
207 int offset_left = (seamless && subpart_x != 0) ? 1 : 0;
208 int offset_bot = (seamless && subpart_y != 0) ? 1 : 0;
209 int offset_right = (seamless && remainder_x > tex_w) ? 1 : 0;
210 int offset_top = (seamless && remainder_y > tex_h) ? 1 : 0;
211 float rast_x = x + subpart_x * offset_x * xzoom;
212 float rast_y = y + subpart_y * offset_y * yzoom;
213 /* check if we already got these because we always get 2 more when doing seamless */
214 if (subpart_w <= seamless || subpart_h <= seamless) {
215 continue;
216 }
217
218 int right = subpart_w - offset_right;
219 int top = subpart_h - offset_top;
220 int bottom = 0 + offset_bot;
221 int left = 0 + offset_left;
222
223 if (use_clipping) {
224 if (rast_x + right * xzoom * scaleX < clip_min_x ||
225 rast_y + top * yzoom * scaleY < clip_min_y)
226 {
227 continue;
228 }
229 if (rast_x + left * xzoom > clip_max_x || rast_y + bottom * yzoom > clip_max_y) {
230 continue;
231 }
232 }
233
234 {
235 int src_y = subpart_y * offset_y;
236 int src_x = subpart_x * offset_x;
237
238#define DATA(_y, _x) (static_cast<const char *>(rect) + stride * (size_t(_y) * img_w + (_x)))
239 {
240 const void *data = DATA(src_y, src_x);
241 GPU_texture_update_sub(tex, gpu_data, data, 0, 0, 0, subpart_w, subpart_h, 0);
242 }
243 /* Add an extra border of pixels so linear interpolation looks ok
244 * at edges of full image. */
245 if (subpart_w < tex_w) {
246 const void *data = DATA(src_y, src_x + subpart_w - 1);
247 const int offset[2] = {subpart_w, 0};
248 const int extent[2] = {1, subpart_h};
249 GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0);
250 }
251 if (subpart_h < tex_h) {
252 const void *data = DATA(src_y + subpart_h - 1, src_x);
253 const int offset[2] = {0, subpart_h};
254 const int extent[2] = {subpart_w, 1};
255 GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0);
256 }
257
258 if (subpart_w < tex_w && subpart_h < tex_h) {
259 const void *data = DATA(src_y + subpart_h - 1, src_x + subpart_w - 1);
260 const int offset[2] = {subpart_w, subpart_h};
261 const int extent[2] = {1, 1};
262 GPU_texture_update_sub(tex, gpu_data, data, UNPACK2(offset), 0, UNPACK2(extent), 0);
263 }
264#undef DATA
265 }
266
267 uint pos = state->pos, texco = state->texco;
268
270 immAttr2f(texco, left / float(tex_w), bottom / float(tex_h));
271 immVertex2f(pos, rast_x + offset_left * xzoom, rast_y + offset_bot * yzoom);
272
273 immAttr2f(texco, right / float(tex_w), bottom / float(tex_h));
274 immVertex2f(pos, rast_x + right * xzoom * scaleX, rast_y + offset_bot * yzoom);
275
276 immAttr2f(texco, right / float(tex_w), top / float(tex_h));
277 immVertex2f(pos, rast_x + right * xzoom * scaleX, rast_y + top * yzoom * scaleY);
278
279 immAttr2f(texco, left / float(tex_w), top / float(tex_h));
280 immVertex2f(pos, rast_x + offset_left * xzoom, rast_y + top * yzoom * scaleY);
281 immEnd();
282 }
283 }
284
285 if (state->do_shader_unbind) {
286 immUnbindProgram();
287 }
288
290 GPU_texture_free(tex);
291
292 /* Restore default. */
294}
295
297 float x,
298 float y,
299 int img_w,
300 int img_h,
301 eGPUTextureFormat gpu_format,
302 bool use_filter,
303 const void *rect,
304 float scaleX,
305 float scaleY,
306 float xzoom,
307 float yzoom,
308 const float color[4])
309{
311 x,
312 y,
313 img_w,
314 img_h,
315 gpu_format,
316 use_filter,
317 rect,
318 scaleX,
319 scaleY,
320 0.0f,
321 0.0f,
322 0.0f,
323 0.0f,
324 xzoom,
325 yzoom,
326 color);
327}
328
330 float x,
331 float y,
332 int img_w,
333 int img_h,
334 eGPUTextureFormat gpu_format,
335 bool use_filter,
336 const void *rect,
337 float xzoom,
338 float yzoom,
339 const float color[4])
340{
342 x,
343 y,
344 img_w,
345 img_h,
346 gpu_format,
347 use_filter,
348 rect,
349 1.0f,
350 1.0f,
351 0.0f,
352 0.0f,
353 0.0f,
354 0.0f,
355 xzoom,
356 yzoom,
357 color);
358}
359
361 float x,
362 float y,
363 int img_w,
364 int img_h,
365 eGPUTextureFormat gpu_format,
366 bool use_filter,
367 const void *rect,
368 float clip_min_x,
369 float clip_min_y,
370 float clip_max_x,
371 float clip_max_y,
372 float xzoom,
373 float yzoom,
374 const float color[4])
375{
377 x,
378 y,
379 img_w,
380 img_h,
381 gpu_format,
382 use_filter,
383 rect,
384 1.0f,
385 1.0f,
386 clip_min_x,
387 clip_min_y,
388 clip_max_x,
389 clip_max_y,
390 xzoom,
391 yzoom,
392 color);
393}
394
395/* **** Color management helper functions for GLSL display/transform ***** */
396
398 float x,
399 float y,
400 bool use_filter,
401 const ColorManagedViewSettings *view_settings,
402 const ColorManagedDisplaySettings *display_settings,
403 float clip_min_x,
404 float clip_min_y,
405 float clip_max_x,
406 float clip_max_y,
407 float zoom_x,
408 float zoom_y)
409{
410 bool force_fallback = false;
411 bool need_fallback = true;
412
413 /* Early out */
414 if (ibuf->byte_buffer.data == nullptr && ibuf->float_buffer.data == nullptr) {
415 return;
416 }
417
418 /* Single channel images could not be transformed using GLSL yet */
419 force_fallback |= ibuf->channels == 1;
420
421 /* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */
422 force_fallback |= (ED_draw_imbuf_method(ibuf) != IMAGE_DRAW_METHOD_GLSL);
423
424 /* Try to draw buffer using GLSL display transform */
425 if (force_fallback == false) {
426 int ok;
427
428 IMMDrawPixelsTexState state = {nullptr};
429 /* We want GLSL state to be fully handled by OCIO. */
430 state.do_shader_unbind = false;
432
433 if (ibuf->float_buffer.data) {
434 if (ibuf->float_buffer.colorspace) {
436 display_settings,
438 ibuf->dither,
439 true,
440 false);
441 }
442 else {
444 view_settings, display_settings, ibuf->dither, true);
445 }
446 }
447 else {
449 display_settings,
451 ibuf->dither,
452 false,
453 false);
454 }
455
456 if (ok) {
457 if (ibuf->float_buffer.data) {
459
460 if (ibuf->channels == 3) {
462 }
463 else if (ibuf->channels == 4) {
465 }
466 else {
467 BLI_assert_msg(0, "Incompatible number of channels for GLSL display");
468 }
469
470 if (format != 0) {
472 x,
473 y,
474 ibuf->x,
475 ibuf->y,
476 format,
477 use_filter,
478 ibuf->float_buffer.data,
479 clip_min_x,
480 clip_min_y,
481 clip_max_x,
482 clip_max_y,
483 zoom_x,
484 zoom_y,
485 nullptr);
486 }
487 }
488 else if (ibuf->byte_buffer.data) {
489 /* ibuf->rect is always RGBA */
491 x,
492 y,
493 ibuf->x,
494 ibuf->y,
495 GPU_RGBA8,
496 use_filter,
497 ibuf->byte_buffer.data,
498 clip_min_x,
499 clip_min_y,
500 clip_max_x,
501 clip_max_y,
502 zoom_x,
503 zoom_y,
504 nullptr);
505 }
506
508
509 need_fallback = false;
510 }
511 }
512
513 /* In case GLSL failed or not usable, fallback to glaDrawPixelsAuto */
514 if (need_fallback) {
515 uchar *display_buffer;
516 void *cache_handle;
517
518 display_buffer = IMB_display_buffer_acquire(
519 ibuf, view_settings, display_settings, &cache_handle);
520
521 if (display_buffer) {
524 x,
525 y,
526 ibuf->x,
527 ibuf->y,
528 GPU_RGBA8,
529 use_filter,
530 display_buffer,
531 clip_min_x,
532 clip_min_y,
533 clip_max_x,
534 clip_max_y,
535 zoom_x,
536 zoom_y,
537 nullptr);
538 }
539
540 IMB_display_buffer_release(cache_handle);
541 }
542}
543
545 float x,
546 float y,
547 bool use_filter,
548 const ColorManagedViewSettings *view_settings,
549 const ColorManagedDisplaySettings *display_settings,
550 float zoom_x,
551 float zoom_y)
552{
554 x,
555 y,
556 use_filter,
557 view_settings,
558 display_settings,
559 0.0f,
560 0.0f,
561 0.0f,
562 0.0f,
563 zoom_x,
564 zoom_y);
565}
566
568 ImBuf *ibuf,
569 float x,
570 float y,
571 bool use_filter,
572 float clip_min_x,
573 float clip_min_y,
574 float clip_max_x,
575 float clip_max_y,
576 float zoom_x,
577 float zoom_y)
578{
579 ColorManagedViewSettings *view_settings;
580 ColorManagedDisplaySettings *display_settings;
581
582 IMB_colormanagement_display_settings_from_ctx(C, &view_settings, &display_settings);
583
585 x,
586 y,
587 use_filter,
588 view_settings,
589 display_settings,
590 clip_min_x,
591 clip_min_y,
592 clip_max_x,
593 clip_max_y,
594 zoom_x,
595 zoom_y);
596}
597
599 const bContext *C, ImBuf *ibuf, float x, float y, bool use_filter, float zoom_x, float zoom_y)
600{
601 ED_draw_imbuf_ctx_clipping(C, ibuf, x, y, use_filter, 0.0f, 0.0f, 0.0f, 0.0f, zoom_x, zoom_y);
602}
603
605{
606 if (U.image_draw_method == IMAGE_DRAW_METHOD_AUTO) {
607 /* Use faster GLSL when CPU to GPU transfer is unlikely to be a bottleneck,
608 * otherwise do color management on CPU side. */
609 const size_t threshold = sizeof(float[4]) * 2048 * 2048;
610 const size_t data_size = (ibuf->float_buffer.data) ? sizeof(float) : sizeof(uchar);
611 const size_t size = size_t(ibuf->x) * size_t(ibuf->y) * size_t(ibuf->channels) * data_size;
612
614 }
615 return U.image_draw_method;
616}
617
618void immDrawBorderCorners(uint pos, const rcti *border, float zoomx, float zoomy)
619{
620 float delta_x = 4.0f * UI_SCALE_FAC / zoomx;
621 float delta_y = 4.0f * UI_SCALE_FAC / zoomy;
622
623 delta_x = min_ff(delta_x, border->xmax - border->xmin);
624 delta_y = min_ff(delta_y, border->ymax - border->ymin);
625
626 /* left bottom corner */
628 immVertex2f(pos, border->xmin, border->ymin + delta_y);
629 immVertex2f(pos, border->xmin, border->ymin);
630 immVertex2f(pos, border->xmin + delta_x, border->ymin);
631 immEnd();
632
633 /* left top corner */
635 immVertex2f(pos, border->xmin, border->ymax - delta_y);
636 immVertex2f(pos, border->xmin, border->ymax);
637 immVertex2f(pos, border->xmin + delta_x, border->ymax);
638 immEnd();
639
640 /* right bottom corner */
642 immVertex2f(pos, border->xmax - delta_x, border->ymin);
643 immVertex2f(pos, border->xmax, border->ymin);
644 immVertex2f(pos, border->xmax, border->ymin + delta_y);
645 immEnd();
646
647 /* right top corner */
649 immVertex2f(pos, border->xmax - delta_x, border->ymax);
650 immVertex2f(pos, border->xmax, border->ymax);
651 immVertex2f(pos, border->xmax, border->ymax - delta_y);
652 immEnd();
653}
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:53
MINLINE float min_ff(float a, float b)
unsigned char uchar
unsigned int uint
#define UNPACK2(a)
#define ELEM(...)
#define UI_SCALE_FAC
@ IMAGE_DRAW_METHOD_AUTO
@ IMAGE_DRAW_METHOD_GLSL
@ IMAGE_DRAW_METHOD_2DTEXTURE
eGPUBackendType GPU_backend_get_type()
void immEnd()
void immUnbindProgram()
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
GPUVertFormat * immVertexFormat()
void immUniformColor4fv(const float rgba[4])
void immAttr2f(uint attr_id, float x, float y)
void immBegin(GPUPrimType, uint vertex_len)
@ GPU_PRIM_TRI_FAN
@ GPU_PRIM_LINE_STRIP
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
eGPUBuiltinShader
@ GPU_SHADER_3D_IMAGE_COLOR
void GPU_texture_bind(GPUTexture *texture, int unit)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(GPUTexture *texture)
void GPU_texture_unbind(GPUTexture *texture)
eGPUDataFormat
@ GPU_DATA_UBYTE
@ GPU_DATA_FLOAT
void GPU_texture_extend_mode(GPUTexture *texture, GPUSamplerExtendMode extend_mode)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
void GPU_texture_update_sub(GPUTexture *texture, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
void GPU_texture_mipmap_mode(GPUTexture *texture, bool use_mipmap, bool use_filter)
void GPU_texture_filter_mode(GPUTexture *texture, bool use_filter)
eGPUTextureFormat
@ GPU_R16F
@ GPU_RGBA16F
@ GPU_R8
@ GPU_RGB16F
@ GPU_RGBA8
void GPU_texture_update_mipmap_chain(GPUTexture *texture)
void GPU_unpack_row_length_set(uint len)
void GPU_texture_update(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
@ GPU_FETCH_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, blender::StringRef name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
unsigned char * IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, void **cache_handle)
bool IMB_colormanagement_setup_glsl_draw(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither, bool predivide)
void IMB_display_buffer_release(void *cache_handle)
void IMB_colormanagement_display_settings_from_ctx(const bContext *C, ColorManagedViewSettings **r_view_settings, ColorManagedDisplaySettings **r_display_settings)
void IMB_colormanagement_finish_glsl_draw()
bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, const ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge)
#define C
Definition RandGen.cpp:29
#define U
BMesh const char void * data
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
void immDrawPixelsTexTiled_scaling_clipping(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float scaleX, float scaleY, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float xzoom, float yzoom, const float color[4])
Definition glutil.cc:121
void ED_draw_imbuf_ctx(const bContext *C, ImBuf *ibuf, float x, float y, bool use_filter, float zoom_x, float zoom_y)
Definition glutil.cc:598
void immDrawPixelsTexTiled_scaling(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float scaleX, float scaleY, float xzoom, float yzoom, const float color[4])
Definition glutil.cc:296
void ED_draw_imbuf_clipping(ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float clip_min_x, float clip_min_y, float clip_max_x, float clip_max_y, float zoom_x, float zoom_y)
Definition glutil.cc:397
void immDrawPixelsTexTiled_clipping(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const 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])
Definition glutil.cc:360
void ED_draw_imbuf(ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
Definition glutil.cc:544
void immDrawBorderCorners(uint pos, const rcti *border, float zoomx, float zoomy)
Definition glutil.cc:618
void ED_draw_imbuf_ctx_clipping(const bContext *C, 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)
Definition glutil.cc:567
#define DATA(_y, _x)
void immDrawPixelsTexTiled(IMMDrawPixelsTexState *state, float x, float y, int img_w, int img_h, eGPUTextureFormat gpu_format, bool use_filter, const void *rect, float xzoom, float yzoom, const float color[4])
Definition glutil.cc:329
int ED_draw_imbuf_method(const ImBuf *ibuf)
Definition glutil.cc:604
void immDrawPixelsTexScaledFullSize(const IMMDrawPixelsTexState *state, const float x, const float y, const int img_w, const int img_h, const eGPUTextureFormat gpu_format, const bool use_filter, const void *rect, const float scaleX, const float scaleY, const float xzoom, const float yzoom, const float color[4])
Definition glutil.cc:50
IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin)
Definition glutil.cc:36
static void immDrawPixelsTexSetupAttributes(IMMDrawPixelsTexState *state)
Definition glutil.cc:28
uint pos
uint top
format
static ulong state[N]
static int left
const ColorSpace * colorspace
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
int ymin
int ymax
int xmin
int xmax