Blender V5.3
scaling.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2024 Blender Authors
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later */
5
9
10#include "BLI_math_interp.hh"
11#include "BLI_math_vector.hh"
12#include "BLI_task.hh"
13#include "BLI_utildefines.hh"
14
15#include "MEM_guardedalloc.h"
16
17#include "IMB_filter.hh"
18#include "IMB_imbuf.hh"
19#include "IMB_imbuf_types.hh"
20#include "IMB_metadata.hh"
21
22#include "BLI_sys_types.hh" /* for intptr_t support */
23
24namespace blender {
25
26static inline float4 load_pixel(const uchar4 *ptr)
27{
28 return float4(ptr[0]);
29}
30static inline float4 load_pixel(const float *ptr)
31{
32 return float4(ptr[0]);
33}
34static inline float4 load_pixel(const float2 *ptr)
35{
36 return float4(ptr[0], 0.0f, 1.0f);
37}
38static inline float4 load_pixel(const float3 *ptr)
39{
40 return float4(ptr[0], 1.0f);
41}
42static inline float4 load_pixel(const float4 *ptr)
43{
44 return float4(ptr[0]);
45}
46static inline void store_pixel(float4 pix, uchar4 *ptr)
47{
48 *ptr = uchar4(math::round(pix));
49}
50static inline void store_pixel(float4 pix, float *ptr)
51{
52 *ptr = pix.x;
53}
54static inline void store_pixel(float4 pix, float2 *ptr)
55{
56 memcpy(reinterpret_cast<void *>(ptr), &pix, sizeof(*ptr));
57}
58static inline void store_pixel(float4 pix, float3 *ptr)
59{
60 memcpy(reinterpret_cast<void *>(ptr), &pix, sizeof(*ptr));
61}
62static inline void store_pixel(float4 pix, float4 *ptr)
63{
64 *ptr = pix;
65}
66
67template<typename BufferT, typename Fn>
68static void to_static_pixel_type(const BufferT *src_buffer,
69 const int channels,
70 BufferT *dst_buffer,
71 const Fn &fn)
72{
73 if constexpr (std::is_same_v<BufferT, uchar>) {
74 fn(reinterpret_cast<const uchar4 *>(src_buffer), reinterpret_cast<uchar4 *>(dst_buffer));
75 }
76 else {
77 if (channels == 1) {
78 fn(src_buffer, dst_buffer);
79 }
80 else if (channels == 2) {
81 const float2 *src = reinterpret_cast<const float2 *>(src_buffer);
82 fn(src, reinterpret_cast<float2 *>(dst_buffer));
83 }
84 else if (channels == 3) {
85 const float3 *src = reinterpret_cast<const float3 *>(src_buffer);
86 fn(src, reinterpret_cast<float3 *>(dst_buffer));
87 }
88 else if (channels == 4) {
89 const float4 *src = reinterpret_cast<const float4 *>(src_buffer);
90 fn(src, reinterpret_cast<float4 *>(dst_buffer));
91 }
92 }
93}
94
95template<typename BufferT>
96static void scale_down_x_func(const BufferT *src_buffer,
97 const int2 src_size,
98 const int src_stride,
99 const int channels,
100 BufferT *dst_buffer,
101 const int2 dst_size,
102 bool threaded)
103{
104 const int newx = dst_size.x;
105 const int ibufx = src_size.x;
106 const int ibufy = src_size.y;
107 to_static_pixel_type(src_buffer, channels, dst_buffer, [&]<typename T>(const T *src, T *dst) {
108 const float add = (ibufx - 0.01f) / newx;
109 const float inv_add = 1.0f / add;
110
111 const int grain_size = threaded ? 32 : ibufy;
112 threading::parallel_for(IndexRange(ibufy), grain_size, [&](IndexRange range) {
113 for (const int y : range) {
114 const T *src_ptr = src + (int64_t(y) * src_stride);
115 T *dst_ptr = dst + (int64_t(y) * newx);
116 float sample = 0.0f;
117 float4 val(0.0f);
118
119 for (int x = 0; x < newx; x++) {
120 float4 nval = -val * sample;
121 sample += add;
122 while (sample >= 1.0f) {
123 sample -= 1.0f;
124 nval += load_pixel(src_ptr);
125 src_ptr++;
126 }
127
128 val = load_pixel(src_ptr);
129 src_ptr++;
130
131 float4 pix = (nval + sample * val) * inv_add;
132 store_pixel(pix, dst_ptr);
133 dst_ptr++;
134
135 sample -= 1.0f;
136 }
137 }
138 });
139 });
140}
141
142template<typename BufferT>
143static void scale_down_y_func(const BufferT *src_buffer,
144 const int2 src_size,
145 const int channels,
146 BufferT *dst_buffer,
147 const int2 dst_size,
148 bool threaded)
149{
150 const int newy = dst_size.y;
151 const int ibufx = src_size.x;
152 const int ibufy = src_size.y;
153 to_static_pixel_type(src_buffer, channels, dst_buffer, [&]<typename T>(const T *src, T *dst) {
154 const float add = (ibufy - 0.01f) / newy;
155 const float inv_add = 1.0f / add;
156
157 const int grain_size = threaded ? 32 : ibufx;
158 threading::parallel_for(IndexRange(ibufx), grain_size, [&](IndexRange range) {
159 for (const int x : range) {
160 const T *src_ptr = src + x;
161 T *dst_ptr = dst + x;
162 float sample = 0.0f;
163 float4 val(0.0f);
164
165 for (int y = 0; y < newy; y++) {
166 float4 nval = -val * sample;
167 sample += add;
168 while (sample >= 1.0f) {
169 sample -= 1.0f;
170 nval += load_pixel(src_ptr);
171 src_ptr += ibufx;
172 }
173
174 val = load_pixel(src_ptr);
175 src_ptr += ibufx;
176
177 float4 pix = (nval + sample * val) * inv_add;
178 store_pixel(pix, dst_ptr);
179 dst_ptr += ibufx;
180
181 sample -= 1.0f;
182 }
183 }
184 });
185 });
186}
187
188template<typename BufferT>
189static void scale_up_x_func(const BufferT *src_buffer,
190 const int2 src_size,
191 const int src_stride,
192 const int channels,
193 BufferT *dst_buffer,
194 const int2 dst_size,
195 bool threaded)
196{
197 const int newx = dst_size.x;
198 const int ibufx = src_size.x;
199 const int ibufy = src_size.y;
200 to_static_pixel_type(src_buffer, channels, dst_buffer, [&]<typename T>(const T *src, T *dst) {
201 const float add = (ibufx - 0.001f) / newx;
202 /* Special case: source is 1px wide (see #70356). */
203 if (ibufx == 1) [[unlikely]] {
204 for (int y = ibufy; y > 0; y--) {
205 for (int x = newx; x > 0; x--) {
206 *dst = *src;
207 dst++;
208 }
209 src += src_stride;
210 }
211 }
212 else {
213 const int grain_size = threaded ? 32 : ibufy;
214 threading::parallel_for(IndexRange(ibufy), grain_size, [&](IndexRange range) {
215 for (const int y : range) {
216 float sample = -0.5f + add * 0.5f;
217 int counter = 0;
218 const T *src_ptr = src + (int64_t(y) * src_stride);
219 T *dst_ptr = dst + (int64_t(y) * newx);
220 float4 val = load_pixel(src_ptr);
221 float4 nval = load_pixel(src_ptr + 1);
222 float4 diff = nval - val;
223 if (ibufx > 2) {
224 src_ptr += 2;
225 counter += 2;
226 }
227 for (int x = 0; x < newx; x++) {
228 if (sample >= 1.0f) {
229 sample -= 1.0f;
230 val = nval;
231 nval = load_pixel(src_ptr);
232 diff = nval - val;
233 if (counter + 1 < ibufx) {
234 src_ptr++;
235 counter++;
236 }
237 }
238 float4 pix = val + math::max(sample, 0.0f) * diff;
239 store_pixel(pix, dst_ptr);
240 dst_ptr++;
241 sample += add;
242 }
243 }
244 });
245 }
246 });
247}
248
249template<typename BufferT>
250static void scale_up_y_func(const BufferT *src_buffer,
251 const int2 src_size,
252 const int channels,
253 BufferT *dst_buffer,
254 const int2 dst_size,
255 bool threaded)
256{
257 const int newy = dst_size.y;
258 const int ibufx = src_size.x;
259 const int ibufy = src_size.y;
260 to_static_pixel_type(src_buffer, channels, dst_buffer, [&]<typename T>(const T *src, T *dst) {
261 const float add = (ibufy - 0.001f) / newy;
262 /* Special case: source is 1px high (see #70356). */
263 if (ibufy == 1) [[unlikely]] {
264 for (int y = newy; y > 0; y--) {
265 memcpy(reinterpret_cast<void *>(dst), src, sizeof(T) * ibufx);
266 dst += ibufx;
267 }
268 }
269 else {
270 const int grain_size = threaded ? 32 : ibufx;
271 threading::parallel_for(IndexRange(ibufx), grain_size, [&](IndexRange range) {
272 for (const int x : range) {
273 float sample = -0.5f + add * 0.5f;
274 int counter = 0;
275 const T *src_ptr = src + x;
276 T *dst_ptr = dst + x;
277
278 float4 val = load_pixel(src_ptr);
279 float4 nval = load_pixel(src_ptr + ibufx);
280 float4 diff = nval - val;
281 if (ibufy > 2) {
282 src_ptr += ibufx * 2;
283 counter += 2;
284 }
285
286 for (int y = 0; y < newy; y++) {
287 if (sample >= 1.0f) {
288 sample -= 1.0f;
289 val = nval;
290 nval = load_pixel(src_ptr);
291 diff = nval - val;
292 if (counter + 1 < ibufy) {
293 src_ptr += ibufx;
294 ++counter;
295 }
296 }
297 float4 pix = val + math::max(sample, 0.0f) * diff;
298 store_pixel(pix, dst_ptr);
299 dst_ptr += ibufx;
300 sample += add;
301 }
302 }
303 });
304 }
305 });
306}
307
308template<typename BufferT>
309static void imb_scale_box(const BufferT *src_buffer,
310 const int2 src_size,
311 const int channels,
312 BufferT *dst_buffer,
313 const int2 dst_size,
314 const bool threaded,
315 const int src_stride = 0)
316{
317 const int stride = (src_stride != 0) ? src_stride : src_size.x;
318 BufferT *tmp_buffer = MEM_new_array_uninitialized<BufferT>(
319 int64_t(channels) * dst_size.x * src_size.y, __func__);
320 if (dst_size.x < src_size.x) {
321 scale_down_x_func(src_buffer,
322 src_size,
323 stride,
324 channels,
325 tmp_buffer,
326 int2(dst_size.x, src_size.y),
327 threaded);
328 }
329 else {
330 scale_up_x_func(src_buffer,
331 src_size,
332 stride,
333 channels,
334 tmp_buffer,
335 int2(dst_size.x, src_size.y),
336 threaded);
337 }
338
339 if (dst_size.y < src_size.y) {
341 tmp_buffer, int2(dst_size.x, src_size.y), channels, dst_buffer, dst_size, threaded);
342 }
343 else {
345 tmp_buffer, int2(dst_size.x, src_size.y), channels, dst_buffer, dst_size, threaded);
346 }
347
348 MEM_delete(tmp_buffer);
349}
350
351void IMB_scale_box(const float *src_buffer,
352 const int2 src_size,
353 const int channels,
354 float *dst_buffer,
355 const int2 dst_size,
356 const bool threaded,
357 const int src_stride)
358{
359 imb_scale_box(src_buffer, src_size, channels, dst_buffer, dst_size, threaded, src_stride);
360}
361
362void IMB_scale_box(const uchar *src_buffer,
363 const int2 src_size,
364 const int channels,
365 uchar *dst_buffer,
366 const int2 dst_size,
367 const bool threaded,
368 const int src_stride)
369{
370 imb_scale_box(src_buffer, src_size, channels, dst_buffer, dst_size, threaded, src_stride);
371}
372
373template<typename T>
374static void scale_nearest(
375 const T *src, T *dst, const int2 src_size, const int2 dst_size, IndexRange y_range)
376{
377 const int ibufx = src_size.x;
378 const int ibufy = src_size.y;
379 const int newx = dst_size.x;
380 const int newy = dst_size.y;
381 /* Nearest sample scaling. Step through pixels in fixed point coordinates. */
382 constexpr int FRAC_BITS = 16;
383 int64_t stepx = ((int64_t(ibufx) << FRAC_BITS) + newx / 2) / newx;
384 int64_t stepy = ((int64_t(ibufy) << FRAC_BITS) + newy / 2) / newy;
385 int64_t posy = y_range.first() * stepy;
386 dst += y_range.first() * newx;
387 for (const int y : y_range) {
388 UNUSED_VARS(y);
389 const T *row = src + (posy >> FRAC_BITS) * ibufx;
390 int64_t posx = 0;
391 for (int x = 0; x < newx; x++, posx += stepx) {
392 *dst = row[posx >> FRAC_BITS];
393 dst++;
394 }
395 posy += stepy;
396 }
397}
398
399template<typename BufferT>
400static void scale_nearest_func(const BufferT *src_buffer,
401 const int2 src_size,
402 const int channels,
403 BufferT *dst_buffer,
404 const int2 dst_size,
405 bool threaded)
406{
407 const int grain_size = threaded ? 64 : dst_size.y;
408 threading::parallel_for(IndexRange(dst_size.y), grain_size, [&](IndexRange y_range) {
409 if constexpr (std::is_same_v<BufferT, uchar>) {
410 const uchar4 *src = reinterpret_cast<const uchar4 *>(src_buffer);
411 scale_nearest(src, reinterpret_cast<uchar4 *>(dst_buffer), src_size, dst_size, y_range);
412 }
413 else {
414 if (channels == 1) {
415 scale_nearest(src_buffer, dst_buffer, src_size, dst_size, y_range);
416 }
417 else if (channels == 2) {
418 const float2 *src = reinterpret_cast<const float2 *>(src_buffer);
419 scale_nearest(src, reinterpret_cast<float2 *>(dst_buffer), src_size, dst_size, y_range);
420 }
421 else if (channels == 3) {
422 const float3 *src = reinterpret_cast<const float3 *>(src_buffer);
423 scale_nearest(src, reinterpret_cast<float3 *>(dst_buffer), src_size, dst_size, y_range);
424 }
425 else if (channels == 4) {
426 const float4 *src = reinterpret_cast<const float4 *>(src_buffer);
427 scale_nearest(src, reinterpret_cast<float4 *>(dst_buffer), src_size, dst_size, y_range);
428 }
429 }
430 });
431}
432
433template<typename BufferT>
434static void scale_bilinear(const BufferT *src_buffer,
435 const int2 src_size,
436 const int channels,
437 BufferT *dst_buffer,
438 const int2 dst_size,
439 bool threaded)
440{
441 const int newx = dst_size.x;
442 const int newy = dst_size.y;
443
444 const int grain_size = threaded ? 32 : newy;
445 threading::parallel_for(IndexRange(newy), grain_size, [&](IndexRange y_range) {
446 float factor_x = float(src_size.x) / newx;
447 float factor_y = float(src_size.y) / newy;
448
449 for (const int y : y_range) {
450 float v = (float(y) + 0.5f) * factor_y - 0.5f;
451 for (int x = 0; x < newx; x++) {
452 float u = (float(x) + 0.5f) * factor_x - 0.5f;
453 int64_t offset = int64_t(y) * newx + x;
454 if constexpr (std::is_same_v<BufferT, uchar>) {
455 *reinterpret_cast<uchar4 *>(dst_buffer + offset * 4) = math::interpolate_bilinear_byte(
456 src_buffer, src_size.x, src_size.y, u, v);
457 }
458 else {
459 float *pixel = dst_buffer + channels * offset;
460 math::interpolate_bilinear_fl(src_buffer, pixel, src_size.x, src_size.y, channels, u, v);
461 }
462 }
463 }
464 });
465}
466
467bool IMB_scale(ImBuf *ibuf, const int2 new_size, IMBScaleFilter filter, bool threaded)
468{
469 BLI_assert_msg(new_size.x > 0 && new_size.y > 0,
470 "Images must be at least 1 on both dimensions!");
471 if (ibuf == nullptr) {
472 return false;
473 }
474 const int2 src_size = int2(ibuf->x, ibuf->y);
475 if (src_size == new_size) {
476 return false;
477 }
478
479 switch (filter) {
481 if (const float *src = ibuf->float_data()) {
483 size_t(ibuf->channels) * new_size.x * new_size.y, __func__);
484 scale_nearest_func(src, src_size, ibuf->channels, dst, new_size, threaded);
485 ibuf->assign_float_data(dst);
486 }
487 if (const uchar *src = ibuf->byte_data()) {
488 uchar *dst = MEM_new_array_uninitialized<uchar>(size_t(new_size.x) * new_size.y * 4,
489 __func__);
490 scale_nearest_func(src, src_size, 4, dst, new_size, threaded);
491 ibuf->assign_byte_data(dst);
492 }
493 break;
494 }
496 if (const float *src = ibuf->float_data()) {
498 size_t(ibuf->channels) * new_size.x * new_size.y, __func__);
499 scale_bilinear(src, src_size, ibuf->channels, dst, new_size, threaded);
500 ibuf->assign_float_data(dst);
501 }
502 if (const uchar *src = ibuf->byte_data()) {
503 uchar *dst = MEM_new_array_uninitialized<uchar>(size_t(new_size.x) * new_size.y * 4,
504 __func__);
505 scale_bilinear(src, src_size, 4, dst, new_size, threaded);
506 ibuf->assign_byte_data(dst);
507 }
508 break;
509 }
510 case IMBScaleFilter::Box: {
511 if (const float *src = ibuf->float_data()) {
513 size_t(ibuf->channels) * new_size.x * new_size.y, __func__);
514 imb_scale_box(src, src_size, ibuf->channels, dst, new_size, threaded);
515 ibuf->assign_float_data(dst);
516 }
517 if (const uchar *src = ibuf->byte_data()) {
518 uchar *dst = MEM_new_array_uninitialized<uchar>(size_t(new_size.x) * new_size.y * 4,
519 __func__);
520 imb_scale_box(src, src_size, 4, dst, new_size, threaded);
521 ibuf->assign_byte_data(dst);
522 }
523 break;
524 }
525 }
526 ibuf->x = new_size.x;
527 ibuf->y = new_size.y;
528 return true;
529}
530
532 const int2 new_size,
534 bool threaded)
535{
536 BLI_assert_msg(new_size.x > 0 && new_size.y > 0,
537 "Images must be at least 1 on both dimensions!");
538 if (ibuf == nullptr) {
539 return nullptr;
540 }
541 /* Size same as source: just copy source image. */
542 const int2 src_size = int2(ibuf->x, ibuf->y);
543 if (src_size == new_size) {
544 return IMB_dupImBuf(ibuf);
545 }
546
547 /* Allocate destination buffers. */
549 if (ibuf->byte_data()) {
550 flags |= ImBufFlags::ByteData;
551 }
552 if (ibuf->float_data()) {
553 flags |= ImBufFlags::FloatData;
554 }
555 ImBuf *dst = IMB_allocImBuf(new_size.x, new_size.y, flags);
556 dst->color_mode = ibuf->color_mode;
557 dst->channels = ibuf->channels;
558 IMB_metadata_copy(dst, ibuf);
559 uchar *dst_byte = dst->byte_data_for_write();
560 float *dst_float = dst->float_data_for_write();
561 if (dst_byte == nullptr && dst_float == nullptr) {
562 IMB_freeImBuf(dst);
563 return nullptr;
564 }
565
566 switch (filter) {
568 if (const float *src = ibuf->float_data()) {
569 scale_nearest_func(src, src_size, ibuf->channels, dst_float, new_size, threaded);
570 }
571 if (const uchar *src = ibuf->byte_data()) {
572 scale_nearest_func(src, src_size, 4, dst_byte, new_size, threaded);
573 }
574 break;
575 }
577 if (const float *src = ibuf->float_data()) {
578 scale_bilinear(src, src_size, ibuf->channels, dst_float, new_size, threaded);
579 }
580 if (const uchar *src = ibuf->byte_data()) {
581 scale_bilinear(src, src_size, 4, dst_byte, new_size, threaded);
582 }
583 break;
584 }
585 case IMBScaleFilter::Box: {
586 if (const float *src = ibuf->float_data()) {
587 imb_scale_box(src, src_size, ibuf->channels, dst_float, new_size, threaded);
588 }
589 if (const uchar *src = ibuf->byte_data()) {
590 imb_scale_box(src, src_size, 4, dst_byte, new_size, threaded);
591 }
592 break;
593 }
594 }
595
598
599 return dst;
600}
601
602} // namespace blender
Function declarations for filter.cc.
Read Blender memory allocation and freeing.
#define UNUSED_VARS(...)
#define BLI_assert_msg(a, msg)
constexpr int64_t first() const
constexpr IndexRange()=default
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt)
Definition frames.inl:1166
#define T
uchar4 interpolate_bilinear_byte(const uchar *buffer, int width, int height, float u, float v)
float4 interpolate_bilinear_fl(const float *buffer, int width, int height, float u, float v)
T max(const T &a, const T &b)
T round(const T &a)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Definition BLI_task.hh:69
BMesh Iterators.
static void scale_nearest_func(const BufferT *src_buffer, const int2 src_size, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:400
VecBase< uint8_t, 4 > uchar4
__int64 int64_t
Definition BKE_text.h:90
static float4 load_pixel(const uchar4 *ptr)
Definition scaling.cc:26
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
static void scale_bilinear(const BufferT *src_buffer, const int2 src_size, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:434
static void scale_nearest(const T *src, T *dst, const int2 src_size, const int2 dst_size, IndexRange y_range)
Definition scaling.cc:374
ATTR_WARN_UNUSED_RESULT const BMVert * v
ImBuf * IMB_dupImBuf(const ImBuf *ibuf1)
static void to_static_pixel_type(const BufferT *src_buffer, const int channels, BufferT *dst_buffer, const Fn &fn)
Definition scaling.cc:68
VecBase< float, 4 > float4
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
unsigned char uchar
Definition BKE_text.h:58
static void scale_down_y_func(const BufferT *src_buffer, const int2 src_size, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:143
static void store_pixel(float4 pix, uchar4 *ptr)
Definition scaling.cc:46
void IMB_scale_box(const float *src_buffer, int2 src_size, int channels, float *dst_buffer, int2 dst_size, bool threaded, int src_stride=0)
Definition scaling.cc:351
static void imb_scale_box(const BufferT *src_buffer, const int2 src_size, const int channels, BufferT *dst_buffer, const int2 dst_size, const bool threaded, const int src_stride=0)
Definition scaling.cc:309
static void scale_up_y_func(const BufferT *src_buffer, const int2 src_size, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:250
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, ImBufFlags flags)
static void scale_down_x_func(const BufferT *src_buffer, const int2 src_size, const int src_stride, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:96
void IMB_metadata_copy(ImBuf *ibuf_dst, const ImBuf *ibuf_src)
VecBase< float, 3 > float3
ImBuf * IMB_scale_into_new(const ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
Definition scaling.cc:531
bool IMB_scale(ImBuf *ibuf, int2 new_size, IMBScaleFilter filter, bool threaded=true)
Definition scaling.cc:467
static void scale_up_x_func(const BufferT *src_buffer, const int2 src_size, const int src_stride, const int channels, BufferT *dst_buffer, const int2 dst_size, bool threaded)
Definition scaling.cc:189
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
const ColorSpace * colorspace
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
const uint8_t * byte_data() const
uint8_t * byte_data_for_write()
Definition allocimbuf.cc:60
const float * float_data() const
ImColorMode color_mode
void assign_byte_data(uint8_t *data)
float * float_data_for_write()
Definition allocimbuf.cc:79
void assign_float_data(float *data)