| 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 |
|
| 31 |
|
| 32 |
|
| 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 |
} |