openMSX
DirectScalerOutput.cc
Go to the documentation of this file.
1 #include "DirectScalerOutput.hh"
2 #include "SDLOutputSurface.hh"
3 #include "MemoryOps.hh"
4 #include "build-info.hh"
5 #include <cstdint>
6 
7 namespace openmsx {
8 
9 template<typename Pixel>
11  : output(output_), pixelAccess(output.getDirectPixelAccess())
12 {
13 }
14 
15 template<typename Pixel>
17 {
18  return output.getLogicalWidth();
19 }
20 
21 template<typename Pixel>
23 {
24  return output.getLogicalHeight();
25 }
26 
27 template<typename Pixel>
29 {
30  return pixelAccess.getLinePtr<Pixel>(y);
31 }
32 
33 template<typename Pixel>
34 void DirectScalerOutput<Pixel>::releaseLine(unsigned /*y*/, Pixel* /*buf*/)
35 {
36  // nothing
37 }
38 
39 template<typename Pixel>
41 {
42  auto* dstLine = pixelAccess.getLinePtr<Pixel>(y);
44  memset(dstLine, output.getLogicalWidth(), color);
45 }
46 
47 
48 // Force template instantiation.
49 #if HAVE_16BPP
50 template class DirectScalerOutput<uint16_t>;
51 #endif
52 #if HAVE_32BPP
53 template class DirectScalerOutput<uint32_t>;
54 #endif
55 
56 } // namespace openmsx
void fillLine(unsigned y, Pixel color) override
DirectScalerOutput(SDLOutputSurface &output)
unsigned getWidth() const override
void releaseLine(unsigned y, Pixel *buf) override
Pixel * acquireLine(unsigned y) override
unsigned getHeight() const override
A frame buffer where pixels can be written to.
This file implemented 3 utility functions:
Definition: Autofire.cc:9
uint32_t Pixel