openMSX
|
Interface for getting lines from a video frame. More...
#include <FrameSource.hh>
Public Types | |
enum class | FieldType { NONINTERLACED , EVEN , ODD } |
What role does this frame play in interlacing? More... | |
using | Pixel = uint32_t |
Public Member Functions | |
void | init (FieldType fieldType_) |
(Re)initialize an existing FrameSource. | |
FieldType | getField () const |
Gets the role this frame plays in interlacing. | |
unsigned | getHeight () const |
Gets the number of lines in this frame. | |
virtual unsigned | getLineWidth (unsigned line) const =0 |
Gets the number of display pixels on the given line. | |
unsigned | getWidth () const |
Get the width of (all) lines in this frame. | |
Pixel | getLineColor (unsigned line) const |
Get the (single) color of the given line. | |
std::span< const Pixel > | getLine (int line, std::span< Pixel > buf) const |
Gets a pointer to the pixels of the given line number. | |
virtual std::span< const Pixel > | getUnscaledLine (unsigned line, std::span< Pixel > helpBuf) const =0 |
Get a specific line, with the 'native' line-width. | |
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. | |
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. | |
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. | |
Protected Member Functions | |
FrameSource ()=default | |
~FrameSource ()=default | |
void | setHeight (unsigned height_) |
virtual bool | hasContiguousStorage () const |
Returns true when two consecutive rows are also consecutive in memory. | |
void | scaleLine (std::span< const Pixel > in, std::span< Pixel > out) const |
Interface for getting lines from a video frame.
Definition at line 19 of file FrameSource.hh.
using openmsx::FrameSource::Pixel = uint32_t |
Definition at line 22 of file FrameSource.hh.
|
strong |
What role does this frame play in interlacing?
Enumerator | |
---|---|
NONINTERLACED | Interlacing is off for this frame. |
EVEN | Interlacing is on and this is an even frame. |
ODD | Interlacing is on and this is an odd frame. |
Definition at line 26 of file FrameSource.hh.
|
protecteddefault |
|
protecteddefault |
|
inline |
Gets the role this frame plays in interlacing.
Definition at line 45 of file FrameSource.hh.
|
inline |
Gets the number of lines in this frame.
Definition at line 51 of file FrameSource.hh.
Referenced by getLine(), openmsx::RawFrame::getLineDirect(), getLinePtr320_240(), getLinePtr640_480(), getLinePtr960_720(), openmsx::SuperImposedFrame::getLineWidth(), openmsx::RawFrame::getLineWidthDirect(), openmsx::SuperImposedFrame::getUnscaledLine(), openmsx::Deflicker::init(), openmsx::SuperImposedFrame::init(), openmsx::DeinterlacedFrame::init(), openmsx::DoubledFrame::init(), openmsx::PostProcessor::paint(), openmsx::RawFrame::setBlank(), and openmsx::RawFrame::setLineWidth().
|
inline |
Gets a pointer to the pixels of the given line number.
The line returned is guaranteed to have the given width. If the original line had a different width the result will be computed in the provided work buffer. So that buffer should be big enough to hold the scaled line. This also means the lifetime of the result is tied to the lifetime of that work buffer. In any case the return value of this function will point to the line data (some internal buffer or the work buffer).
Definition at line 94 of file FrameSource.hh.
References getHeight(), getUnscaledLine(), and scaleLine().
Referenced by getLinePtr320_240(), getLinePtr640_480(), getLinePtr960_720(), openmsx::SuperImposedFrame::getUnscaledLine(), and openmsx::GLHQScaler::uploadBlock().
|
inline |
Get the (single) color of the given line.
Typically this will be used to get the color of a vertical border line. But it's fine to call this on non-border lines as well, in that case the color of the first pixel of the line is returned.
Definition at line 80 of file FrameSource.hh.
References ALIGNAS_SSE, and getUnscaledLine().
std::span< const Pixel, 320 > openmsx::FrameSource::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.
The difference between this method and getLinePtr() is that this method also does vertical scaling. This is used for video recording.
Definition at line 17 of file FrameSource.cc.
References ALIGNAS_SSE, openmsx::blendLines(), getHeight(), and getLine().
std::span< const Pixel, 640 > openmsx::FrameSource::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.
Same as getLinePtr320_240, but then for a higher resolution output.
Definition at line 33 of file FrameSource.cc.
References getHeight(), and getLine().
std::span< const Pixel, 960 > openmsx::FrameSource::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.
Same as getLinePtr320_240, but then for a higher resolution output.
Definition at line 47 of file FrameSource.cc.
References ALIGNAS_SSE, openmsx::blendLines(), getHeight(), and getLine().
|
pure virtual |
Gets the number of display pixels on the given line.
Implemented in openmsx::Deflicker, and openmsx::SuperImposedFrame.
Referenced by openmsx::SuperImposedFrame::getLineWidth(), openmsx::SuperImposedFrame::getUnscaledLine(), and getWidth().
|
pure virtual |
Get a specific line, with the 'native' line-width.
line | The line number for the requested line. |
helpBuf | Buffer space that can optionally be used by the implementation. |
Implemented in openmsx::Deflicker, and openmsx::SuperImposedFrame.
Referenced by getLine(), and getLineColor().
|
inline |
Get the width of (all) lines in this frame.
This only makes sense when all lines have the same width, so this methods asserts that all lines actually have the same width. This is for example not always the case for MSX frames, but it is for video frames (for superimpose).
Definition at line 66 of file FrameSource.hh.
References getLineWidth(), and xrange().
|
inlineprotectedvirtual |
Returns true when two consecutive rows are also consecutive in memory.
Definition at line 147 of file FrameSource.hh.
|
inline |
(Re)initialize an existing FrameSource.
This method sets the Fieldtype and flushes the 'getLinePtr' buffers.
Definition at line 41 of file FrameSource.hh.
Referenced by openmsx::Deflicker::init(), openmsx::DeinterlacedFrame::init(), openmsx::DoubledFrame::init(), and openmsx::RawFrame::RawFrame().
|
protected |
Definition at line 68 of file FrameSource.cc.
References ranges::copy(), ranges::fill(), openmsx::scale_1on2(), openmsx::scale_1on3(), openmsx::scale_1on4(), openmsx::scale_1on6(), openmsx::scale_2on1(), openmsx::scale_2on3(), openmsx::scale_2on9(), openmsx::scale_3on1(), openmsx::scale_3on2(), openmsx::scale_3on4(), openmsx::scale_3on8(), openmsx::scale_4on1(), openmsx::scale_4on3(), openmsx::scale_4on9(), openmsx::scale_6on1(), openmsx::scale_8on3(), openmsx::scale_8on9(), and UNREACHABLE.
Referenced by getLine(), and openmsx::Deflicker::getUnscaledLine().
|
inlineprotected |
Definition at line 142 of file FrameSource.hh.
Referenced by openmsx::Deflicker::init(), openmsx::SuperImposedFrame::init(), openmsx::DeinterlacedFrame::init(), openmsx::DoubledFrame::init(), and openmsx::RawFrame::RawFrame().