|
OpenShot Library | libopenshot
0.7.0
|
Analyze a single Frame and expose scope-friendly JSON. More...
#include <FrameScope.h>
Public Member Functions | |
| void | ClearVideoRegion () |
| Clear any video ROI and re-analyze the full frame. More... | |
| FrameScope () | |
| Create an empty scope analyzer with default bucket sizes. More... | |
| FrameScope (std::shared_ptr< Frame > frame, int waveform_columns=256, int audio_buckets=256, int vectorscope_size=256) | |
| Construct and immediately analyze a frame. More... | |
| int | GetAudioBuckets () const |
| Return the number of audio waveform buckets. More... | |
| int | GetAudioChannels () const |
| Return the number of analyzed audio channels. More... | |
| std::vector< int > | GetAudioClippedSamples () const |
| Return per-channel clipped sample counts. More... | |
| const std::vector< uint32_t > & | GetAudioClippedSamplesRef () const |
| Return per-channel clipped sample counts. More... | |
| std::vector< float > | GetAudioPeakLevels () const |
| Return per-channel peak levels. More... | |
| const std::vector< float > & | GetAudioPeakLevelsRef () const |
| Return per-channel peak levels. More... | |
| std::vector< float > | GetAudioRmsLevels () const |
| Return per-channel RMS levels. More... | |
| const std::vector< float > & | GetAudioRmsLevelsRef () const |
| Return per-channel RMS levels. More... | |
| int | GetAudioSampleRate () const |
| Return the analyzed audio sample rate. More... | |
| int | GetAudioSamples () const |
| Return the number of analyzed audio samples. More... | |
| std::vector< float > | GetAudioWaveformMax (int channel) const |
| Return one channel of audio waveform maximum values. More... | |
| std::vector< float > | GetAudioWaveformMin (int channel) const |
| Return one channel of audio waveform minimum values. More... | |
| std::shared_ptr< Frame > | GetFrame () const |
| Return the currently analyzed frame. More... | |
| int | GetVectorscopeSize () const |
| Return the vectorscope plane edge length. More... | |
| double | GetVideoAverageLuma () const |
| Return the average luma of the analyzed frame. More... | |
| int | GetVideoClippedBlue () const |
| Return the clipped blue-channel pixel count. More... | |
| int | GetVideoClippedGreen () const |
| Return the clipped green-channel pixel count. More... | |
| int | GetVideoClippedHighlights () const |
| Return the clipped highlight pixel count. More... | |
| int | GetVideoClippedRed () const |
| Return the clipped red-channel pixel count. More... | |
| int | GetVideoClippedShadows () const |
| Return the clipped shadow pixel count. More... | |
| int | GetVideoHeight () const |
| Return the analyzed video height. More... | |
| std::vector< int > | GetVideoHistogramBlue () const |
| Return the blue histogram bins. More... | |
| const std::vector< uint32_t > & | GetVideoHistogramBlueBins () const |
| Return the blue histogram bins by reference. More... | |
| std::vector< int > | GetVideoHistogramGreen () const |
| Return the green histogram bins. More... | |
| const std::vector< uint32_t > & | GetVideoHistogramGreenBins () const |
| Return the green histogram bins by reference. More... | |
| std::vector< int > | GetVideoHistogramLuma () const |
| Return the luma histogram bins. More... | |
| const std::vector< uint32_t > & | GetVideoHistogramLumaBins () const |
| Return the luma histogram bins by reference. More... | |
| std::vector< int > | GetVideoHistogramRed () const |
| Return the red histogram bins. More... | |
| const std::vector< uint32_t > & | GetVideoHistogramRedBins () const |
| Return the red histogram bins by reference. More... | |
| std::vector< int > | GetVideoVectorscope () const |
| Return the flattened vectorscope density plane. More... | |
| const std::vector< uint32_t > & | GetVideoVectorscopeBins () const |
| Return the flattened vectorscope density plane by reference. More... | |
| std::vector< int > | GetVideoWaveformBlue () const |
| Return the flattened blue waveform bins. More... | |
| const std::vector< uint32_t > & | GetVideoWaveformBlueBins () const |
| Return the flattened blue waveform bins by reference. More... | |
| std::vector< int > | GetVideoWaveformGreen () const |
| Return the flattened green waveform bins. More... | |
| const std::vector< uint32_t > & | GetVideoWaveformGreenBins () const |
| Return the flattened green waveform bins by reference. More... | |
| std::vector< int > | GetVideoWaveformLuma () const |
| Return the flattened luma waveform bins. More... | |
| const std::vector< uint32_t > & | GetVideoWaveformLumaBins () const |
| Return the flattened luma waveform bins by reference. More... | |
| std::vector< int > | GetVideoWaveformRed () const |
| Return the flattened red waveform bins. More... | |
| const std::vector< uint32_t > & | GetVideoWaveformRedBins () const |
| Return the flattened red waveform bins by reference. More... | |
| int | GetVideoWidth () const |
| Return the analyzed video width. More... | |
| int | GetWaveformBins () const |
| Return the number of vertical waveform bins. More... | |
| int | GetWaveformColumns () const |
| Return the number of waveform columns. More... | |
| bool | HasAudio () const |
| Return whether the current frame has analyzable audio data. More... | |
| bool | HasVideo () const |
| Return whether the current frame has analyzable video data. More... | |
| bool | HasVideoRegion () const |
| Return whether a video ROI is enabled. More... | |
| std::string | Json () const |
| Return the current scope payload as a JSON string. More... | |
| Json::Value | JsonValue () const |
| Return the current scope payload as a Json::Value tree. More... | |
| void | SetAudioBuckets (int buckets) |
| Set the number of audio buckets and re-analyze. More... | |
| void | SetFrame (std::shared_ptr< Frame > new_frame) |
| Replace the current frame and recompute the scope data. More... | |
| void | SetVectorscopeSize (int size) |
| Set the vectorscope plane edge length and re-analyze video. More... | |
| void | SetVideoRegionNormalized (float x, float y, float width, float height) |
| Set a normalized ROI for video analysis and re-analyze video. More... | |
| void | SetWaveformColumns (int columns) |
| Set the number of horizontal waveform columns and re-analyze. More... | |
Analyze a single Frame and expose scope-friendly JSON.
FrameScope provides a lightweight analysis layer for the current preview frame. It intentionally focuses on broadly useful data for grading and editorial decisions, such as histograms, a luma waveform, audio envelope buckets, and simple clipping / peak summaries.
Pixel format: libopenshot frames are always stored as QImage::Format_RGBA8888_Premultiplied (see Frame::AddImage). The in-memory byte order per pixel is [R=0, G=1, B=2, A=3].
Definition at line 38 of file FrameScope.h.
| FrameScope::FrameScope | ( | ) |
Create an empty scope analyzer with default bucket sizes.
Definition at line 68 of file FrameScope.cpp.
| FrameScope::FrameScope | ( | std::shared_ptr< Frame > | frame, |
| int | waveform_columns = 256, |
||
| int | audio_buckets = 256, |
||
| int | vectorscope_size = 256 |
||
| ) |
Construct and immediately analyze a frame.
Definition at line 85 of file FrameScope.cpp.
| void FrameScope::ClearVideoRegion | ( | ) |
Clear any video ROI and re-analyze the full frame.
Definition at line 215 of file FrameScope.cpp.
|
inline |
Return the number of audio waveform buckets.
Definition at line 231 of file FrameScope.h.
|
inline |
Return the number of analyzed audio channels.
Definition at line 222 of file FrameScope.h.
|
inline |
Return per-channel clipped sample counts.
Definition at line 249 of file FrameScope.h.
|
inline |
Return per-channel clipped sample counts.
Definition at line 240 of file FrameScope.h.
|
inline |
Return per-channel peak levels.
Definition at line 243 of file FrameScope.h.
|
inline |
Return per-channel peak levels.
Definition at line 234 of file FrameScope.h.
|
inline |
Return per-channel RMS levels.
Definition at line 246 of file FrameScope.h.
|
inline |
Return per-channel RMS levels.
Definition at line 237 of file FrameScope.h.
|
inline |
Return the analyzed audio sample rate.
Definition at line 228 of file FrameScope.h.
|
inline |
Return the number of analyzed audio samples.
Definition at line 225 of file FrameScope.h.
| std::vector< float > FrameScope::GetAudioWaveformMax | ( | int | channel | ) | const |
Return one channel of audio waveform maximum values.
Definition at line 483 of file FrameScope.cpp.
| std::vector< float > FrameScope::GetAudioWaveformMin | ( | int | channel | ) | const |
Return one channel of audio waveform minimum values.
Definition at line 477 of file FrameScope.cpp.
|
inline |
Return the currently analyzed frame.
Definition at line 108 of file FrameScope.h.
|
inline |
Return the vectorscope plane edge length.
Definition at line 147 of file FrameScope.h.
|
inline |
Return the average luma of the analyzed frame.
Definition at line 204 of file FrameScope.h.
|
inline |
Return the clipped blue-channel pixel count.
Definition at line 219 of file FrameScope.h.
|
inline |
Return the clipped green-channel pixel count.
Definition at line 216 of file FrameScope.h.
|
inline |
Return the clipped highlight pixel count.
Definition at line 210 of file FrameScope.h.
|
inline |
Return the clipped red-channel pixel count.
Definition at line 213 of file FrameScope.h.
|
inline |
Return the clipped shadow pixel count.
Definition at line 207 of file FrameScope.h.
|
inline |
Return the analyzed video height.
Definition at line 138 of file FrameScope.h.
|
inline |
Return the blue histogram bins.
Definition at line 189 of file FrameScope.h.
|
inline |
Return the blue histogram bins by reference.
Definition at line 159 of file FrameScope.h.
|
inline |
Return the green histogram bins.
Definition at line 186 of file FrameScope.h.
|
inline |
Return the green histogram bins by reference.
Definition at line 156 of file FrameScope.h.
|
inline |
Return the luma histogram bins.
Definition at line 180 of file FrameScope.h.
|
inline |
Return the luma histogram bins by reference.
Definition at line 150 of file FrameScope.h.
|
inline |
Return the red histogram bins.
Definition at line 183 of file FrameScope.h.
|
inline |
Return the red histogram bins by reference.
Definition at line 153 of file FrameScope.h.
|
inline |
Return the flattened vectorscope density plane.
Definition at line 177 of file FrameScope.h.
|
inline |
Return the flattened vectorscope density plane by reference.
Definition at line 174 of file FrameScope.h.
|
inline |
Return the flattened blue waveform bins.
Definition at line 201 of file FrameScope.h.
|
inline |
Return the flattened blue waveform bins by reference.
Definition at line 171 of file FrameScope.h.
|
inline |
Return the flattened green waveform bins.
Definition at line 198 of file FrameScope.h.
|
inline |
Return the flattened green waveform bins by reference.
Definition at line 168 of file FrameScope.h.
|
inline |
Return the flattened luma waveform bins.
Definition at line 192 of file FrameScope.h.
|
inline |
Return the flattened luma waveform bins by reference.
Definition at line 162 of file FrameScope.h.
|
inline |
Return the flattened red waveform bins.
Definition at line 195 of file FrameScope.h.
|
inline |
Return the flattened red waveform bins by reference.
Definition at line 165 of file FrameScope.h.
|
inline |
Return the analyzed video width.
Definition at line 135 of file FrameScope.h.
|
inline |
Return the number of vertical waveform bins.
Definition at line 144 of file FrameScope.h.
|
inline |
Return the number of waveform columns.
Definition at line 141 of file FrameScope.h.
|
inline |
Return whether the current frame has analyzable audio data.
Definition at line 132 of file FrameScope.h.
|
inline |
Return whether the current frame has analyzable video data.
Definition at line 129 of file FrameScope.h.
|
inline |
Return whether a video ROI is enabled.
Definition at line 126 of file FrameScope.h.
| std::string FrameScope::Json | ( | ) | const |
Return the current scope payload as a JSON string.
Definition at line 463 of file FrameScope.cpp.
| Json::Value FrameScope::JsonValue | ( | ) | const |
Return the current scope payload as a Json::Value tree.
Definition at line 457 of file FrameScope.cpp.
| void FrameScope::SetAudioBuckets | ( | int | buckets | ) |
Set the number of audio buckets and re-analyze.
Definition at line 190 of file FrameScope.cpp.
| void FrameScope::SetFrame | ( | std::shared_ptr< Frame > | new_frame | ) |
Replace the current frame and recompute the scope data.
Definition at line 178 of file FrameScope.cpp.
| void FrameScope::SetVectorscopeSize | ( | int | size | ) |
Set the vectorscope plane edge length and re-analyze video.
Definition at line 197 of file FrameScope.cpp.
| void FrameScope::SetVideoRegionNormalized | ( | float | x, |
| float | y, | ||
| float | width, | ||
| float | height | ||
| ) |
Set a normalized ROI for video analysis and re-analyze video.
Definition at line 204 of file FrameScope.cpp.
| void FrameScope::SetWaveformColumns | ( | int | columns | ) |
Set the number of horizontal waveform columns and re-analyze.
Definition at line 183 of file FrameScope.cpp.
1.8.17