11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
22PROMEKI_NAMESPACE_BEGIN
127 static constexpr int DefaultHeight = 16;
135 MotionBand(
const MotionBand &) =
delete;
136 MotionBand &operator=(
const MotionBand &) =
delete;
139 bool enabled()
const {
return _enabled; }
149 void setEnabled(
bool val);
152 int height()
const {
return _height; }
163 void setHeight(
int lines);
166 int sequenceLength()
const {
return _sequenceLength; }
176 void setSequenceLength(
int frames);
179 int offset()
const {
return _offset; }
189 void setOffset(
int frames);
192 Position position()
const {
return _position; }
197 void setPosition(Position p);
200 int borderWidth()
const {
return _borderWidth; }
203 void setBorderWidth(
int pixels);
206 const Color &backgroundColor()
const {
return _backgroundColor; }
209 void setBackgroundColor(
const Color &c);
212 const Color &markerColor()
const {
return _markerColor; }
215 void setMarkerColor(
const Color &c);
218 const Color &borderColor()
const {
return _borderColor; }
221 void setBorderColor(
const Color &c);
234 int reservedLines()
const {
return _enabled ? _height : 0; }
253 Error apply(UncompressedVideoPayload &inout, uint64_t frameCount)
const;
265 void setAllocator(MediaIOAllocator::Ptr allocator);
268 MediaIOAllocator::Ptr allocator()
const {
return _allocator; }
277 void invalidateCache()
const;
280 bool _enabled =
false;
281 int _height = DefaultHeight;
282 int _sequenceLength = 0;
284 Position _position = Position::Bottom;
285 int _borderWidth = 4;
286 Color _backgroundColor;
290 MediaIOAllocator::Ptr _allocator;
297 mutable List<UncompressedVideoPayload::Ptr> _cache;
298 mutable size_t _cacheImgWidth = 0;
299 mutable size_t _cacheImgHeight = 0;
300 mutable int _cachePixelFormatId = 0;
301 mutable int _cacheEffectiveHeight = 0;
308 int effectiveBandHeight(
const ImageDesc &target)
const;
314 UncompressedVideoPayload::Ptr cachedFrame(
int frameInCycle,
const ImageDesc &target)
const;
320 void renderFrame(UncompressedVideoPayload &out,
int frameInCycle)
const;
328 ImageDesc rgbScratchDesc(
const ImageDesc &target,
int bandHeight)
const;
335 ImageDesc bandDesc(
const ImageDesc &target,
int bandHeight)
const;
341 int bandTopY(
const ImageDesc &target,
int bandHeight)
const;