openMSX
LDSDLRasterizer.cc
Go to the documentation of this file.
1 #include "LDSDLRasterizer.hh"
2 #include "RawFrame.hh"
3 #include "PostProcessor.hh"
4 #include "VisibleSurface.hh"
5 #include "memory.hh"
6 #include "build-info.hh"
7 #include "components.hh"
8 
9 namespace openmsx {
10 
11 template <class Pixel>
13  VisibleSurface& screen,
14  std::unique_ptr<PostProcessor> postProcessor_)
15  : postProcessor(std::move(postProcessor_))
16  , workFrame(make_unique<RawFrame>(screen.getSDLFormat(), 640, 480))
17  , pixelFormat(screen.getSDLFormat())
18 {
19 }
20 
21 template <class Pixel>
23 {
24 }
25 
26 template <class Pixel>
28 {
29  return postProcessor.get();
30 }
31 
32 template <class Pixel>
34 {
35  workFrame = postProcessor->rotateFrames(std::move(workFrame),
37 }
38 
39 template<class Pixel>
40 void LDSDLRasterizer<Pixel>::drawBlank(int r, int g, int b)
41 {
42  // We should really be presenting the "LASERVISION" text
43  // here, like the real laserdisc player does. Note that this
44  // changes when seeking or starting to play.
45  auto background = static_cast<Pixel>(SDL_MapRGB(&pixelFormat, r, g, b));
46  for (int y = 0; y < 480; ++y) {
47  workFrame->setBlank(y, background);
48  }
49 }
50 
51 template<class Pixel>
53 {
54  return workFrame.get();
55 }
56 
57 
58 // Force template instantiation.
59 #if HAVE_16BPP
60 template class LDSDLRasterizer<word>;
61 #endif
62 #if HAVE_32BPP || COMPONENT_GL
63 template class LDSDLRasterizer<unsigned>;
64 #endif
65 
66 } // namespace openmsx