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
9{
10}
11
12void DoubledFrame::init(FrameSource* field_, int skip_)
13{
15 field = field_;
16 skip = skip_;
17 setHeight(2 * field->getHeight());
18}
19
20unsigned DoubledFrame::getLineWidth(unsigned line) const
21{
22 int t = narrow<int>(line) - skip;
23 return (t >= 0) ? field->getLineWidth(t / 2) : 1;
24}
25
26const void* DoubledFrame::getLineInfo(
27 unsigned line, unsigned& width, void* buf, unsigned bufWidth) const
28{
29 return field->getLineInfo(std::max(narrow<int>(line) - skip, 0) / 2, width, buf, bufWidth);
30}
31
32} // namespace openmsx
TclObject t
DoubledFrame(const PixelFormat &format)
Definition: DoubledFrame.cc:7
void init(FrameSource *field, int skip)
Definition: DoubledFrame.cc:12
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
virtual unsigned getLineWidth(unsigned line) const =0
Gets the number of display pixels on the given line.
void setHeight(unsigned height_)
Definition: FrameSource.hh:159
virtual const void * getLineInfo(unsigned line, unsigned &lineWidth, void *buf, unsigned bufWidth) const =0
Abstract implementation of getLinePtr().
void init(FieldType fieldType_)
(Re)initialize an existing FrameSource.
Definition: FrameSource.hh:39
unsigned getHeight() const
Gets the number of lines in this frame.
Definition: FrameSource.hh:49
@ FIELD_NONINTERLACED
Interlacing is off for this frame.
Definition: FrameSource.hh:27
constexpr vecN< N, T > max(const vecN< N, T > &x, const vecN< N, T > &y)
Definition: gl_vec.hh:284
void format(SectorAccessibleDisk &disk, bool dos1)
Format the given disk (= a single partition).
This file implemented 3 utility functions:
Definition: Autofire.cc:9