Blender V4.3
blender::imbuf Namespace Reference

Namespaces

namespace  tests
 
namespace  transform
 

Classes

class  ImBufMemWriter
 
struct  ReadContext
 
struct  WriteContext
 

Functions

uchar4 interpolate_nearest_border_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_nearest_border_fl (const ImBuf *in, float u, float v)
 
void interpolate_nearest_border_byte (const ImBuf *in, uchar output[4], float u, float v)
 
void interpolate_nearest_border_fl (const ImBuf *in, float output[4], float u, float v)
 
uchar4 interpolate_nearest_wrap_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_nearest_wrap_fl (const ImBuf *in, float u, float v)
 
uchar4 interpolate_bilinear_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_bilinear_fl (const ImBuf *in, float u, float v)
 
void interpolate_bilinear_byte (const ImBuf *in, uchar output[4], float u, float v)
 
void interpolate_bilinear_fl (const ImBuf *in, float output[4], float u, float v)
 
uchar4 interpolate_bilinear_border_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_bilinear_border_fl (const ImBuf *in, float u, float v)
 
void interpolate_bilinear_border_byte (const ImBuf *in, uchar output[4], float u, float v)
 
void interpolate_bilinear_border_fl (const ImBuf *in, float output[4], float u, float v)
 
uchar4 interpolate_bilinear_wrap_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_bilinear_wrap_fl (const ImBuf *in, float u, float v)
 
uchar4 interpolate_cubic_bspline_byte (const ImBuf *in, float u, float v)
 
float4 interpolate_cubic_bspline_fl (const ImBuf *in, float u, float v)
 
void interpolate_cubic_bspline_byte (const ImBuf *in, uchar output[4], float u, float v)
 
void interpolate_cubic_bspline_fl (const ImBuf *in, float output[4], float u, float v)
 
uchar4 interpolate_cubic_mitchell_byte (const ImBuf *in, float u, float v)
 
void interpolate_cubic_mitchell_byte (const ImBuf *in, uchar output[4], float u, float v)
 
template<typename T >
static void fill_all_channels (T *pixels, int width, int height, int components, T alpha)
 
template<typename T >
static ImBufload_pixels (ImageInput *in, int width, int height, int channels, int flags, bool use_all_planes)
 
static void set_colorspace_name (char colorspace[IM_MAX_SPACE], const ReadContext &ctx, const ImageSpec &spec, bool is_float)
 
static ImBufget_oiio_ibuf (ImageInput *in, const ReadContext &ctx, char colorspace[IM_MAX_SPACE])
 
static unique_ptr< ImageInput > get_oiio_reader (const char *format, const ImageSpec &config, Filesystem::IOMemReader &mem_reader, ImageSpec &r_newspec)
 
bool imb_oiio_check (const uchar *mem, size_t mem_size, const char *file_format)
 
ImBufimb_oiio_read (const ReadContext &ctx, const ImageSpec &config, char colorspace[IM_MAX_SPACE], ImageSpec &r_newspec)
 
bool imb_oiio_write (const WriteContext &ctx, const char *filepath, const ImageSpec &file_spec)
 
WriteContext imb_create_write_context (const char *file_format, ImBuf *ibuf, int flags, bool prefer_float)
 
ImageSpec imb_create_write_spec (const WriteContext &ctx, int file_channels, TypeDesc data_format)
 
ImBufimb_oiio_read (const ReadContext &ctx, const OIIO::ImageSpec &config, char colorspace[IM_MAX_SPACE], OIIO::ImageSpec &r_newspec)
 
bool imb_oiio_write (const WriteContext &ctx, const char *filepath, const OIIO::ImageSpec &file_spec)
 
OIIO::ImageSpec imb_create_write_spec (const WriteContext &ctx, int file_channels, OIIO::TypeDesc data_format)
 

Function Documentation

◆ fill_all_channels()

template<typename T >
static void blender::imbuf::fill_all_channels ( T * pixels,
int width,
int height,
int components,
T alpha )
static

Definition at line 73 of file openimageio_support.cc.

Referenced by load_pixels().

◆ get_oiio_ibuf()

static ImBuf * blender::imbuf::get_oiio_ibuf ( ImageInput * in,
const ReadContext & ctx,
char colorspace[IM_MAX_SPACE] )
static

◆ get_oiio_reader()

static unique_ptr< ImageInput > blender::imbuf::get_oiio_reader ( const char * format,
const ImageSpec & config,
Filesystem::IOMemReader & mem_reader,
ImageSpec & r_newspec )
static

Returns an #ImageInput for the precise format requested using the provided #IOMemReader. If successful, the #ImageInput will be opened and ready for operations. Null will be returned if the format was not found or if the open call fails.

Definition at line 246 of file openimageio_support.cc.

Referenced by imb_oiio_read().

◆ imb_create_write_context()

WriteContext blender::imbuf::imb_create_write_context ( const char * file_format,
ImBuf * ibuf,
int flags,
bool prefer_float = true )

Create a #WriteContext based on the provided ImBuf and format information.

If the provided ImBuf contains both byte and float buffers, the prefer_float flag controls which buffer to use. By default, if a float buffer exists it will be used.

Definition at line 351 of file openimageio_support.cc.

References ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::data, ImBufFloatBuffer::data, blender::imbuf::WriteContext::file_format, ImBuf::flags, float, ImBuf::float_buffer, ImBuf::x, and ImBuf::y.

Referenced by imb_save_bmp(), imb_save_dpx(), imb_save_hdr(), imb_save_png(), imb_save_tga(), and imb_save_tiff().

◆ imb_create_write_spec() [1/2]

OIIO::ImageSpec blender::imbuf::imb_create_write_spec ( const WriteContext & ctx,
int file_channels,
OIIO::TypeDesc data_format )

Returns an #ImageSpec filled in with all common attributes associated with the ImBuf provided as part of the #WriteContext.

This includes optional metadata that has been attached to the ImBuf and which should be written to the new file as necessary.

Definition at line 385 of file openimageio_support.cc.

References IDProperty::data, blender::imbuf::WriteContext::file_format, IDPropertyData::group, blender::imbuf::WriteContext::ibuf, IDP_STRING, IDP_String, LISTBASE_FOREACH, ImBuf::metadata, ImBuf::ppm, STREQ, ImBuf::x, and ImBuf::y.

Referenced by imb_save_bmp(), imb_save_dpx(), imb_save_hdr(), imb_save_png(), imb_save_tga(), and imb_save_tiff().

◆ imb_create_write_spec() [2/2]

ImageSpec blender::imbuf::imb_create_write_spec ( const WriteContext & ctx,
int file_channels,
OIIO::TypeDesc data_format )

Returns an #ImageSpec filled in with all common attributes associated with the ImBuf provided as part of the #WriteContext.

This includes optional metadata that has been attached to the ImBuf and which should be written to the new file as necessary.

Definition at line 385 of file openimageio_support.cc.

References IDProperty::data, blender::imbuf::WriteContext::file_format, IDPropertyData::group, blender::imbuf::WriteContext::ibuf, IDP_STRING, IDP_String, LISTBASE_FOREACH, ImBuf::metadata, ImBuf::ppm, STREQ, ImBuf::x, and ImBuf::y.

Referenced by imb_save_bmp(), imb_save_dpx(), imb_save_hdr(), imb_save_png(), imb_save_tga(), and imb_save_tiff().

◆ imb_oiio_check()

bool blender::imbuf::imb_oiio_check ( const uchar * mem,
size_t mem_size,
const char * file_format )

Check to see if we can load and open the given file format.

Definition at line 267 of file openimageio_support.cc.

Referenced by imb_is_a_bmp(), imb_is_a_dds(), imb_is_a_dpx(), imb_is_a_hdr(), imb_is_a_png(), imb_is_a_psd(), imb_is_a_tga(), and imb_is_a_tiff().

◆ imb_oiio_read() [1/2]

ImBuf * blender::imbuf::imb_oiio_read ( const ReadContext & ctx,
const ImageSpec & config,
char colorspace[IM_MAX_SPACE],
ImageSpec & r_newspec )

◆ imb_oiio_read() [2/2]

ImBuf * blender::imbuf::imb_oiio_read ( const ReadContext & ctx,
const OIIO::ImageSpec & config,
char colorspace[IM_MAX_SPACE],
OIIO::ImageSpec & r_newspec )

The primary method for reading data into an ImBuf.

During the IB_test phase of loading, the colorspace parameter will be populated with the appropriate colorspace name.

Upon return, the r_newspec parameter will contain image format information which can be inspected afterwards if necessary.

◆ imb_oiio_write() [1/2]

◆ imb_oiio_write() [2/2]

bool blender::imbuf::imb_oiio_write ( const WriteContext & ctx,
const char * filepath,
const OIIO::ImageSpec & file_spec )

The primary method for writing data from an ImBuf to either a physical or in-memory destination.

The file_spec parameter will typically come from imb_create_write_spec.

◆ interpolate_bilinear_border_byte() [1/2]

uchar4 blender::imbuf::interpolate_bilinear_border_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_bilinear_border_byte() [2/2]

void blender::imbuf::interpolate_bilinear_border_byte ( const ImBuf * in,
uchar output[4],
float u,
float v )
inline

Definition at line 82 of file IMB_interp.hh.

References col, blender::math::interpolate_bilinear_border_byte(), and v.

◆ interpolate_bilinear_border_fl() [1/2]

void blender::imbuf::interpolate_bilinear_border_fl ( const ImBuf * in,
float output[4],
float u,
float v )
inline

Definition at line 87 of file IMB_interp.hh.

References col, blender::math::interpolate_bilinear_border_fl(), and v.

◆ interpolate_bilinear_border_fl() [2/2]

float4 blender::imbuf::interpolate_bilinear_border_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_bilinear_byte() [1/2]

uchar4 blender::imbuf::interpolate_bilinear_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 53 of file IMB_interp.hh.

References blender::math::interpolate_bilinear_byte(), and v.

Referenced by blender::imbuf::transform::sample_image().

◆ interpolate_bilinear_byte() [2/2]

void blender::imbuf::interpolate_bilinear_byte ( const ImBuf * in,
uchar output[4],
float u,
float v )
inline

Definition at line 61 of file IMB_interp.hh.

References col, blender::math::interpolate_bilinear_byte(), and v.

◆ interpolate_bilinear_fl() [1/2]

void blender::imbuf::interpolate_bilinear_fl ( const ImBuf * in,
float output[4],
float u,
float v )
inline

Definition at line 66 of file IMB_interp.hh.

References col, blender::math::interpolate_bilinear_fl(), and v.

◆ interpolate_bilinear_fl() [2/2]

float4 blender::imbuf::interpolate_bilinear_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 57 of file IMB_interp.hh.

References blender::math::interpolate_bilinear_fl(), and v.

Referenced by blender::imbuf::transform::sample_image().

◆ interpolate_bilinear_wrap_byte()

uchar4 blender::imbuf::interpolate_bilinear_wrap_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 95 of file IMB_interp.hh.

References blender::math::interpolate_bilinear_wrap_byte(), and v.

◆ interpolate_bilinear_wrap_fl()

float4 blender::imbuf::interpolate_bilinear_wrap_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 99 of file IMB_interp.hh.

References blender::math::interpolate_bilinear_wrap_fl(), and v.

◆ interpolate_cubic_bspline_byte() [1/2]

uchar4 blender::imbuf::interpolate_cubic_bspline_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_cubic_bspline_byte() [2/2]

void blender::imbuf::interpolate_cubic_bspline_byte ( const ImBuf * in,
uchar output[4],
float u,
float v )
inline

Definition at line 114 of file IMB_interp.hh.

References col, blender::math::interpolate_cubic_bspline_byte(), and v.

◆ interpolate_cubic_bspline_fl() [1/2]

void blender::imbuf::interpolate_cubic_bspline_fl ( const ImBuf * in,
float output[4],
float u,
float v )
inline

Definition at line 119 of file IMB_interp.hh.

References col, blender::math::interpolate_cubic_bspline_fl(), and v.

◆ interpolate_cubic_bspline_fl() [2/2]

float4 blender::imbuf::interpolate_cubic_bspline_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 110 of file IMB_interp.hh.

References blender::math::interpolate_cubic_bspline_fl(), and v.

Referenced by do_projectpaint_thread(), and transform_image().

◆ interpolate_cubic_mitchell_byte() [1/2]

uchar4 blender::imbuf::interpolate_cubic_mitchell_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_cubic_mitchell_byte() [2/2]

void blender::imbuf::interpolate_cubic_mitchell_byte ( const ImBuf * in,
uchar output[4],
float u,
float v )
inline

Definition at line 131 of file IMB_interp.hh.

References col, blender::math::interpolate_cubic_mitchell_byte(), and v.

◆ interpolate_nearest_border_byte() [1/2]

uchar4 blender::imbuf::interpolate_nearest_border_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_nearest_border_byte() [2/2]

void blender::imbuf::interpolate_nearest_border_byte ( const ImBuf * in,
uchar output[4],
float u,
float v )
inline

Definition at line 31 of file IMB_interp.hh.

References blender::math::interpolate_nearest_border_byte(), and v.

◆ interpolate_nearest_border_fl() [1/2]

void blender::imbuf::interpolate_nearest_border_fl ( const ImBuf * in,
float output[4],
float u,
float v )
inline

Definition at line 35 of file IMB_interp.hh.

References blender::math::interpolate_nearest_border_fl(), and v.

◆ interpolate_nearest_border_fl() [2/2]

float4 blender::imbuf::interpolate_nearest_border_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

◆ interpolate_nearest_wrap_byte()

uchar4 blender::imbuf::interpolate_nearest_wrap_byte ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 42 of file IMB_interp.hh.

References blender::math::interpolate_nearest_wrap_byte(), and v.

◆ interpolate_nearest_wrap_fl()

float4 blender::imbuf::interpolate_nearest_wrap_fl ( const ImBuf * in,
float u,
float v )
inlinenodiscard

Definition at line 46 of file IMB_interp.hh.

References blender::math::interpolate_nearest_wrap_fl(), and v.

◆ load_pixels()

template<typename T >
static ImBuf * blender::imbuf::load_pixels ( ImageInput * in,
int width,
int height,
int channels,
int flags,
bool use_all_planes )
static

◆ set_colorspace_name()

static void blender::imbuf::set_colorspace_name ( char colorspace[IM_MAX_SPACE],
const ReadContext & ctx,
const ImageSpec & spec,
bool is_float )
static