Blender V4.5
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
10#include "IMB_interp.hh"
11
12void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4])
13{
14 using namespace blender;
15 if (ibuf->float_buffer.data) {
16 imbuf::interpolate_nearest_border_fl(ibuf, color, x, y);
17 }
18 else {
19 uchar4 byte_color = imbuf::interpolate_nearest_border_byte(ibuf, x, y);
20 rgba_uchar_to_float(color, byte_color);
21 if (make_linear_rgb) {
23 color, false, ibuf->byte_buffer.colorspace);
24 }
25 }
26}
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], bool predivide, const ColorSpace *colorspace)
void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, bool make_linear_rgb, float color[4])
Definition interp.cc:12
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer