OXYGENHUB
◆ main openmsx / src / video / ld / LDSDLRasterizer.cc
1.0 KiB · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#include "LDSDLRasterizer.hh"
2
3
#include "PixelOperations.hh"
4
#include "PostProcessor.hh"
5
#include "RawFrame.hh"
6
7
namespace openmsx {
8
9
LDSDLRasterizer::LDSDLRasterizer(
10
		std::unique_ptr<PostProcessor> postProcessor_)
11
	: postProcessor(std::move(postProcessor_))
12
	, workFrame(std::make_unique<RawFrame>(640, 480))
13
{
14
}
15
16
LDSDLRasterizer::~LDSDLRasterizer() = default;
17
18
PostProcessor* LDSDLRasterizer::getPostProcessor() const
19
{
20
	return postProcessor.get();
21
}
22
23
void LDSDLRasterizer::frameStart(EmuTime time)
24
{
25
	workFrame = postProcessor->rotateFrames(std::move(workFrame), time);
26
}
27
28
void LDSDLRasterizer::drawBlank(int r, int g, int b)
29
{
30
	// We should really be presenting the "LASERVISION" text
31
	// here, like the real laserdisc player does. Note that this
32
	// changes when seeking or starting to play.
33
	PixelOperations pixelOps;
34
	auto background = pixelOps.combine(r, g, b);
35
	for (auto y : xrange(480)) {
36
		workFrame->setBlank(y, background);
37
	}
38
}
39
40
RawFrame* LDSDLRasterizer::getRawFrame()
41
{
42
	return workFrame.get();
43
}
44
45
} // namespace openmsx