Classes | Public Member Functions | List of all members
openmsx::PostProcessor Class Referencefinal

A post processor builds the frame that is displayed from the MSX frame, while applying effects such as scalers, noise etc. More...

#include <PostProcessor.hh>

Inheritance diagram for openmsx::PostProcessor:
Inheritance graph
Collaboration diagram for openmsx::PostProcessor:
Collaboration graph

Public Member Functions

 PostProcessor (MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace)
 ~PostProcessor () override
void paint (OutputSurface &output) override
 Paint this layer.
std::unique_ptr< RawFramerotateFrames (std::unique_ptr< RawFrame > finishedFrame, EmuTime::param time)
 Sets up the "abcdFrame" variables for a new frame.
void setSuperimposeVideoFrame (const RawFrame *videoSource)
 Set the Video frame on which to superimpose the 'normal' output of this PostProcessor.
void setSuperimposeVdpFrame (const FrameSource *vdpSource)
 Set the VDP frame on which to superimpose the 'normal' output of this PostProcessor.
void setRecorder (AviRecorder *recorder_)
 Start/stop recording.
bool isRecording () const
 Is recording active.
FrameSourcegetPaintFrame () const
 Get the frame that would be displayed.
void takeRawScreenShot (unsigned height, const std::string &filename) override
 Create a raw (=non-post-processed) screenshot.
CliCommgetCliComm ()
- Public Member Functions inherited from openmsx::VideoLayer
 VideoLayer (const VideoLayer &)=delete
 VideoLayer (VideoLayer &&)=delete
VideoLayeroperator= (const VideoLayer &)=delete
VideoLayeroperator= (VideoLayer &&)=delete
int getVideoSource () const
 Returns the ID for this VideoLayer.
int getVideoSourceSetting () const
void setVideo9000Active (int video9000Source_, Video9000Active active)
bool needRender () const
bool needRecord () const
- Public Member Functions inherited from openmsx::Layer
virtual ~Layer ()=default
ZIndex getZ () const
 Query the Z-index of this layer.
bool isActive () const
Coverage getCoverage () const
 Query the coverage of this layer.
void setDisplay (LayerListener &display_)
 Store pointer to Display.

Additional Inherited Members

- Public Types inherited from openmsx::VideoLayer
enum class  Video9000Active { NO , FRONT , BACK }
- Public Types inherited from openmsx::Layer
enum class  ZIndex {
 Determines stacking order of layers: layers with higher Z-indices are closer to the viewer. More...
enum class  Coverage { FULL , PARTIAL , NONE }
 Describes how much of the screen is currently covered by a particular layer. More...
- Protected Member Functions inherited from openmsx::VideoLayer
 VideoLayer (MSXMotherBoard &motherBoard, const std::string &videoSource)
 ~VideoLayer () override
void update (const Setting &setting) noexcept override
- Protected Member Functions inherited from openmsx::Layer
 Layer (Coverage coverage_, ZIndex z_)
 Construct a layer.
void setCoverage (Coverage coverage_)
 Changes the current coverage of this layer.
void setZ (ZIndex z)
 Changes the current Z-index of this layer.
- Protected Member Functions inherited from openmsx::Observer< Setting >
 Observer ()=default
 ~Observer ()=default
 Observer (const Observer &)=delete
 Observer (Observer &&)=delete
Observeroperator= (const Observer &)=delete
Observeroperator= (Observer &&)=delete
virtual void subjectDeleted (const Setting &)

Detailed Description

A post processor builds the frame that is displayed from the MSX frame, while applying effects such as scalers, noise etc.

Definition at line 34 of file PostProcessor.hh.

Constructor & Destructor Documentation

◆ PostProcessor()

openmsx::PostProcessor::PostProcessor ( MSXMotherBoard motherBoard,
Display display,
OutputSurface screen,
const std::string &  videoSource,
unsigned  maxWidth,
unsigned  height,
bool  canDoInterlace 

◆ ~PostProcessor()

openmsx::PostProcessor::~PostProcessor ( )

Member Function Documentation

◆ getCliComm()

CliComm & openmsx::PostProcessor::getCliComm ( )

Definition at line 115 of file

References openmsx::Display::getCliComm().

Referenced by rotateFrames(), and ~PostProcessor().

◆ getPaintFrame()

FrameSource * openmsx::PostProcessor::getPaintFrame ( ) const

Get the frame that would be displayed.

E.g. so that it can be superimposed over the output of another PostProcessor, see setSuperimposeVdpFrame().

Definition at line 94 of file PostProcessor.hh.

◆ isRecording()

bool openmsx::PostProcessor::isRecording ( ) const

Is recording active.

ATM used to keep frameskip constant during recording.

Definition at line 88 of file PostProcessor.hh.

◆ paint()

void openmsx::PostProcessor::paint ( OutputSurface output)

◆ rotateFrames()

std::unique_ptr< RawFrame > openmsx::PostProcessor::rotateFrames ( std::unique_ptr< RawFrame finishedFrame,
EmuTime::param  time 

Sets up the "abcdFrame" variables for a new frame.

TODO: The point of passing the finished frame in and the new workFrame out is to be able to split off the scaler application as a separate class.

finishedFrameFrame that has just become available.
timeThe moment in time the frame becomes available. Used to calculate the framerate for recording (depends on PAL/NTSC, frameskip).
RawFrame object that can be used for building the next frame.

Definition at line 330 of file

References openmsx::AviRecorder::addImage(), getCliComm(), openmsx::RenderSettings::getDeflicker(), openmsx::RenderSettings::getDeinterlace(), openmsx::RenderSettings::getInterleaveBlackFrame(), openmsx::VideoLayer::needRecord(), openmsx::FrameSource::NONINTERLACED, openmsx::FrameSource::ODD, openmsx::CliComm::printWarning(), random_float(), openmsx::Schedulable::setSyncPoint(), and openmsx::AviRecorder::stop().

◆ setRecorder()

void openmsx::PostProcessor::setRecorder ( AviRecorder recorder_)

Start/stop recording.

recorder_Finished frames should be pushed to this AviRecorder. Can also be nullptr, meaning recording is stopped.

Definition at line 83 of file PostProcessor.hh.

◆ setSuperimposeVdpFrame()

void openmsx::PostProcessor::setSuperimposeVdpFrame ( const FrameSource vdpSource)

Set the VDP frame on which to superimpose the 'normal' output of this PostProcessor.

This is similar to the method above, except that now the superimposing is done before scaling. IOW both frames get scaled.

Definition at line 74 of file PostProcessor.hh.

◆ setSuperimposeVideoFrame()

void openmsx::PostProcessor::setSuperimposeVideoFrame ( const RawFrame videoSource)

Set the Video frame on which to superimpose the 'normal' output of this PostProcessor.

Superimpose is done (preferably) after the normal output is scaled. IOW the video frame is (preferably) left unchanged, though exceptions are e.g. scalers that render scanlines, those are preferably also visible in the video frame.

Definition at line 65 of file PostProcessor.hh.

◆ takeRawScreenShot()

void openmsx::PostProcessor::takeRawScreenShot ( unsigned  height,
const std::string &  filename 

Create a raw (=non-post-processed) screenshot.

The 'height' parameter should be either '240' or '480'. The current image will be scaled to '320x240' or '640x480' and written to a png file.

Implements openmsx::VideoLayer.

Definition at line 160 of file

References openmsx::PNG::saveRGBA(), and VLA.

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