58 [[nodiscard]]
virtual unsigned getLineWidth(
unsigned line)
const = 0;
69 for (
auto line :
xrange(1u, height)) {
94 [[nodiscard]]
inline std::span<const Pixel>
getLine(
int line, std::span<Pixel> buf)
const
96 line = std::clamp(line, 0, narrow<int>(
getHeight() - 1));
98 if (unscaledLine.size() == buf.size()) {
117 unsigned line, std::span<Pixel> helpBuf)
const = 0;
124 [[nodiscard]] std::span<const Pixel, 320>
getLinePtr320_240(
unsigned line, std::span<Pixel, 320> buf)
const;
130 [[nodiscard]] std::span<const Pixel, 640>
getLinePtr640_480(
unsigned line, std::span<Pixel, 640> buf)
const;
136 [[nodiscard]] std::span<const Pixel, 960>
getLinePtr960_720(
unsigned line, std::span<Pixel, 960> buf)
const;
151 void scaleLine(std::span<const Pixel> in, std::span<Pixel> out)
const;
Interface for getting lines from a video frame.
virtual bool hasContiguousStorage() const
Returns true when two consecutive rows are also consecutive in memory.
std::span< const Pixel > getLine(int line, std::span< Pixel > buf) const
Gets a pointer to the pixels of the given line number.
virtual unsigned getLineWidth(unsigned line) const =0
Gets the number of display pixels on the given line.
FieldType getField() const
Gets the role this frame plays in interlacing.
std::span< const Pixel, 320 > getLinePtr320_240(unsigned line, std::span< Pixel, 320 > buf) const
Get a pointer to a given line in this frame, the frame is scaled to 320x240 pixels.
Pixel getLineColor(unsigned line) const
Get the (single) color of the given line.
std::span< const Pixel, 960 > getLinePtr960_720(unsigned line, std::span< Pixel, 960 > buf) const
Get a pointer to a given line in this frame, the frame is scaled to 960x720 pixels.
void scaleLine(std::span< const Pixel > in, std::span< Pixel > out) const
void setHeight(unsigned height_)
unsigned getWidth() const
Get the width of (all) lines in this frame.
virtual std::span< const Pixel > getUnscaledLine(unsigned line, std::span< Pixel > helpBuf) const =0
Get a specific line, with the 'native' line-width.
void init(FieldType fieldType_)
(Re)initialize an existing FrameSource.
std::span< const Pixel, 640 > getLinePtr640_480(unsigned line, std::span< Pixel, 640 > buf) const
Get a pointer to a given line in this frame, the frame is scaled to 640x480 pixels.
unsigned getHeight() const
Gets the number of lines in this frame.
FieldType
What role does this frame play in interlacing?
@ ODD
Interlacing is on and this is an odd frame.
@ EVEN
Interlacing is on and this is an even frame.
@ NONINTERLACED
Interlacing is off for this frame.
This file implemented 3 utility functions:
constexpr auto xrange(T e)