openMSX
LDSDLRasterizer.cc
Go to the documentation of this file.
1#include "LDSDLRasterizer.hh"
2#include "RawFrame.hh"
3#include "PostProcessor.hh"
4#include "OutputSurface.hh"
5#include "PixelFormat.hh"
6#include "build-info.hh"
7#include "components.hh"
8#include <cstdint>
9#include <memory>
10
11namespace openmsx {
12
13template<std::unsigned_integral Pixel>
15 OutputSurface& screen,
16 std::unique_ptr<PostProcessor> postProcessor_)
17 : postProcessor(std::move(postProcessor_))
18 , workFrame(std::make_unique<RawFrame>(screen.getPixelFormat(), 640, 480))
19{
20}
21
22template<std::unsigned_integral Pixel>
24
25template<std::unsigned_integral Pixel>
27{
28 return postProcessor.get();
29}
30
31template<std::unsigned_integral Pixel>
32void LDSDLRasterizer<Pixel>::frameStart(EmuTime::param time)
33{
34 workFrame = postProcessor->rotateFrames(std::move(workFrame), time);
35}
36
37template<std::unsigned_integral Pixel>
38void LDSDLRasterizer<Pixel>::drawBlank(int r, int g, int b)
39{
40 // We should really be presenting the "LASERVISION" text
41 // here, like the real laserdisc player does. Note that this
42 // changes when seeking or starting to play.
43 auto background = static_cast<Pixel>(workFrame->getPixelFormat().map(r, g, b));
44 for (auto y : xrange(480)) {
45 workFrame->setBlank(y, background);
46 }
47}
48
49template<std::unsigned_integral Pixel>
51{
52 return workFrame.get();
53}
54
55
56// Force template instantiation.
57#if HAVE_16BPP
58template class LDSDLRasterizer<uint16_t>;
59#endif
60#if HAVE_32BPP || COMPONENT_GL
61template class LDSDLRasterizer<uint32_t>;
62#endif
63
64} // namespace openmsx
int g
Rasterizer using a frame buffer approach: it writes pixels to a single rectangular pixel buffer.
LDSDLRasterizer(OutputSurface &screen, std::unique_ptr< PostProcessor > postProcessor)
void drawBlank(int r, int g, int b) override
void frameStart(EmuTime::param time) override
PostProcessor * getPostProcessor() const override
RawFrame * getRawFrame() override
A frame buffer where pixels can be written to.
Abstract base class for post processors.
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:15
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel
STL namespace.
constexpr auto xrange(T e)
Definition: xrange.hh:133