TuttleOFX
1
|
#include <OverlayData.hpp>
Public Types | |
typedef boost::gil::rgba32f_view_t | SView |
Public Member Functions | |
OverlayData (const OfxPointI &size, const int nbSteps, const int nbStepsCurvesFromSelection) | |
void | clearSelection () |
void | clearAll (const OfxPointI &size) |
bool | isImageSizeModified (const OfxPointI &size) const |
void | computeFullData (OFX::Clip *clipSrc, const OfxTime time, const OfxPointD &renderScale, const bool selectionOnly=false) |
void | computeCurveFromSelectionData (OFX::Clip *clipSrc, const OfxTime time, const OfxPointD &renderScale) |
void | setNbStep (const std::size_t nbStep) |
bool | isCurrentTimeModified (const OfxTime time) const |
void | resetCurvesFromSelectionData () |
Data Fields | |
HistogramBufferData | _data |
HistogramBufferData | _selectionData |
HistogramBufferData | _curveFromSelection |
AverageBarData | _averageData |
bool_2d | _imgBool |
OfxTime | _currentTime |
std::size_t | _vNbStep |
std::size_t | _vNbStepCurveFromSelection |
bool | _isComputing |
bool | _isDataInvalid |
Private Member Functions | |
void | computeHistogramBufferData (HistogramBufferData &data, SView &srcView, const OfxTime time, const bool isSelection=false) |
void | correctHistogramBufferData (HistogramBufferData &toCorrect) const |
void | resetHistogramBufferData (HistogramBufferData &toReset) const |
Set each values of the vector to null. | |
void | computeAverages () |
void | resetHistogramData () |
void | resetHistogramSelectionData () |
void | resetAverages () |
void | removeSelection () |
void | correctVector (HistogramVector &v) const |
void | resetVectortoZero (HistogramVector &v, const std::size_t size) const |
Set each values of the vector to null. | |
int | computeAnAverage (const HistogramVector &selection_v) const |
Private Attributes | |
OfxPointI | _size |
Definition at line 159 of file OverlayData.hpp.
typedef boost::gil::rgba32f_view_t tuttle::plugin::histogram::OverlayData::SView |
Definition at line 162 of file OverlayData.hpp.
tuttle::plugin::histogram::OverlayData::OverlayData | ( | const OfxPointI & | size, |
const int | nbSteps, | ||
const int | nbStepsCurvesFromSelection | ||
) |
Create a new empty data structure from scratch (data is null)
size | : size of the current source clip (width*height) |
Definition at line 16 of file OverlayData.cpp.
References clearAll().
void tuttle::plugin::histogram::OverlayData::clearAll | ( | const OfxPointI & | size | ) | [inline] |
Definition at line 176 of file OverlayData.hpp.
References _size.
Referenced by computeCurveFromSelectionData(), computeFullData(), tuttle::plugin::histogram::HistogramOverlay::draw(), and OverlayData().
void tuttle::plugin::histogram::OverlayData::clearSelection | ( | ) | [inline] |
reset selection data (button clear selection)
Definition at line 170 of file OverlayData.hpp.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedParam(), and tuttle::plugin::histogram::HistogramOverlay::penDown().
int tuttle::plugin::histogram::OverlayData::computeAnAverage | ( | const HistogramVector & | selection_v | ) | const [private] |
Compute a specific channel average
selection_v | vector which contain the selection histogram |
Definition at line 126 of file OverlayData.cpp.
Referenced by computeAverages().
void tuttle::plugin::histogram::OverlayData::computeAverages | ( | ) | [private] |
Compute average bars for display
Definition at line 109 of file OverlayData.cpp.
References tuttle::plugin::histogram::AverageBarData::_averageBlue, _averageData, tuttle::plugin::histogram::AverageBarData::_averageGreen, tuttle::plugin::histogram::AverageBarData::_averageHue, tuttle::plugin::histogram::AverageBarData::_averageLightness, tuttle::plugin::histogram::AverageBarData::_averageRed, tuttle::plugin::histogram::AverageBarData::_averageSaturation, tuttle::plugin::histogram::HistogramBufferData::_bufferBlue, tuttle::plugin::histogram::HistogramBufferData::_bufferGreen, tuttle::plugin::histogram::HistogramBufferData::_bufferHue, tuttle::plugin::histogram::HistogramBufferData::_bufferLightness, tuttle::plugin::histogram::HistogramBufferData::_bufferRed, tuttle::plugin::histogram::HistogramBufferData::_bufferSaturation, _selectionData, and computeAnAverage().
Referenced by computeFullData().
void tuttle::plugin::histogram::OverlayData::computeCurveFromSelectionData | ( | OFX::Clip * | clipSrc, |
const OfxTime | time, | ||
const OfxPointD & | renderScale | ||
) |
Compute only curve from selection data (averages,histograms buffer and selection buffer)
clipSrc | source of the plugin |
time | current time |
renderScale | current renderScale |
Definition at line 322 of file OverlayData.cpp.
References _currentTime, _curveFromSelection, _imgBool, _isComputing, clearAll(), correctHistogramBufferData(), OFX::eBitDepthFloat, tuttle::plugin::eImageOrientationIndependant, OFX::Clip::fetchImage(), OFX::Clip::getCanonicalRod(), OFX::Clip::getPixelComponents(), OFX::Clip::getPixelDepth(), OFX::Clip::getPixelRod(), OFX::Clip::isConnected(), isImageSizeModified(), resetCurvesFromSelectionData(), terry::algorithm::transform_pixels(), TUTTLE_LOG_WARNING, and OfxPointI::x.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedParam().
void tuttle::plugin::histogram::OverlayData::computeFullData | ( | OFX::Clip * | clipSrc, |
const OfxTime | time, | ||
const OfxPointD & | renderScale, | ||
const bool | selectionOnly = false |
||
) |
Histogram computing
Compute full data (averages,histograms buffer and selection buffer)
clipSrc | source of the plugin |
time | current time |
renderScale | current renderScale |
Definition at line 149 of file OverlayData.cpp.
References _currentTime, _data, _isComputing, _selectionData, clearAll(), computeAverages(), computeHistogramBufferData(), OFX::eBitDepthFloat, tuttle::plugin::eImageOrientationIndependant, OFX::Clip::fetchImage(), OFX::Clip::getCanonicalRod(), OFX::Clip::getPixelComponents(), OFX::Clip::getPixelDepth(), OFX::Clip::getPixelRod(), OFX::Clip::isConnected(), isImageSizeModified(), resetHistogramData(), resetHistogramSelectionData(), TUTTLE_LOG_WARNING, and OfxPointI::x.
Referenced by tuttle::plugin::histogram::HistogramOverlay::draw().
void tuttle::plugin::histogram::OverlayData::computeHistogramBufferData | ( | HistogramBufferData & | data, |
SView & | srcView, | ||
const OfxTime | time, | ||
const bool | isSelection = false |
||
) | [private] |
Update selection areas buffer to selection histograms overlay
args | needed to have current time |
Definition at line 31 of file OverlayData.cpp.
References _imgBool, _size, tuttle::plugin::histogram::HistogramBufferData::_step, _vNbStep, correctHistogramBufferData(), terry::algorithm::transform_pixels(), OfxPointI::x, and OfxPointI::y.
Referenced by computeFullData().
void tuttle::plugin::histogram::OverlayData::correctHistogramBufferData | ( | HistogramBufferData & | toCorrect | ) | const [private] |
Correct the HistogramBufferData buffers wrong value with an average
toCorrect | HistogramBufferData to correct |
Definition at line 80 of file OverlayData.cpp.
References tuttle::plugin::histogram::HistogramBufferData::_bufferBlue, tuttle::plugin::histogram::HistogramBufferData::_bufferGreen, tuttle::plugin::histogram::HistogramBufferData::_bufferHue, tuttle::plugin::histogram::HistogramBufferData::_bufferLightness, tuttle::plugin::histogram::HistogramBufferData::_bufferRed, tuttle::plugin::histogram::HistogramBufferData::_bufferSaturation, and correctVector().
Referenced by computeCurveFromSelectionData(), and computeHistogramBufferData().
void tuttle::plugin::histogram::OverlayData::correctVector | ( | HistogramVector & | v | ) | const [private] |
Replace vector null values by average (better for histogram display)
v | vector to modify |
Definition at line 97 of file OverlayData.cpp.
Referenced by correctHistogramBufferData().
bool tuttle::plugin::histogram::OverlayData::isCurrentTimeModified | ( | const OfxTime | time | ) | const |
Current time checker
Definition at line 311 of file OverlayData.cpp.
References _currentTime.
Referenced by tuttle::plugin::histogram::HistogramOverlay::draw(), and tuttle::plugin::histogram::HistogramPlugin::render().
bool tuttle::plugin::histogram::OverlayData::isImageSizeModified | ( | const OfxPointI & | imgSize | ) | const |
Image size checker
Check size (verify that imgBool always has the good size
Definition at line 302 of file OverlayData.cpp.
References _size, OfxPointI::x, and OfxPointI::y.
Referenced by computeCurveFromSelectionData(), computeFullData(), and tuttle::plugin::histogram::HistogramOverlay::draw().
void tuttle::plugin::histogram::OverlayData::removeSelection | ( | ) | [private] |
Definition at line 270 of file OverlayData.cpp.
References _imgBool, _size, OfxPointI::x, and OfxPointI::y.
void tuttle::plugin::histogram::OverlayData::resetAverages | ( | ) | [private] |
Set all of averages to 0
Definition at line 288 of file OverlayData.cpp.
References tuttle::plugin::histogram::AverageBarData::_averageBlue, _averageData, tuttle::plugin::histogram::AverageBarData::_averageGreen, tuttle::plugin::histogram::AverageBarData::_averageHue, tuttle::plugin::histogram::AverageBarData::_averageLightness, tuttle::plugin::histogram::AverageBarData::_averageRed, and tuttle::plugin::histogram::AverageBarData::_averageSaturation.
void tuttle::plugin::histogram::OverlayData::resetCurvesFromSelectionData | ( | ) |
HistoramData management
Reset the data (all values to 0)
size | size of the current source clip |
Definition at line 252 of file OverlayData.cpp.
References _curveFromSelection, tuttle::plugin::histogram::HistogramBufferData::_step, _vNbStepCurveFromSelection, and resetHistogramBufferData().
Referenced by computeCurveFromSelectionData().
void tuttle::plugin::histogram::OverlayData::resetHistogramBufferData | ( | HistogramBufferData & | toReset | ) | const [private] |
Set each values of the vector to null.
toReset | HistogramBufferdata instance to reset |
Definition at line 62 of file OverlayData.cpp.
References tuttle::plugin::histogram::HistogramBufferData::_bufferAlpha, tuttle::plugin::histogram::HistogramBufferData::_bufferBlue, tuttle::plugin::histogram::HistogramBufferData::_bufferGreen, tuttle::plugin::histogram::HistogramBufferData::_bufferHue, tuttle::plugin::histogram::HistogramBufferData::_bufferLightness, tuttle::plugin::histogram::HistogramBufferData::_bufferRed, tuttle::plugin::histogram::HistogramBufferData::_bufferSaturation, tuttle::plugin::histogram::HistogramBufferData::_step, and resetVectortoZero().
Referenced by resetCurvesFromSelectionData(), resetHistogramData(), and resetHistogramSelectionData().
void tuttle::plugin::histogram::OverlayData::resetHistogramData | ( | ) | [private] |
Reset the data (all values to 0)
size | size of the current source clip |
Definition at line 241 of file OverlayData.cpp.
References _data, tuttle::plugin::histogram::HistogramBufferData::_step, _vNbStep, and resetHistogramBufferData().
Referenced by computeFullData().
void tuttle::plugin::histogram::OverlayData::resetHistogramSelectionData | ( | ) | [private] |
Reset the data (all values to 0)
size | size of the current source clip |
Definition at line 263 of file OverlayData.cpp.
References _selectionData, tuttle::plugin::histogram::HistogramBufferData::_step, _vNbStep, and resetHistogramBufferData().
Referenced by computeFullData().
void tuttle::plugin::histogram::OverlayData::resetVectortoZero | ( | HistogramVector & | v, |
const std::size_t | numberOfStep | ||
) | const [private] |
Set each values of the vector to null.
v | vector to reset |
numberOfStep | number of step (size of the vector) |
Definition at line 53 of file OverlayData.cpp.
Referenced by resetHistogramBufferData().
void tuttle::plugin::histogram::OverlayData::setNbStep | ( | const std::size_t | nbStep | ) | [inline] |
Definition at line 196 of file OverlayData.hpp.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedParam().
Definition at line 234 of file OverlayData.hpp.
Referenced by computeAverages(), and resetAverages().
Definition at line 236 of file OverlayData.hpp.
Referenced by computeCurveFromSelectionData(), computeFullData(), and isCurrentTimeModified().
Definition at line 232 of file OverlayData.hpp.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedParam(), computeCurveFromSelectionData(), and resetCurvesFromSelectionData().
Definition at line 230 of file OverlayData.hpp.
Referenced by computeFullData(), tuttle::plugin::histogram::HSLOverlay::draw(), tuttle::plugin::histogram::RGBOverlay::draw(), and resetHistogramData().
Definition at line 235 of file OverlayData.hpp.
Referenced by computeCurveFromSelectionData(), computeHistogramBufferData(), tuttle::plugin::histogram::HistogramOverlay::penMotion(), tuttle::plugin::histogram::HistogramOverlay::penUp(), and removeSelection().
Definition at line 239 of file OverlayData.hpp.
Referenced by computeCurveFromSelectionData(), and computeFullData().
Definition at line 241 of file OverlayData.hpp.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedClip(), tuttle::plugin::histogram::HistogramPlugin::changedParam(), tuttle::plugin::histogram::HistogramOverlay::draw(), tuttle::plugin::histogram::HistogramOverlay::HistogramOverlay(), tuttle::plugin::histogram::HistogramOverlay::keyUp(), and tuttle::plugin::histogram::HistogramOverlay::penUp().
Definition at line 231 of file OverlayData.hpp.
Referenced by computeAverages(), computeFullData(), and resetHistogramSelectionData().
Definition at line 244 of file OverlayData.hpp.
Referenced by computeHistogramBufferData(), isImageSizeModified(), and removeSelection().
std::size_t tuttle::plugin::histogram::OverlayData::_vNbStep |
Definition at line 237 of file OverlayData.hpp.
Referenced by computeHistogramBufferData(), resetHistogramData(), and resetHistogramSelectionData().
Definition at line 238 of file OverlayData.hpp.
Referenced by tuttle::plugin::histogram::HistogramPlugin::changedParam(), and resetCurvesFromSelectionData().