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

#include <COM_PreviewOperation.h>

Inherits blender::compositor::NodeOperation.

Public Member Functions

 PreviewOperation (const ColorManagedViewSettings *viewSettings, const ColorManagedDisplaySettings *displaySettings, unsigned int defaultWidth, unsigned int defaultHeight)
 
void verifyPreview (bNodeInstanceHash *previews, bNodeInstanceKey key)
 
bool isOutputOperation (bool) const override
 isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing. More...
 
void initExecution () override
 
void deinitExecution () override
 
eCompositorPriority getRenderPriority () const override
 get the render priority of this node. More...
 
void executeRegion (rcti *rect, unsigned int tileNumber) override
 when a chunk is executed by a CPUDevice, this method is called More...
 
void determineResolution (unsigned int resolution[2], unsigned int preferredResolution[2]) override
 determine the resolution of this node More...
 
bool determineDependingAreaOfInterest (rcti *input, ReadBufferOperation *readOperation, rcti *output) override
 
- 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)
 
void setbNodeTree (const bNodeTree *tree)
 
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...
 
void setResolutionInputSocketIndex (unsigned int index)
 set the index of the input socket that will determine the resolution of this operation 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 ()
 

Protected Attributes

unsigned char * m_outputBuffer
 
bNodePreviewm_preview
 holds reference to the SDNA bNode, where this nodes will render the preview image for More...
 
SocketReaderm_input
 
float m_divider
 
unsigned int m_defaultWidth
 
unsigned int m_defaultHeight
 
const ColorManagedViewSettingsm_viewSettings
 
const ColorManagedDisplaySettingsm_displaySettings
 
- Protected Attributes inherited from blender::compositor::NodeOperation
unsigned int m_width
 
unsigned int m_height
 
NodeOperationFlags flags
 

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 executePixelSampled (float[4], float, float, PixelSampler)
 calculate a single pixel 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...
 

Detailed Description

Definition at line 29 of file COM_PreviewOperation.h.

Constructor & Destructor Documentation

◆ PreviewOperation()

blender::compositor::PreviewOperation::PreviewOperation ( const ColorManagedViewSettings viewSettings,
const ColorManagedDisplaySettings displaySettings,
unsigned int  defaultWidth,
unsigned int  defaultHeight 
)

Member Function Documentation

◆ deinitExecution()

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

Reimplemented from blender::compositor::NodeOperation.

Definition at line 86 of file COM_PreviewOperation.cc.

References m_input, and m_outputBuffer.

◆ determineDependingAreaOfInterest()

bool blender::compositor::PreviewOperation::determineDependingAreaOfInterest ( rcti input,
ReadBufferOperation readOperation,
rcti output 
)
overridevirtual

◆ determineResolution()

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

determine the resolution of this node

Note
this method will not set the resolution, this is the responsibility of the caller
Parameters
resolutionthe result of this operation
preferredResolutionthe preferable resolution as no resolution could be determined

Reimplemented from blender::compositor::NodeOperation.

Definition at line 133 of file COM_PreviewOperation.cc.

References BLI_assert, blender::compositor::COM_PREVIEW_SIZE, blender::compositor::NodeOperation::determineResolution(), float(), height, m_defaultHeight, m_defaultWidth, m_divider, and width.

◆ executeRegion()

void blender::compositor::PreviewOperation::executeRegion ( rcti ,
unsigned int   
)
overridevirtual

when a chunk is executed by a CPUDevice, this method is called

Parameters
rectthe rectangle of the chunk (location and size)
chunkNumberthe chunkNumber to be calculated
memoryBuffersall input MemoryBuffer's needed

Reimplemented from blender::compositor::NodeOperation.

Definition at line 92 of file COM_PreviewOperation.cc.

References floor(), blender::compositor::NodeOperation::getWidth(), IMB_colormanagement_display_processor_new(), IMB_colormanagement_processor_apply_v4(), IMB_colormanagement_processor_free(), m_displaySettings, m_divider, m_input, m_outputBuffer, m_viewSettings, blender::compositor::Nearest, blender::compositor::NodeOperation::readSampled(), rgba_float_to_uchar(), x, rcti::xmin, y, and rcti::ymin.

◆ getRenderPriority()

eCompositorPriority blender::compositor::PreviewOperation::getRenderPriority ( ) const
overridevirtual

get the render priority of this node.

Note
only applicable for output operations like ViewerOperation
Returns
eCompositorPriority

Reimplemented from blender::compositor::NodeOperation.

Definition at line 169 of file COM_PreviewOperation.cc.

References blender::compositor::Low.

◆ initExecution()

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

◆ isOutputOperation()

bool blender::compositor::PreviewOperation::isOutputOperation ( bool  ) const
inlineoverridevirtual

isOutputOperation determines whether this operation is an output of the ExecutionSystem during rendering or editing.

Default behavior if not overridden, this operation will not be evaluated as being an output of the ExecutionSystem.

See also
ExecutionSystem
Parameters
rendering[true false] true: rendering false: editing
Returns
bool the result of this method

Reimplemented from blender::compositor::NodeOperation.

Definition at line 52 of file COM_PreviewOperation.h.

References G.

◆ verifyPreview()

void blender::compositor::PreviewOperation::verifyPreview ( bNodeInstanceHash previews,
bNodeInstanceKey  key 
)

Definition at line 57 of file COM_PreviewOperation.cc.

References BKE_node_preview_verify(), and m_preview.

Member Data Documentation

◆ m_defaultHeight

unsigned int blender::compositor::PreviewOperation::m_defaultHeight
protected

Definition at line 40 of file COM_PreviewOperation.h.

Referenced by determineResolution(), and PreviewOperation().

◆ m_defaultWidth

unsigned int blender::compositor::PreviewOperation::m_defaultWidth
protected

Definition at line 39 of file COM_PreviewOperation.h.

Referenced by determineResolution(), and PreviewOperation().

◆ m_displaySettings

const ColorManagedDisplaySettings* blender::compositor::PreviewOperation::m_displaySettings
protected

Definition at line 43 of file COM_PreviewOperation.h.

Referenced by executeRegion(), and PreviewOperation().

◆ m_divider

float blender::compositor::PreviewOperation::m_divider
protected

◆ m_input

SocketReader* blender::compositor::PreviewOperation::m_input
protected

◆ m_outputBuffer

unsigned char* blender::compositor::PreviewOperation::m_outputBuffer
protected

◆ m_preview

bNodePreview* blender::compositor::PreviewOperation::m_preview
protected

holds reference to the SDNA bNode, where this nodes will render the preview image for

Definition at line 36 of file COM_PreviewOperation.h.

Referenced by initExecution(), PreviewOperation(), and verifyPreview().

◆ m_viewSettings

const ColorManagedViewSettings* blender::compositor::PreviewOperation::m_viewSettings
protected

Definition at line 42 of file COM_PreviewOperation.h.

Referenced by executeRegion(), and PreviewOperation().


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