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

The BokehImageOperation class is an operation that creates an image useful to mimic the internals of a camera. More...

#include <COM_BokehImageOperation.h>

Inherits blender::compositor::NodeOperation.

Public Member Functions

 BokehImageOperation ()
 
void executePixelSampled (float output[4], float x, float y, PixelSampler sampler) override
 The inner loop of this operation. More...
 
void initExecution () override
 Initialize the execution. More...
 
void deinitExecution () override
 Deinitialize the execution. More...
 
void determineResolution (unsigned int resolution[2], unsigned int preferredResolution[2]) override
 determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS] More...
 
void setData (NodeBokehImage *data)
 set the node data More...
 
void deleteDataOnFinish ()
 deleteDataOnFinish More...
 
- Public Member Functions inherited from blender::compositor::NodeOperation
virtual ~NodeOperation ()
 
void set_name (const std::string name)
 
const std::string get_name () const
 
void set_id (const int id)
 
const int get_id () const
 
const NodeOperationFlags get_flags () const
 
unsigned int getNumberOfInputSockets () const
 
unsigned int getNumberOfOutputSockets () const
 
NodeOperationOutputgetOutputSocket (unsigned int index=0)
 
NodeOperationInputgetInputSocket (unsigned int index)
 
virtual bool isOutputOperation (bool) const
 isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing. More...
 
void setbNodeTree (const bNodeTree *tree)
 
virtual void executeRegion (rcti *, unsigned int)
 when a chunk is executed by a CPUDevice, this method is called More...
 
virtual void executeOpenCLRegion (OpenCLDevice *, rcti *, unsigned int, MemoryBuffer **, MemoryBuffer *)
 when a chunk is executed by an OpenCLDevice, this method is called More...
 
virtual void executeOpenCL (OpenCLDevice *, MemoryBuffer *, cl_mem, MemoryBuffer **, std::list< cl_mem > *, std::list< cl_kernel > *)
 custom handle to add new tasks to the OpenCL command queue in order to execute a chunk on an GPUDevice. More...
 
void setResolution (unsigned int resolution[2])
 set the resolution More...
 
virtual bool isActiveViewerOutput () const
 is this operation the active viewer output user can select an ViewerNode to be active (the result of this node will be drawn on the backdrop). More...
 
virtual bool determineDependingAreaOfInterest (rcti *input, ReadBufferOperation *readOperation, rcti *output)
 
void setResolutionInputSocketIndex (unsigned int index)
 set the index of the input socket that will determine the resolution of this operation More...
 
virtual eCompositorPriority getRenderPriority () const
 get the render priority of this node. More...
 
bool isBraked () const
 
void updateDraw ()
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
void readSampled (float result[4], float x, float y, PixelSampler sampler)
 
void readFiltered (float result[4], float x, float y, float dx[2], float dy[2])
 
void read (float result[4], int x, int y, void *chunkData)
 
virtual void * initializeTileData (rcti *)
 
virtual void deinitializeTileData (rcti *, void *)
 
virtual MemoryBuffergetInputMemoryBuffer (MemoryBuffer **)
 
virtual std::unique_ptr< MetaDatagetMetaData ()
 

Additional Inherited Members

- Protected Member Functions inherited from blender::compositor::NodeOperation
 NodeOperation ()
 
void addInputSocket (DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
 
void addOutputSocket (DataType datatype)
 
void setWidth (unsigned int width)
 
void setHeight (unsigned int height)
 
SocketReadergetInputSocketReader (unsigned int inputSocketindex)
 
NodeOperationgetInputOperation (unsigned int inputSocketindex)
 
void deinitMutex ()
 
void initMutex ()
 
void lockMutex ()
 
void unlockMutex ()
 
void setComplex (bool complex)
 set whether this operation is complex More...
 
virtual void executePixel (float output[4], int x, int y, void *)
 calculate a single pixel More...
 
virtual void executePixelFiltered (float[4], float, float, float[2], float[2])
 calculate a single pixel using an EWA filter More...
 
- Protected Attributes inherited from blender::compositor::NodeOperation
unsigned int m_width
 
unsigned int m_height
 
NodeOperationFlags flags
 

Detailed Description

The BokehImageOperation class is an operation that creates an image useful to mimic the internals of a camera.

features:

Per pixel the algorithm determines the edge of the bokeh on the same line as the center of the image and the pixel is evaluating.

The edge is detected by finding the closest point on the direct line between the two nearest flap-corners. this edge is interpolated with a full circle. Result of this edge detection is stored as the distance between the center of the image and the edge.

catadioptric lenses are simulated to interpolate between the center of the image and the distance of the edge. We now have three distances:

With a simple compare it can be detected if the evaluated pixel is between the outer and inner edge.

Definition at line 52 of file COM_BokehImageOperation.h.

Constructor & Destructor Documentation

◆ BokehImageOperation()

blender::compositor::BokehImageOperation::BokehImageOperation ( )

Member Function Documentation

◆ deinitExecution()

void blender::compositor::BokehImageOperation::deinitExecution ( )
overridevirtual

Deinitialize the execution.

Reimplemented from blender::compositor::NodeOperation.

Definition at line 113 of file COM_BokehImageOperation.cc.

◆ deleteDataOnFinish()

void blender::compositor::BokehImageOperation::deleteDataOnFinish ( )
inline

deleteDataOnFinish

There are cases that the compositor uses this operation on its own (see defocus node) the deleteDataOnFinish must only be called when the data has been created by the compositor. It should not be called when the data has been created by the node-editor/user.

Definition at line 150 of file COM_BokehImageOperation.h.

Referenced by blender::compositor::DefocusNode::convertToOperations().

◆ determineResolution()

void blender::compositor::BokehImageOperation::determineResolution ( unsigned int  resolution[2],
unsigned int  preferredResolution[2] 
)
overridevirtual

determine the resolution of this operation. currently fixed at [COM_BLUR_BOKEH_PIXELS, COM_BLUR_BOKEH_PIXELS]

Parameters
resolution

Reimplemented from blender::compositor::NodeOperation.

Definition at line 123 of file COM_BokehImageOperation.cc.

References blender::compositor::COM_BLUR_BOKEH_PIXELS.

◆ executePixelSampled()

void blender::compositor::BokehImageOperation::executePixelSampled ( float  output[4],
float  x,
float  y,
PixelSampler  sampler 
)
overridevirtual

The inner loop of this operation.

Reimplemented from blender::compositor::NodeOperation.

Definition at line 89 of file COM_BokehImageOperation.cc.

References distance(), fabsf, NodeBokehImage::lensshift, output, x, and y.

◆ initExecution()

void blender::compositor::BokehImageOperation::initExecution ( )
overridevirtual

◆ setData()

void blender::compositor::BokehImageOperation::setData ( NodeBokehImage data)
inline

set the node data

Parameters
data

Definition at line 138 of file COM_BokehImageOperation.h.

References data.

Referenced by blender::compositor::BokehImageNode::convertToOperations(), and blender::compositor::DefocusNode::convertToOperations().


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