openMSX
Public Types | Public Member Functions | Protected Member Functions | List of all members
openmsx::RawFrame Class Referencefinal

A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are applied. More...

#include <RawFrame.hh>

Inheritance diagram for openmsx::RawFrame:
Inheritance graph
[legend]
Collaboration diagram for openmsx::RawFrame:
Collaboration graph
[legend]

Public Types

using Pixel = uint32_t
 
- Public Types inherited from openmsx::FrameSource
enum  FieldType { FIELD_NONINTERLACED , FIELD_EVEN , FIELD_ODD }
 What role does this frame play in interlacing? More...
 
using Pixel = uint32_t
 

Public Member Functions

 RawFrame (unsigned maxWidth, unsigned height)
 
std::span< PixelgetLineDirect (unsigned y)
 
unsigned getLineWidthDirect (unsigned y) const
 
void setLineWidth (unsigned line, unsigned width)
 
void setBlank (unsigned line, Pixel color)
 
- Public Member Functions inherited from openmsx::FrameSource
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.
 
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 PixelgetLine (int line, std::span< Pixel > buf) const
 Gets a pointer to the pixels of the given line number.
 
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

unsigned getLineWidth (unsigned line) const override
 Gets the number of display pixels on the given line.
 
const void * getLineInfo (unsigned line, unsigned &width, void *buf, unsigned bufWidth) const override
 Abstract implementation of getLinePtr().
 
bool hasContiguousStorage () const override
 Returns true when two consecutive rows are also consecutive in memory.
 
- Protected Member Functions inherited from openmsx::FrameSource
 FrameSource ()=default
 
 ~FrameSource ()=default
 
void setHeight (unsigned height_)
 
void scaleLine (std::span< const Pixel > in, std::span< Pixel > out) const
 

Detailed Description

A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are applied.

Definition at line 14 of file RawFrame.hh.

Member Typedef Documentation

◆ Pixel

using openmsx::RawFrame::Pixel = uint32_t

Definition at line 17 of file RawFrame.hh.

Constructor & Destructor Documentation

◆ RawFrame()

openmsx::RawFrame::RawFrame ( unsigned  maxWidth,
unsigned  height 
)

Member Function Documentation

◆ getLineDirect()

std::span< Pixel > openmsx::RawFrame::getLineDirect ( unsigned  y)
inline

Definition at line 21 of file RawFrame.hh.

References openmsx::MemBuffer< T, ALIGNMENT >::data(), and openmsx::FrameSource::getHeight().

Referenced by setBlank().

◆ getLineInfo()

const void * openmsx::RawFrame::getLineInfo ( unsigned  line,
unsigned &  lineWidth,
void *  buf,
unsigned  bufWidth 
) const
overrideprotectedvirtual

Abstract implementation of getLinePtr().

Pixel type is unspecified (implementations that care about the exact type should get it via some other mechanism).

Parameters
lineThe line number for the requested line.
lineWidthOutput parameter, the width of the returned line in pixel units.
bufBuffer space that can optionally be used by the implementation.
bufWidthThe size of the above buffer, in pixel units.
Returns
Pointer to the first pixel of the requested line. This might be the same as the given 'buf' parameter or it might be some internal buffer.

Implements openmsx::FrameSource.

Definition at line 34 of file RawFrame.cc.

References openmsx::MemBuffer< T, ALIGNMENT >::data(), and openmsx::FrameSource::getHeight().

◆ getLineWidth()

unsigned openmsx::RawFrame::getLineWidth ( unsigned  line) const
overrideprotectedvirtual

Gets the number of display pixels on the given line.

Returns
line width (=1 for a vertical border line)

Implements openmsx::FrameSource.

Definition at line 28 of file RawFrame.cc.

References openmsx::FrameSource::getHeight().

◆ getLineWidthDirect()

unsigned openmsx::RawFrame::getLineWidthDirect ( unsigned  y) const
inline

Definition at line 26 of file RawFrame.hh.

References openmsx::FrameSource::getHeight().

◆ hasContiguousStorage()

bool openmsx::RawFrame::hasContiguousStorage ( ) const
overrideprotectedvirtual

Returns true when two consecutive rows are also consecutive in memory.

Reimplemented from openmsx::FrameSource.

Definition at line 43 of file RawFrame.cc.

◆ setBlank()

void openmsx::RawFrame::setBlank ( unsigned  line,
Pixel  color 
)
inline

Definition at line 37 of file RawFrame.hh.

References openmsx::FrameSource::getHeight(), and getLineDirect().

Referenced by RawFrame().

◆ setLineWidth()

void openmsx::RawFrame::setLineWidth ( unsigned  line,
unsigned  width 
)
inline

Definition at line 31 of file RawFrame.hh.

References openmsx::FrameSource::getHeight().


The documentation for this class was generated from the following files: