openMSX
|
Abstract base class for post processors. More...
#include <PostProcessor.hh>
Public Member Functions | |
~PostProcessor () override | |
virtual std::unique_ptr< RawFrame > | rotateFrames (std::unique_ptr< RawFrame > finishedFrame, EmuTime::param time) |
Sets up the "abcdFrame" variables for a new frame. More... | |
void | setSuperimposeVideoFrame (const RawFrame *videoSource) |
Set the Video frame on which to superimpose the 'normal' output of this PostProcessor. More... | |
void | setSuperimposeVdpFrame (const FrameSource *vdpSource) |
Set the VDP frame on which to superimpose the 'normal' output of this PostProcessor. More... | |
void | setRecorder (AviRecorder *recorder_) |
Start/stop recording. More... | |
bool | isRecording () const |
Is recording active. More... | |
unsigned | getBpp () const |
Get the number of bits per pixel for the pixels in these frames. More... | |
FrameSource * | getPaintFrame () const |
Get the frame that would be displayed. More... | |
void | takeRawScreenShot (unsigned height, const std::string &filename) override |
Create a raw (=non-postprocessed) screenshot. More... | |
CliComm & | getCliComm () |
![]() | |
VideoLayer (const VideoLayer &)=delete | |
VideoLayer & | operator= (const VideoLayer &)=delete |
int | getVideoSource () const |
Returns the ID for this videolayer. More... | |
int | getVideoSourceSetting () const |
void | setVideo9000Active (int video9000Source_, Video9000Active active) |
bool | needRender () const |
bool | needRecord () const |
![]() | |
virtual | ~Layer ()=default |
virtual void | paint (OutputSurface &output)=0 |
Paint this layer. More... | |
ZIndex | getZ () const |
Query the Z-index of this layer. More... | |
Coverage | getCoverage () const |
Query the coverage of this layer. More... | |
void | setDisplay (LayerListener &display_) |
Store pointer to Display. More... | |
Protected Member Functions | |
PostProcessor (MSXMotherBoard &motherBoard, Display &display, OutputSurface &screen, const std::string &videoSource, unsigned maxWidth, unsigned height, bool canDoInterlace) | |
![]() | |
VideoLayer (MSXMotherBoard &motherBoard, const std::string &videoSource) | |
~VideoLayer () override | |
void | update (const Setting &setting) noexcept override |
![]() | |
Layer (Coverage coverage_=COVER_NONE, ZIndex z_=Z_DUMMY) | |
Construct a layer. More... | |
void | setCoverage (Coverage coverage_) |
Changes the current coverage of this layer. More... | |
void | setZ (ZIndex z) |
Changes the current Z-index of this layer. More... | |
![]() | |
~Observer ()=default | |
virtual void | subjectDeleted (const Setting &) |
Static Protected Member Functions | |
static unsigned | getLineWidth (FrameSource *frame, unsigned y, unsigned step) |
Returns the maximum width for lines [y..y+step). More... | |
Protected Attributes | |
RenderSettings & | renderSettings |
Render settings. More... | |
OutputSurface & | screen |
The surface which is visible to the user. More... | |
std::unique_ptr< RawFrame > | lastFrames [4] |
The last 4 fully rendered (unscaled) MSX frames. More... | |
std::unique_ptr< DeinterlacedFrame > | deinterlacedFrame |
Combined the last two frames in a deinterlaced frame. More... | |
std::unique_ptr< DoubledFrame > | interlacedFrame |
Each line of the last frame twice, to get double vertical resolution. More... | |
std::unique_ptr< Deflicker > | deflicker |
Combine the last 4 frames into one 'flicker-free' frame. More... | |
std::unique_ptr< SuperImposedFrame > | superImposedFrame |
Result of superimposing 2 frames. More... | |
FrameSource * | paintFrame |
Represents a frame as it should be displayed. More... | |
AviRecorder * | recorder |
Video recorder, nullptr when not recording. More... | |
const RawFrame * | superImposeVideoFrame |
Video frame on which to superimpose the (VDP) output. More... | |
const FrameSource * | superImposeVdpFrame |
int | interleaveCount |
int | lastFramesCount |
int | maxWidth |
int | height |
Additional Inherited Members | |
![]() | |
enum | Video9000Active { INACTIVE , ACTIVE_FRONT , ACTIVE_BACK } |
![]() | |
enum | ZIndex { Z_DUMMY = -1 , Z_BACKGROUND = 0 , Z_MSX_PASSIVE = 30 , Z_MSX_ACTIVE = 40 , Z_OSDGUI = 50 , Z_CONSOLE = 100 } |
Determines stacking order of layers: layers with higher Z-indices are closer to the viewer. More... | |
enum | Coverage { COVER_FULL , COVER_PARTIAL , COVER_NONE } |
Describes how much of the screen is currently covered by a particular layer. More... | |
Abstract base class for post processors.
A post processor builds the frame that is displayed from the MSX frame, while applying effects such as scalers, noise etc. TODO: With some refactoring, it would be possible to move much or even all of the post processing code here instead of in the subclasses.
Definition at line 29 of file PostProcessor.hh.
|
override |
Definition at line 69 of file PostProcessor.cc.
References getCliComm(), openmsx::CliComm::printWarning(), recorder, and openmsx::AviRecorder::stop().
|
protected |
Definition at line 31 of file PostProcessor.cc.
References openmsx::SuperImposedFrame::create(), openmsx::Deflicker::create(), deflicker, deinterlacedFrame, openmsx::OutputSurface::getPixelFormat(), interlacedFrame, lastFrames, screen, and superImposedFrame.
unsigned openmsx::PostProcessor::getBpp | ( | ) | const |
Get the number of bits per pixel for the pixels in these frames.
Definition at line 272 of file PostProcessor.cc.
References openmsx::PixelFormat::getBpp(), openmsx::OutputSurface::getPixelFormat(), and screen.
Referenced by takeRawScreenShot().
CliComm & openmsx::PostProcessor::getCliComm | ( | ) |
Definition at line 80 of file PostProcessor.cc.
References openmsx::Display::getCliComm().
Referenced by rotateFrames(), and ~PostProcessor().
|
staticprotected |
Returns the maximum width for lines [y..y+step).
Definition at line 85 of file PostProcessor.cc.
References openmsx::FrameSource::getLineWidth(), gl::max(), step, and xrange().
|
inline |
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 87 of file PostProcessor.hh.
References paintFrame.
|
inline |
Is recording active.
ATM used to keep frameskip constant during recording.
Definition at line 76 of file PostProcessor.hh.
References recorder.
|
virtual |
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.
finishedFrame | Frame that has just become available. |
time | The moment in time the frame becomes available. Used to calculate the framerate for recording (depends on PAL/NTSC, frameskip). |
Reimplemented in openmsx::GLPostProcessor, and openmsx::FBPostProcessor< Pixel >.
Definition at line 95 of file PostProcessor.cc.
References openmsx::AviRecorder::addImage(), deflicker, deinterlacedFrame, openmsx::FrameSource::FIELD_NONINTERLACED, openmsx::FrameSource::FIELD_ODD, getCliComm(), openmsx::RenderSettings::getDeflicker(), openmsx::RenderSettings::getDeinterlace(), openmsx::RenderSettings::getInterleaveBlackFrame(), openmsx::MSXException::getMessage(), openmsx::OutputSurface::getPixelFormat(), height, interlacedFrame, lastFrames, lastFramesCount, maxWidth, openmsx::VideoLayer::needRecord(), paintFrame, openmsx::CliComm::printWarning(), recorder, renderSettings, screen, openmsx::Schedulable::setSyncPoint(), openmsx::AviRecorder::stop(), superImposedFrame, superImposeVdpFrame, and unlikely.
Referenced by openmsx::FBPostProcessor< Pixel >::rotateFrames(), and openmsx::GLPostProcessor::rotateFrames().
|
inline |
Start/stop recording.
recorder_ | Finished frames should be pushed to this AviRecorder. Can also be nullptr, meaning recording is stopped. |
Definition at line 71 of file PostProcessor.hh.
References recorder.
|
inline |
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 62 of file PostProcessor.hh.
References superImposeVdpFrame.
|
inline |
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 53 of file PostProcessor.hh.
References superImposeVideoFrame.
|
overridevirtual |
Create a raw (=non-postprocessed) 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 259 of file PostProcessor.cc.
References openmsx::filename, getBpp(), openmsx::FrameSource::getPixelFormat(), paintFrame, and VLA.
|
protected |
Combine the last 4 frames into one 'flicker-free' frame.
Definition at line 121 of file PostProcessor.hh.
Referenced by PostProcessor(), and rotateFrames().
|
protected |
Combined the last two frames in a deinterlaced frame.
Definition at line 115 of file PostProcessor.hh.
Referenced by PostProcessor(), and rotateFrames().
|
protected |
Definition at line 143 of file PostProcessor.hh.
Referenced by rotateFrames().
|
protected |
Each line of the last frame twice, to get double vertical resolution.
Definition at line 118 of file PostProcessor.hh.
Referenced by PostProcessor(), and rotateFrames().
|
protected |
Definition at line 140 of file PostProcessor.hh.
Referenced by openmsx::GLPostProcessor::paint().
|
protected |
The last 4 fully rendered (unscaled) MSX frames.
Definition at line 112 of file PostProcessor.hh.
Referenced by PostProcessor(), and rotateFrames().
|
protected |
Definition at line 141 of file PostProcessor.hh.
Referenced by rotateFrames().
|
protected |
Definition at line 142 of file PostProcessor.hh.
Referenced by rotateFrames().
|
protected |
Represents a frame as it should be displayed.
This can be simply a RawFrame or two RawFrames combined in a DeinterlacedFrame or DoubledFrame.
Definition at line 130 of file PostProcessor.hh.
Referenced by getPaintFrame(), openmsx::GLPostProcessor::paint(), rotateFrames(), and takeRawScreenShot().
|
protected |
Video recorder, nullptr when not recording.
Definition at line 133 of file PostProcessor.hh.
Referenced by isRecording(), rotateFrames(), setRecorder(), and ~PostProcessor().
|
protected |
Render settings.
Definition at line 106 of file PostProcessor.hh.
Referenced by openmsx::FBPostProcessor< Pixel >::FBPostProcessor(), openmsx::GLPostProcessor::GLPostProcessor(), openmsx::GLPostProcessor::paint(), rotateFrames(), and openmsx::GLPostProcessor::~GLPostProcessor().
|
protected |
The surface which is visible to the user.
Definition at line 109 of file PostProcessor.hh.
Referenced by openmsx::FBPostProcessor< Pixel >::FBPostProcessor(), getBpp(), openmsx::GLPostProcessor::GLPostProcessor(), openmsx::GLPostProcessor::paint(), PostProcessor(), and rotateFrames().
|
protected |
Result of superimposing 2 frames.
Definition at line 124 of file PostProcessor.hh.
Referenced by PostProcessor(), and rotateFrames().
|
protected |
Definition at line 138 of file PostProcessor.hh.
Referenced by rotateFrames(), and setSuperimposeVdpFrame().
|
protected |
Video frame on which to superimpose the (VDP) output.
nullptr when not superimposing.
Definition at line 137 of file PostProcessor.hh.
Referenced by openmsx::GLPostProcessor::paint(), and setSuperimposeVideoFrame().