MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ add_preprocessor()

void MayaFlux::Buffers::BufferProcessingChain::add_preprocessor ( const std::shared_ptr< BufferProcessor > &  processor,
const std::shared_ptr< Buffer > &  buffer 
)

Sets a preprocessor to be applied before the main pipeline.

Parameters
processorPreprocessor to add
bufferBuffer to associate with this preprocessor

The preprocessor is applied before all regular processors when process() is called. This is useful for initial data preparation steps that must occur prior to the main transformation sequence, such as format conversion, normalization, or validation. NOTE: This runs after the buffer's own default processor. If you wish this to be the preprocessor, remove the default processor first. This is done to allow buffers to configure their own default processing behavior. i.e NodeBuffer WILL acquire node data using its default processor before any processing chain preprocessor.

Definition at line 193 of file BufferProcessingChain.cpp.

194{
195 processor->on_attach(buffer);
196 m_preprocessors[buffer] = processor;
197}
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > m_preprocessors
Map of buffers to their preprocessors.

References m_preprocessors.