Appearance
VideoPortAPI
cpp
#include <VAmiga.h>cpp
class VideoPortAPIDefined in VAmiga.h:1918
API of the video port.
Public Methods
| Return | Name | Description |
|---|---|---|
void | lockTexture | Locks the emulator texture. |
void | unlockTexture | Unlocks the emulator texture. |
const u32 * | getTexture const | Returns a pointer to the most recent stable texture. |
const u32 * | getTexture const | Returns the most recent stable texture together with its frame number and long-frame flags. |
const u32 * | getXrayTexture const | Returns a pointer to the most recent stable X-Ray texture. |
const u32 * | getXrayTexture const | Returns the most recent stable X-Ray texture together with its frame number. |
void | saveTexture const | Saves the most recent stable texture as a PNG file. |
void | saveTexture const | Saves a cutout of the most recent stable texture as a PNG file. |
void | saveXrayTexture const | Saves the most recent stable X-Ray texture as a PNG file. |
void | saveXrayTexture const | Saves a cutout of the most recent stable X-Ray texture as a PNG file. |
void | findInnerArea const | Determines the area of the texture that contains picture data. |
void | findInnerAreaNormalized const | Determines the picture area relative to the texture size (see findInnerArea()). |
const VideoPortConfig & | getConfig const | Returns the component's current configuration. |
const VideoPortInfo & | getInfo const | Returns the component's current state. |
const VideoPortInfo & | getCachedInfo const | Returns the most recent state snapshot recorded by the emulator thread (see getInfo()). |
lockTexture
cpp
void lockTexture()Defined in VAmiga.h:1951
Locks the emulator texture.
This function aquires a mutex that prevents the emulator to modify the stable texture. Call this function prior to getTexture().
unlockTexture
cpp
void unlockTexture()Defined in VAmiga.h:1958
Unlocks the emulator texture.
This function releases the mutex acquired in lockTexture(). Call this function when the pointer returned by getTexture() is no longer needed.
getTexture
const
cpp
const u32 * getTexture() constDefined in VAmiga.h:1970
Returns a pointer to the most recent stable texture.
The texture dimensions are given by constants vamiga::Tex::width and vamiga::Tex::height texels. Each texel is represented by a 32 bit color value.
The second version also returns the frame number (nr) and the long-frame flags of the frame and its predecessor (lof, prevlof), which are needed to weave the fields of an interlaced picture.
getTexture
const
cpp
const u32 * getTexture(isize * nr, bool * lof, bool * prevlof) constDefined in VAmiga.h:1972
Returns the most recent stable texture together with its frame number and long-frame flags.
getXrayTexture
const
cpp
const u32 * getXrayTexture() constDefined in VAmiga.h:1981
Returns a pointer to the most recent stable X-Ray texture.
The texture dimensions are given by constants vamiga::Tex::width and vamiga::Tex::height texels. Each texel is represented by a 32 bit color value. The second version also returns the frame number (nr), which matches the number of the regular texture of the same frame.
getXrayTexture
const
cpp
const u32 * getXrayTexture(isize * nr) constDefined in VAmiga.h:1983
Returns the most recent stable X-Ray texture together with its frame number.
saveTexture
const
cpp
void saveTexture(const std::filesystem::path & path) constDefined in VAmiga.h:1993
Saves the most recent stable texture as a PNG file.
The cutout is given in texels of the texture (x: super-hires pixels, y: lines). The upper bounds x2 and y2 are exclusive. Without a cutout, the entire texture is saved.
Exceptions
| Exception | Description |
|---|---|
Error | if the file cannot be written. |
saveTexture
const
cpp
void saveTexture(const std::filesystem::path & path, isize x1, isize x2, isize y1, isize y2) constDefined in VAmiga.h:1995
Saves a cutout of the most recent stable texture as a PNG file.
saveXrayTexture
const
cpp
void saveXrayTexture(const std::filesystem::path & path) constDefined in VAmiga.h:2002
Saves the most recent stable X-Ray texture as a PNG file.
Exceptions
| Exception | Description |
|---|---|
Error | if the file cannot be written. |
saveXrayTexture
const
cpp
void saveXrayTexture(const std::filesystem::path & path, isize x1, isize x2, isize y1, isize y2) constDefined in VAmiga.h:2004
Saves a cutout of the most recent stable X-Ray texture as a PNG file.
findInnerArea
const
cpp
void findInnerArea(isize & x1, isize & x2, isize & y1, isize & y2) constDefined in VAmiga.h:2026
Determines the area of the texture that contains picture data.
The function analyzes the current stable texture. It starts with a large box and shrinks it from all four sides as long as the outermost row or column only consists of pixels in the border color (the color of the pixel in the upper left corner of the box). The result can be used to crop the border of the picture. The emulator thread is suspended while the texture is analyzed. If the texture contains no picture data, all coordinates are 0.
findInnerArea() returns the coordinates in texture pixels, findInnerAreaNormalized() returns them relative to the size of the texture (0.0 ... 1.0).
Parameters
| Parameter | Type | Description |
|---|---|---|
x1 | isize & | Left edge of the picture area |
x2 | isize & | Right edge of the picture area |
y1 | isize & | Top edge of the picture area |
y2 | isize & | Bottom edge of the picture area |
findInnerAreaNormalized
const
cpp
void findInnerAreaNormalized(double & x1, double & x2, double & y1, double & y2) constDefined in VAmiga.h:2028
Determines the picture area relative to the texture size (see findInnerArea()).
getConfig
const
cpp
const VideoPortConfig & getConfig() constDefined in VAmiga.h:1928
Returns the component's current configuration.
getInfo
const
cpp
const VideoPortInfo & getInfo() constDefined in VAmiga.h:1939
Returns the component's current state.
getInfo() reads the live state on the calling thread. The result is only consistent if the emulator is paused or suspended. getCachedInfo() returns the snapshot the emulator thread has recorded most recently, which is the one to use while the emulator runs. Both return references that can be overwritten by a later call or by the emulator thread, so copy the data if you need to keep it.
getCachedInfo
const
cpp
const VideoPortInfo & getCachedInfo() constDefined in VAmiga.h:1941
Returns the most recent state snapshot recorded by the emulator thread (see getInfo()).