Photosine 0.5
Loading...
Searching...
No Matches
ImageProcessing::AudioPluginImageProcessor Class Reference

#include <AudioPluginImageProcessor.h>

Public Member Functions

 AudioPluginImageProcessor ()
 AudioPluginImageProcessor (AudioPluginImageProcessor &copy)
 ~AudioPluginImageProcessor ()
void processMat (cv::Mat mat, juce::ValueTree sourceValueTree, Time::Timecode frameNumber, std::function< void(ImageProcessorMat)>)
int getMaxThreads ()
bool canAcceptNewThreads ()
bool areJobsRunning ()

Private Member Functions

void preparePluginPool (juce::ValueTree pluginListToLoad)
 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginImageProcessor)

Private Attributes

std::unique_ptr< juce::ThreadPool > threadPool
std::mutex threadPoolMutex
PluginPool pluginPool
int numJobs = 4
int numChannels = 3
bool pluginPoolPrepared = false
juce::ValueTree pluginListTree

Detailed Description

Coordinates processing jobs, owns a PluginPool, and prepares images for processing.

Constructor & Destructor Documentation

◆ AudioPluginImageProcessor() [1/2]

ImageProcessing::AudioPluginImageProcessor::AudioPluginImageProcessor ( )

◆ AudioPluginImageProcessor() [2/2]

ImageProcessing::AudioPluginImageProcessor::AudioPluginImageProcessor ( AudioPluginImageProcessor & copy)

◆ ~AudioPluginImageProcessor()

ImageProcessing::AudioPluginImageProcessor::~AudioPluginImageProcessor ( )

Member Function Documentation

◆ areJobsRunning()

bool ImageProcessing::AudioPluginImageProcessor::areJobsRunning ( )

Returns true if any processing is still happening on any frame.

◆ canAcceptNewThreads()

bool ImageProcessing::AudioPluginImageProcessor::canAcceptNewThreads ( )

Returns true if the processor is able to accept a new image to process without going over the limit set by numJobs.

◆ getMaxThreads()

int ImageProcessing::AudioPluginImageProcessor::getMaxThreads ( )

Returns the maximum number of jobs that can be run simultaneously.

◆ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR()

ImageProcessing::AudioPluginImageProcessor::JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( AudioPluginImageProcessor )
private

◆ preparePluginPool()

void ImageProcessing::AudioPluginImageProcessor::preparePluginPool ( juce::ValueTree pluginListToLoad)
private

Fills the plugin pool with plugin instances if needed.

◆ processMat()

void ImageProcessing::AudioPluginImageProcessor::processMat ( cv::Mat mat,
juce::ValueTree sourceValueTree,
Time::Timecode frameNumber,
std::function< void(ImageProcessorMat)> callback )

Process a single cv::Mat asynchronously. MatProcessorCallback is called when processing completes. DON'T CALL FROM THE MESSAGE THREAD.

Parameters
matimage to process
sourceValueTreethe plugin list tree, usually sourced from a track.
frameNumberthe frame's timecode, used to place processed frames of a video in the correct order.
callbackThe callback function which should recieve the completed image.

Calls preparePluginPool() and aquires the next PluginPool::PluginPoolReservation, passing it to a new AudioPluginImageProcessorJob managed by threadPool

The remainder of the processing is done in subsequent subprocesses.

Member Data Documentation

◆ numChannels

int ImageProcessing::AudioPluginImageProcessor::numChannels = 3
private

◆ numJobs

int ImageProcessing::AudioPluginImageProcessor::numJobs = 4
private

The maximum number of images that can be simultaneously processed.

◆ pluginListTree

juce::ValueTree ImageProcessing::AudioPluginImageProcessor::pluginListTree
private

◆ pluginPool

PluginPool ImageProcessing::AudioPluginImageProcessor::pluginPool
private

◆ pluginPoolPrepared

bool ImageProcessing::AudioPluginImageProcessor::pluginPoolPrepared = false
private

◆ threadPool

std::unique_ptr<juce::ThreadPool> ImageProcessing::AudioPluginImageProcessor::threadPool
private

◆ threadPoolMutex

std::mutex ImageProcessing::AudioPluginImageProcessor::threadPoolMutex
private

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