ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
test_pattern.h File Reference

Shared test pattern list and renderer used by the GigE transmitter. More...

#include <cstdint>
#include <QStringList>
#include "rtp/rtp.h"
#include "rtp/rtp_utils.h"
Include dependency graph for test_pattern.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

QStringList toolx::streams::testPatternNames ()
 The test pattern names in index order (same order as the RTP transmit table).
QString toolx::streams::testPatternName (int pattern)
 The name of a test pattern, as stored in configuration files.
int toolx::streams::testPatternIndex (const QString &name, int fallback=0)
 The index of the test pattern with a name.
bool toolx::streams::isAnimatedPattern (int pattern)
 Check if a pattern changes from frame to frame.
void toolx::streams::renderTestPattern (uint8_t *data, uint32_t width, uint32_t height, mediax::rtp::ColourspaceType encoding, int pattern, mediax::rtp::TestCardState &state)
 Render a test pattern into a buffer.

Variables

constexpr int toolx::streams::kWebcamPattern = 20
 Pattern index of the webcam source (frames are supplied by WebcamCapture, RGB24 only).
constexpr int toolx::streams::kElitePattern = 21
 Pattern index of the Elite ships, which cycle through the 13 ships of the game every 30 seconds.
constexpr int toolx::streams::kEliteShipPatternBase = 22
 Pattern index of the first Elite ship shown on its own, the rest follow in ship order.

Detailed Description

Shared test pattern list and renderer used by the GigE transmitter.

Function Documentation

◆ isAnimatedPattern()

bool toolx::streams::isAnimatedPattern ( int pattern)

Check if a pattern changes from frame to frame.

Parameters
patternthe pattern index
Returns
true if the pattern must be re-rendered for every frame

◆ renderTestPattern()

void toolx::streams::renderTestPattern ( uint8_t * data,
uint32_t width,
uint32_t height,
mediax::rtp::ColourspaceType encoding,
int pattern,
mediax::rtp::TestCardState & state )

Render a test pattern into a buffer.

The webcam pattern is not rendered here, the buffer is filled with black.

Parameters
datathe destination buffer (width * height * bytes per pixel of the encoding)
widththe image width in pixels
heightthe image height in pixels
encodingthe colourspace to render in
patternthe pattern index
statethe animation state (persist between calls for animated patterns)

◆ testPatternIndex()

int toolx::streams::testPatternIndex ( const QString & name,
int fallback = 0 )

The index of the test pattern with a name.

Configuration files hold the name rather than the index, so they survive patterns being added.

Parameters
namethe pattern name, as returned by testPatternName()
fallbackthe index returned when no pattern has the name
Returns
int the pattern index

◆ testPatternName()

QString toolx::streams::testPatternName ( int pattern)

The name of a test pattern, as stored in configuration files.

Parameters
patternthe pattern index
Returns
QString the name, empty if there is no such pattern

◆ testPatternNames()

QStringList toolx::streams::testPatternNames ( )

The test pattern names in index order (same order as the RTP transmit table).

Returns
QStringList the pattern names, ending with Elite and then one entry per ship by name