Blender  V2.93
Public Member Functions | List of all members
blender::compositor::MemoryBuffer Class Reference

a MemoryBuffer contains access to the data of a chunk More...

#include <COM_MemoryBuffer.h>

Public Member Functions

 MemoryBuffer (MemoryProxy *memoryProxy, const rcti &rect, MemoryBufferState state)
 construct new temporarily MemoryBuffer for an area More...
 
 MemoryBuffer (DataType datatype, const rcti &rect)
 construct new temporarily MemoryBuffer for an area More...
 
 MemoryBuffer (const MemoryBuffer &src)
 
 ~MemoryBuffer ()
 destructor More...
 
uint8_t get_num_channels ()
 
floatgetBuffer ()
 get the data of this MemoryBuffer More...
 
void wrap_pixel (int &x, int &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
 
void wrap_pixel (float &x, float &y, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
 
void read (float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
 
void readNoCheck (float *result, int x, int y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
 
void writePixel (int x, int y, const float color[4])
 
void addPixel (int x, int y, const float color[4])
 
void readBilinear (float *result, float x, float y, MemoryBufferExtend extend_x=MemoryBufferExtend::Clip, MemoryBufferExtend extend_y=MemoryBufferExtend::Clip)
 
void readEWA (float *result, const float uv[2], const float derivatives[2][2])
 
bool isTemporarily () const
 is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk) More...
 
void fill_from (const MemoryBuffer &src)
 add the content from otherBuffer to this MemoryBuffer More...
 
const rctiget_rect () const
 get the rect of this MemoryBuffer More...
 
const int getWidth () const
 get the width of this MemoryBuffer More...
 
const int getHeight () const
 get the height of this MemoryBuffer More...
 
void clear ()
 clear the buffer. Make all pixels black transparent. More...
 
float get_max_value () const
 
float get_max_value (const rcti &rect) const
 

Detailed Description

a MemoryBuffer contains access to the data of a chunk

Definition at line 52 of file COM_MemoryBuffer.h.

Constructor & Destructor Documentation

◆ MemoryBuffer() [1/3]

blender::compositor::MemoryBuffer::MemoryBuffer ( MemoryProxy memoryProxy,
const rcti rect,
MemoryBufferState  state 
)

◆ MemoryBuffer() [2/3]

blender::compositor::MemoryBuffer::MemoryBuffer ( DataType  datatype,
const rcti rect 
)

construct new temporarily MemoryBuffer for an area

Definition at line 36 of file COM_MemoryBuffer.cc.

References blender::compositor::COM_data_type_num_channels(), MEM_mallocN_aligned, and blender::compositor::Temporary.

◆ MemoryBuffer() [3/3]

blender::compositor::MemoryBuffer::MemoryBuffer ( const MemoryBuffer src)

Copy constructor

Definition at line 47 of file COM_MemoryBuffer.cc.

References blender::compositor::Temporary.

◆ ~MemoryBuffer()

blender::compositor::MemoryBuffer::~MemoryBuffer ( )

destructor

Definition at line 93 of file COM_MemoryBuffer.cc.

References MEM_freeN.

Member Function Documentation

◆ addPixel()

void blender::compositor::MemoryBuffer::addPixel ( int  x,
int  y,
const float  color[4] 
)

◆ clear()

void blender::compositor::MemoryBuffer::clear ( )

clear the buffer. Make all pixels black transparent.

Definition at line 53 of file COM_MemoryBuffer.cc.

Referenced by blender::compositor::GlareStreaksOperation::generateGlare().

◆ fill_from()

void blender::compositor::MemoryBuffer::fill_from ( const MemoryBuffer src)

add the content from otherBuffer to this MemoryBuffer

Parameters
otherBuffersource buffer
Note
take care when running this on a new buffer since it wont fill in uninitialized values in areas where the buffers don't overlap.

Definition at line 101 of file COM_MemoryBuffer.cc.

References getWidth(), MAX2, MIN2, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by blender::compositor::WriteBufferOperation::executeOpenCLRegion(), and get_max_value().

◆ get_max_value() [1/2]

float blender::compositor::MemoryBuffer::get_max_value ( ) const

◆ get_max_value() [2/2]

float blender::compositor::MemoryBuffer::get_max_value ( const rcti rect) const

◆ get_num_channels()

uint8_t blender::compositor::MemoryBuffer::get_num_channels ( )
inline

◆ get_rect()

const rcti& blender::compositor::MemoryBuffer::get_rect ( ) const
inline

◆ getBuffer()

float* blender::compositor::MemoryBuffer::getBuffer ( )
inline

get the data of this MemoryBuffer

Note
buffer should already be available in memory

Definition at line 115 of file COM_MemoryBuffer.h.

Referenced by blender::compositor::CalculateMeanOperation::calculateMean(), blender::compositor::convolve(), blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::eval(), blender::compositor::WriteBufferOperation::executeOpenCLRegion(), blender::compositor::AntiAliasOperation::executePixel(), blender::compositor::BokehBlurOperation::executePixel(), blender::compositor::DilateErodeThresholdOperation::executePixel(), blender::compositor::DilateDistanceOperation::executePixel(), blender::compositor::ErodeDistanceOperation::executePixel(), blender::compositor::GaussianAlphaXBlurOperation::executePixel(), blender::compositor::GaussianAlphaYBlurOperation::executePixel(), blender::compositor::GaussianBokehBlurOperation::executePixel(), blender::compositor::GaussianBlurReferenceOperation::executePixel(), blender::compositor::GaussianXBlurOperation::executePixel(), blender::compositor::GaussianYBlurOperation::executePixel(), blender::compositor::IDMaskOperation::executePixel(), blender::compositor::KeyingBlurOperation::executePixel(), blender::compositor::KeyingClipOperation::executePixel(), blender::compositor::VariableSizeBokehBlurOperation::executePixel(), blender::compositor::WriteBufferOperation::executeRegion(), blender::compositor::DenoiseOperation::generateDenoise(), blender::compositor::GlareGhostOperation::generateGlare(), blender::compositor::GlareSimpleStarOperation::generateGlare(), blender::compositor::GlareStreaksOperation::generateGlare(), blender::compositor::VectorBlurOperation::generateVectorBlur(), blender::compositor::FastGaussianBlurOperation::IIR_gauss(), blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::init_buffer_iterator(), blender::compositor::CalculateStandardDeviationOperation::initializeTileData(), blender::compositor::DilateStepOperation::initializeTileData(), blender::compositor::ErodeStepOperation::initializeTileData(), blender::compositor::DoubleEdgeMaskOperation::initializeTileData(), blender::compositor::FastGaussianBlurValueOperation::initializeTileData(), blender::compositor::InpaintSimpleOperation::initializeTileData(), blender::compositor::NormalizeOperation::initializeTileData(), blender::compositor::TonemapOperation::initializeTileData(), and blender::compositor::VectorBlurOperation::initializeTileData().

◆ getHeight()

const int blender::compositor::MemoryBuffer::getHeight ( ) const
inline

◆ getWidth()

const int blender::compositor::MemoryBuffer::getWidth ( ) const
inline

get the width of this MemoryBuffer

Definition at line 302 of file COM_MemoryBuffer.h.

References BLI_rcti_size_x().

Referenced by addPixel(), blender::compositor::CalculateMeanOperation::calculateMean(), blender::compositor::OpenCLDevice::COM_clEnqueueRange(), blender::compositor::convolve(), blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::eval(), blender::compositor::WriteBufferOperation::executeOpenCLRegion(), blender::compositor::AntiAliasOperation::executePixel(), blender::compositor::BokehBlurOperation::executePixel(), blender::compositor::DilateErodeThresholdOperation::executePixel(), blender::compositor::DilateDistanceOperation::executePixel(), blender::compositor::ErodeDistanceOperation::executePixel(), blender::compositor::GaussianAlphaXBlurOperation::executePixel(), blender::compositor::GaussianAlphaYBlurOperation::executePixel(), blender::compositor::GaussianBokehBlurOperation::executePixel(), blender::compositor::GaussianXBlurOperation::executePixel(), blender::compositor::GaussianYBlurOperation::executePixel(), blender::compositor::IDMaskOperation::executePixel(), blender::compositor::KeyingBlurOperation::executePixel(), blender::compositor::KeyingClipOperation::executePixel(), blender::compositor::VariableSizeBokehBlurOperation::executePixel(), blender::compositor::WriteBufferOperation::executeRegion(), fill_from(), blender::compositor::DenoiseOperation::generateDenoise(), blender::compositor::GlareGhostOperation::generateGlare(), blender::compositor::GlareStreaksOperation::generateGlare(), blender::compositor::FastGaussianBlurOperation::IIR_gauss(), blender::compositor::BufferLineAccumulator< fxu, fxv, fyu, fyv >::init_buffer_iterator(), blender::compositor::CalculateStandardDeviationOperation::initializeTileData(), blender::compositor::DilateStepOperation::initializeTileData(), blender::compositor::ErodeStepOperation::initializeTileData(), blender::compositor::NormalizeOperation::initializeTileData(), blender::compositor::TonemapOperation::initializeTileData(), read(), readBilinear(), readEWA(), readNoCheck(), wrap_pixel(), and writePixel().

◆ isTemporarily()

bool blender::compositor::MemoryBuffer::isTemporarily ( ) const
inline

is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk)

Definition at line 277 of file COM_MemoryBuffer.h.

References blender::compositor::Temporary.

◆ read()

void blender::compositor::MemoryBuffer::read ( float result,
int  x,
int  y,
MemoryBufferExtend  extend_x = MemoryBufferExtend::Clip,
MemoryBufferExtend  extend_y = MemoryBufferExtend::Clip 
)
inline

◆ readBilinear()

void blender::compositor::MemoryBuffer::readBilinear ( float result,
float  x,
float  y,
MemoryBufferExtend  extend_x = MemoryBufferExtend::Clip,
MemoryBufferExtend  extend_y = MemoryBufferExtend::Clip 
)
inline

◆ readEWA()

void blender::compositor::MemoryBuffer::readEWA ( float result,
const float  uv[2],
const float  derivatives[2][2] 
)

◆ readNoCheck()

void blender::compositor::MemoryBuffer::readNoCheck ( float result,
int  x,
int  y,
MemoryBufferExtend  extend_x = MemoryBufferExtend::Clip,
MemoryBufferExtend  extend_y = MemoryBufferExtend::Clip 
)
inline

◆ wrap_pixel() [1/2]

void blender::compositor::MemoryBuffer::wrap_pixel ( float x,
float y,
MemoryBufferExtend  extend_x,
MemoryBufferExtend  extend_y 
)
inline

◆ wrap_pixel() [2/2]

void blender::compositor::MemoryBuffer::wrap_pixel ( int &  x,
int &  y,
MemoryBufferExtend  extend_x,
MemoryBufferExtend  extend_y 
)
inline

◆ writePixel()

void blender::compositor::MemoryBuffer::writePixel ( int  x,
int  y,
const float  color[4] 
)

The documentation for this class was generated from the following files: