openMSX
|
Utility class for converting VRAM contents to host pixels. More...
#include <BitmapConverter.hh>
Public Types | |
using | Pixel = uint32_t |
using | DPixel = uint64_t |
Public Member Functions | |
BitmapConverter (std::span< const Pixel, 16 *2 > palette16, std::span< const Pixel, 256 > palette256, std::span< const Pixel, 32768 > palette32768) | |
Create a new bitmap scanline converter. | |
void | convertLine (std::span< Pixel > buf, std::span< const byte, 128 > vramPtr) |
Convert a line of V9938 VRAM to 256 or 512 host pixels. | |
void | convertLinePlanar (std::span< Pixel > buf, std::span< const byte, 128 > vramPtr0, std::span< const byte, 128 > vramPtr1) |
Convert a line of V9938 VRAM to 256 or 512 host pixels. | |
void | setDisplayMode (DisplayMode mode_) |
Select the display mode to use for scanline conversion. | |
void | palette16Changed () |
Inform this class about changes in the palette16 array. | |
Utility class for converting VRAM contents to host pixels.
Definition at line 15 of file BitmapConverter.hh.
using openmsx::BitmapConverter::DPixel = uint64_t |
Definition at line 19 of file BitmapConverter.hh.
using openmsx::BitmapConverter::Pixel = uint32_t |
Definition at line 18 of file BitmapConverter.hh.
openmsx::BitmapConverter::BitmapConverter | ( | std::span< const Pixel, 16 *2 > | palette16, |
std::span< const Pixel, 256 > | palette256, | ||
std::span< const Pixel, 32768 > | palette32768 | ||
) |
Create a new bitmap scanline converter.
palette16 | Pointer to 2*16-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Though to allow some internal optimizations, this class should be informed about changes in this array (not needed for the next two), see palette16Changed(). Used for display modes Graphic4, Graphic5 and Graphic6. First 16 entries are for even pixels, next 16 are for odd pixels |
palette256 | Pointer to 256-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Used for display mode Graphic7. |
palette32768 | Pointer to 32768-entries array that specifies VDP color index to host pixel mapping. This is kept as a pointer, so any changes to the palette are immediately picked up by convertLine. Used when YJK filter is active. |
Definition at line 15 of file BitmapConverter.cc.
void openmsx::BitmapConverter::convertLine | ( | std::span< Pixel > | buf, |
std::span< const byte, 128 > | vramPtr | ||
) |
Convert a line of V9938 VRAM to 256 or 512 host pixels.
Call this method in non-planar display modes (Graphic4 and Graphic5).
buf | Buffer where host pixels will be written to. Depending on the screen mode, the buffer must contain at least 256 or 512 pixels, but more is allowed (the extra pixels aren't touched). |
vramPtr | Pointer to VRAM contents. |
Definition at line 40 of file BitmapConverter.cc.
References openmsx::DisplayMode::getByte(), openmsx::DisplayMode::GRAPHIC4, openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::DisplayMode::GRAPHIC7, UNREACHABLE, openmsx::DisplayMode::YAE, and openmsx::DisplayMode::YJK.
void openmsx::BitmapConverter::convertLinePlanar | ( | std::span< Pixel > | buf, |
std::span< const byte, 128 > | vramPtr0, | ||
std::span< const byte, 128 > | vramPtr1 | ||
) |
Convert a line of V9938 VRAM to 256 or 512 host pixels.
Call this method in planar display modes (Graphic6 and Graphic7).
buf | Buffer where host pixels will be written to. Depending on the screen mode, the buffer must contain at least 256 or 512 pixels, but more is allowed (the extra pixels aren't touched). |
vramPtr0 | Pointer to VRAM contents, first plane. |
vramPtr1 | Pointer to VRAM contents, second plane. |
Definition at line 72 of file BitmapConverter.cc.
References openmsx::DisplayMode::getByte(), openmsx::DisplayMode::GRAPHIC4, openmsx::DisplayMode::GRAPHIC5, openmsx::DisplayMode::GRAPHIC6, openmsx::DisplayMode::GRAPHIC7, UNREACHABLE, openmsx::DisplayMode::YAE, and openmsx::DisplayMode::YJK.
|
inline |
Inform this class about changes in the palette16 array.
Definition at line 79 of file BitmapConverter.hh.
Referenced by openmsx::SDLRasterizer::setPalette().
|
inline |
Select the display mode to use for scanline conversion.
mode_ | The new display mode. |
Definition at line 72 of file BitmapConverter.hh.
Referenced by openmsx::SDLRasterizer::setDisplayMode().