Blender  V3.3
Classes | Namespaces | Functions
transform.cc File Reference
#include <array>
#include <type_traits>
#include "BLI_math.h"
#include "BLI_rect.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"

Go to the source code of this file.

Classes

struct  blender::imbuf::transform::TransformUserData
 
class  blender::imbuf::transform::BaseDiscard
 Base class for source discarding. More...
 
class  blender::imbuf::transform::CropSource
 Crop uv-coordinates that are outside the user data src_crop rect. More...
 
class  blender::imbuf::transform::NoDiscard
 Discard that does not discard anything. More...
 
class  blender::imbuf::transform::PixelPointer< StorageType, NumChannels >
 Pointer to a pixel to write to in serial. More...
 
class  blender::imbuf::transform::BaseUVWrapping
 Wrapping mode for the uv coordinates. More...
 
class  blender::imbuf::transform::PassThroughUV
 UVWrapping method that does not modify the UV coordinates. More...
 
class  blender::imbuf::transform::WrapRepeatUV
 UVWrapping method that wrap repeats the UV coordinates. More...
 
class  blender::imbuf::transform::Sampler< Filter, StorageType, NumChannels, UVWrapping >
 Read a sample from an image buffer. More...
 
class  blender::imbuf::transform::ChannelConverter< StorageType, SourceNumChannels, DestinationNumChannels >
 Change the number of channels and store it. More...
 
class  blender::imbuf::transform::ScanlineProcessor< Discard, Sampler, OutputPixelPointer >
 Processor for a scanline. More...
 

Namespaces

 blender
 
 blender::imbuf
 
 blender::imbuf::transform
 

Functions

template<typename Processor >
void blender::imbuf::transform::transform_scanline_function (void *custom_data, int scanline)
 callback function for threaded transformation. More...
 
template<eIMBInterpolationFilterMode Filter, typename StorageType , int SourceNumChannels, int DestinationNumChannels>
ScanlineThreadFunc blender::imbuf::transform::get_scanline_function (const eIMBTransformMode mode)
 
template<eIMBInterpolationFilterMode Filter>
ScanlineThreadFunc blender::imbuf::transform::get_scanline_function (const TransformUserData *user_data, const eIMBTransformMode mode)
 
template<eIMBInterpolationFilterMode Filter>
static void blender::imbuf::transform::transform_threaded (TransformUserData *user_data, const eIMBTransformMode mode)
 
void IMB_transform (const struct ImBuf *src, struct ImBuf *dst, const eIMBTransformMode mode, const eIMBInterpolationFilterMode filter, const float transform_matrix[4][4], const struct rctf *src_crop)
 Transform source image buffer onto destination image buffer using a transform matrix. More...
 

Function Documentation

◆ IMB_transform()

void IMB_transform ( const struct ImBuf src,
struct ImBuf dst,
eIMBTransformMode  mode,
eIMBInterpolationFilterMode  filter,
const float  transform_matrix[4][4],
const struct rctf src_crop 
)

Transform source image buffer onto destination image buffer using a transform matrix.

Parameters
srcImage buffer to read from.
dstImage buffer to write to. rect or rect_float must already be initialized.
  • dst buffer must be a 4 channel buffers.
  • Only one data type buffer will be used (rect_float has priority over rect)
modeCropping/Wrap repeat effect to apply during transformation.
filterInterpolation to use during sampling.
transform_matrixTransformation matrix to use. The given matrix should transform between dst pixel space to src pixel space. One unit is one pixel.
src_cropCropping region how to crop the source buffer. Should only be passed when mode is set to IMB_TRANSFORM_MODE_CROP_SRC. For any other mode this should be empty.

During transformation no data/color conversion will happens. When transforming between float images the number of channels of the source buffer may be between 1 and 4. When source buffer has one channel the data will be read as a gray scale value.

Definition at line 569 of file transform.cc.

References BLI_assert_msg, filter(), IMB_FILTER_NEAREST, IMB_TRANSFORM_MODE_CROP_SRC, src, and user_data.

Referenced by sequencer_preprocess_transform_crop(), and sequencer_thumbnail_transform().