openMSX
DoubledFrame.cc
Go to the documentation of this file.
1#include "DoubledFrame.hh"
2#include "narrow.hh"
3#include <cstdint>
4
5namespace openmsx {
6
7void DoubledFrame::init(FrameSource* field_, int skip_)
8{
10 field = field_;
11 skip = skip_;
12 setHeight(2 * field->getHeight());
13}
14
15unsigned DoubledFrame::getLineWidth(unsigned line) const
16{
17 int t = narrow<int>(line) - skip;
18 return (t >= 0) ? field->getLineWidth(t / 2) : 1;
19}
20
21std::span<const FrameSource::Pixel> DoubledFrame::getUnscaledLine(
22 unsigned line, std::span<Pixel> helpBuf) const
23{
24 return field->getUnscaledLine(std::max(narrow<int>(line) - skip, 0) / 2, helpBuf);
25}
26
27} // namespace openmsx
TclObject t
void init(FrameSource *field, int skip)
Interface for getting lines from a video frame.
virtual unsigned getLineWidth(unsigned line) const =0
Gets the number of display pixels on the given line.
void setHeight(unsigned height_)
virtual std::span< const Pixel > getUnscaledLine(unsigned line, std::span< Pixel > helpBuf) const =0
Get a specific line, with the 'native' line-width.
void init(FieldType fieldType_)
(Re)initialize an existing FrameSource.
unsigned getHeight() const
Gets the number of lines in this frame.
@ FIELD_NONINTERLACED
Interlacing is off for this frame.
This file implemented 3 utility functions:
Definition Autofire.cc:11