openMSX
DirectScalerOutput.cc
Go to the documentation of this file.
1 #include "DirectScalerOutput.hh"
2 #include "OutputSurface.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_)
12 {
13 }
14 
15 template<typename Pixel>
17 {
18  return output.getWidth();
19 }
20 
21 template<typename Pixel>
23 {
24  return output.getHeight();
25 }
26 
27 template<typename Pixel>
29 {
30  return output.getLinePtrDirect<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 = output.getLinePtrDirect<Pixel>(y);
44  memset(dstLine, output.getWidth(), 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
unsigned getWidth() const override
A frame buffer where pixels can be written to.
uint32_t Pixel
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
Pixel * acquireLine(unsigned y) override
Pixel * getLinePtrDirect(unsigned y)
Returns a pointer to the requested line in the pixel buffer.
void releaseLine(unsigned y, Pixel *buf) override
unsigned getHeight() const override
DirectScalerOutput(OutputSurface &output)