Blender V5.0
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
8
9#include "BLI_math_color.h"
10
12#include "IMB_interp.hh"
13
14void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, float scene_linear_rgb[3])
15{
16 using namespace blender;
17 if (ibuf->float_buffer.data) {
18 float rgba[4];
20 premul_to_straight_v4_v4(rgba, rgba);
21 copy_v3_v3(scene_linear_rgb, rgba);
22 }
23 else {
25 rgb_uchar_to_float(scene_linear_rgb, byte_color);
28 }
29}
MINLINE void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
MINLINE void premul_to_straight_v4_v4(float straight[4], const float premul[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], const ColorSpace *colorspace)
void IMB_sampleImageAtLocation(ImBuf *ibuf, float x, float y, float scene_linear_rgb[3])
Definition interp.cc:14
float4 interpolate_nearest_border_fl(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:27
uchar4 interpolate_nearest_border_byte(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:23
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer