openMSX
|
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>
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. More... | |
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... | |
FrameSource * | getPaintFrame () const |
Get the frame that would be displayed. More... | |
void | takeRawScreenShot (unsigned height, const std::string &filename) override |
Create a raw (=non-post-processed) 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 |
virtual void | takeRawScreenShot (unsigned height, const std::string &filename)=0 |
Create a raw (=non-post-processed) screenshot. More... | |
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... | |
bool | isActive () const |
Coverage | getCoverage () const |
Query the coverage of this layer. More... | |
void | setDisplay (LayerListener &display_) |
Store pointer to Display. More... | |
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_IMGUI = 45 , Z_OSDGUI = 50 } |
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... | |
![]() | |
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 | |
~Observer ()=default | |
Observer (const Observer &)=delete | |
Observer & | operator= (const Observer &)=delete |
virtual void | update (const Setting &subject) noexcept=0 |
virtual void | subjectDeleted (const Setting &) |
A post processor builds the frame that is displayed from the MSX frame, while applying effects such as scalers, noise etc.
Definition at line 32 of file PostProcessor.hh.
openmsx::PostProcessor::PostProcessor | ( | MSXMotherBoard & | motherBoard, |
Display & | display, | ||
OutputSurface & | screen, | ||
const std::string & | videoSource, | ||
unsigned | maxWidth, | ||
unsigned | height, | ||
bool | canDoInterlace | ||
) |
Definition at line 41 of file PostProcessor.cc.
References gl::ShaderProgram::attach(), openmsx::Subject< T >::attach(), gl::ShaderProgram::bindAttribLocation(), openmsx::RenderSettings::getHorizontalStretch(), openmsx::RenderSettings::getHorizontalStretchSetting(), openmsx::RenderSettings::getNoise(), openmsx::RenderSettings::getNoiseSetting(), and gl::ShaderProgram::link().
|
override |
Definition at line 86 of file PostProcessor.cc.
References openmsx::Subject< T >::detach(), getCliComm(), openmsx::RenderSettings::getHorizontalStretchSetting(), openmsx::RenderSettings::getNoiseSetting(), openmsx::CliComm::printWarning(), and openmsx::AviRecorder::stop().
CliComm & openmsx::PostProcessor::getCliComm | ( | ) |
Definition at line 112 of file PostProcessor.cc.
References openmsx::Display::getCliComm().
Referenced by rotateFrames(), and ~PostProcessor().
|
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 92 of file PostProcessor.hh.
|
inline |
Is recording active.
ATM used to keep frameskip constant during recording.
Definition at line 86 of file PostProcessor.hh.
|
overridevirtual |
Paint this layer.
Implements openmsx::Layer.
Definition at line 212 of file PostProcessor.cc.
References gl::context, openmsx::GLScalerFactory::createScaler(), openmsx::RenderSettings::DEFORM_3D, find_unguarded(), gl::BufferObject::get(), openmsx::RenderSettings::getDisplayDeform(), openmsx::RenderSettings::getGlow(), openmsx::FrameSource::getHeight(), openmsx::RenderSettings::getHorizontalStretch(), openmsx::RenderSettings::getInterleaveBlackFrame(), openmsx::OutputSurface::getLogicalSize(), openmsx::RenderSettings::getScaleAlgorithm(), openmsx::OutputSurface::getViewOffset(), openmsx::OutputSurface::getViewSize(), and utf8::unchecked::size().
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.
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). |
Definition at line 332 of file PostProcessor.cc.
References openmsx::AviRecorder::addImage(), Math::e, openmsx::FrameSource::FIELD_NONINTERLACED, openmsx::FrameSource::FIELD_ODD, getCliComm(), openmsx::RenderSettings::getDeflicker(), openmsx::RenderSettings::getDeinterlace(), openmsx::RenderSettings::getInterleaveBlackFrame(), openmsx::VideoLayer::needRecord(), openmsx::CliComm::printWarning(), random_float(), openmsx::Schedulable::setSyncPoint(), and openmsx::AviRecorder::stop().
|
inline |
Start/stop recording.
recorder_ | Finished frames should be pushed to this AviRecorder. Can also be nullptr, meaning recording is stopped. |
Definition at line 81 of file PostProcessor.hh.
|
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 72 of file PostProcessor.hh.
|
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 63 of file PostProcessor.hh.
|
overridevirtual |
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 159 of file PostProcessor.cc.
References openmsx::PNG::saveRGBA(), and VLA.