Go to the documentation of this file.
51 [[nodiscard]]
virtual unsigned getLineWidth(
unsigned line)
const = 0;
62 for (
auto line :
xrange(1u, height)) {
73 template<
typename Pixel>
77 return reinterpret_cast<const Pixel*
>(
90 template<
typename Pixel>
94 unsigned internalWidth;
95 auto* internalData =
reinterpret_cast<const Pixel*
>(
97 if (internalWidth == width) {
102 scaleLine(internalData, buf, internalWidth, width);
112 template<
typename Pixel>
114 int line,
unsigned numLines,
unsigned& actualLines,
115 unsigned width,
Pixel* buf)
const
118 if ((line < 0) || (
int(height) <= line)) {
121 unsigned internalWidth;
122 auto* internalData =
reinterpret_cast<const Pixel*
>(
124 if (internalWidth != width) {
125 scaleLine(internalData, buf, internalWidth, width);
133 if ((line ==
int(height)) || (
getLineWidth(line) != width)) {
155 unsigned line,
unsigned& lineWidth,
156 void* buf,
unsigned bufWidth)
const = 0;
163 template<
typename Pixel>
170 template<
typename Pixel>
177 template<
typename Pixel>
209 unsigned inWidth,
unsigned outWidth)
const;
225 #endif // FRAMESOURCE_HH
constexpr auto xrange(T e)
virtual unsigned getLineWidth(unsigned line) const =0
Gets the number of display pixels on the given line.
constexpr vecN< N, T > max(const vecN< N, T > &x, const vecN< N, T > &y)
const Pixel * getLinePtr(int line, unsigned width, Pixel *buf) const
Gets a pointer to the pixels of the given line number.
virtual bool hasContiguousStorage() const
Returns true when two consecutive rows are also consecutive in memory.
const Pixel * getLinePtr960_720(unsigned line, Pixel *buf) const
Get a pointer to a given line in this frame, the frame is scaled to 960x720 pixels.
virtual unsigned getRowLength() const
Returns the distance (in pixels) between two consecutive lines.
@ FIELD_EVEN
Interlacing is on and this is an even frame.
void setHeight(unsigned height_)
virtual const void * getLineInfo(unsigned line, unsigned &lineWidth, void *buf, unsigned bufWidth) const =0
Abstract implementation of getLinePtr().
@ FIELD_NONINTERLACED
Interlacing is off for this frame.
const Pixel * getLinePtr640_480(unsigned line, Pixel *buf) const
Get a pointer to a given line in this frame, the frame is scaled to 640x480 pixels.
FieldType getField() const
Gets the role this frame plays in interlacing.
Pixel getLineColor(unsigned line) const
Get the (single) color of the given line.
const PixelFormat & getPixelFormat() const
void init(FieldType fieldType_)
(Re)initialize an existing FrameSource.
FieldType
What role does this frame play in interlacing?
unsigned getHeight() const
Gets the number of lines in this frame.
const Pixel * getLinePtr320_240(unsigned line, Pixel *buf) const
Get a pointer to a given line in this frame, the frame is scaled to 320x240 pixels.
Interface for getting lines from a video frame.
FrameSource(const PixelFormat &format)
void scaleLine(const Pixel *in, Pixel *out, unsigned inWidth, unsigned outWidth) const
unsigned getWidth() const
Get the width of (all) lines in this frame.
This file implemented 3 utility functions:
@ FIELD_ODD
Interlacing is on and this is an odd frame.
const Pixel * getMultiLinePtr(int line, unsigned numLines, unsigned &actualLines, unsigned width, Pixel *buf) const
Similar to the above getLinePtr() method, but now tries to get multiple lines at once.