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