Blender
V4.3
source
blender
imbuf
intern
interp.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#include "
BLI_math_vector.h
"
10
#include "
IMB_colormanagement.hh
"
11
#include "
IMB_interp.hh
"
12
13
void
IMB_sampleImageAtLocation
(
ImBuf
*ibuf,
float
x,
float
y,
bool
make_linear_rgb,
float
color[4])
14
{
15
using namespace
blender
;
16
if
(ibuf->
float_buffer
.
data
) {
17
imbuf::interpolate_nearest_border_fl(ibuf, color, x, y);
18
}
19
else
{
20
uchar4
byte_color = imbuf::interpolate_nearest_border_byte(ibuf, x, y);
21
rgba_uchar_to_float
(color, byte_color);
22
if
(make_linear_rgb) {
23
IMB_colormanagement_colorspace_to_scene_linear_v4
(
24
color,
false
, ibuf->
byte_buffer
.
colorspace
);
25
}
26
}
27
}
rgba_uchar_to_float
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
Definition
math_color.cc:409
BLI_math_vector.h
IMB_colormanagement.hh
IMB_colormanagement_colorspace_to_scene_linear_v4
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, ColorSpace *colorspace)
Definition
colormanagement.cc:2291
IMB_interp.hh
IMB_sampleImageAtLocation
void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4])
Definition
interp.cc:13
blender
Definition
ANIM_action.hh:36
ImBufByteBuffer::colorspace
ColorSpace * colorspace
Definition
IMB_imbuf_types.hh:159
ImBufFloatBuffer::data
float * data
Definition
IMB_imbuf_types.hh:163
ImBuf
Definition
IMB_imbuf_types.hh:185
ImBuf::float_buffer
ImBufFloatBuffer float_buffer
Definition
IMB_imbuf_types.hh:218
ImBuf::byte_buffer
ImBufByteBuffer byte_buffer
Definition
IMB_imbuf_types.hh:209
uchar4
Definition
types_uchar4.h:14
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0