Test Cards¶
MediaX includes a set of built-in test card generators for calibration and testing. These can be used programmatically via the C++ API or generated as PNG files using the testcard_generator tool.
Generating Test Cards¶
Build and run the test card generator:
cmake .. -DEXAMPLES=ON
make testcard_generator
./bin/testcard_generator <output_directory> [width] [height]
By default, cards are generated at 640x480 resolution. Specify an output directory as the first argument, and optionally width and height:
./bin/testcard_generator ../images/testcards 1920 1080
Static Calibration Cards¶
EBU Colour Bars¶

Standard EBU colour bars — CreateColourBarEbuTestCard()
Colour Bars¶

Standard colour bars — CreateColourBarTestCard()
Grey Scale Bars¶

Grey scale gradient bars — CreateGreyScaleBarTestCard()
Quad¶

Four-quadrant colour test card — CreateQuadTestCard()
Checkered¶

Checkered pattern — CreateCheckeredTestCard()
White Noise¶

Random white noise — CreateWhiteNoiseTestCard()
Solid Colours¶

Solid colour fills — CreateSolidTestCard(r, g, b)
Professional Calibration Cards¶
SMPTE¶

SMPTE colour bars — CreateSmpteTestCard()
Zone Plate¶

Zone plate resolution chart — CreateZonePlateTestCard()
Gradient¶

Smooth gradient — CreateGradientTestCard()
Crosshatch¶

Crosshatch alignment grid — CreateCrosshatchTestCard()
Animated Cards¶
These test cards produce animated sequences. A single representative frame is shown below.
Bouncing Ball¶

Animated bouncing ball — CreateBouncingBallTestCard()
Rotating Cube¶

Animated rotating cube — CreateRotatingCubeTestCard()
Moving Sweep¶

Animated moving sweep — CreateMovingSweepTestCard()
Scrolling Text¶

Animated scrolling text — CreateScrollingTextTestCard()
Pulsing Circle¶

Animated pulsing circle — CreatePulsingCircleTestCard()
Usage in Code¶
#include "rtp/rtp_utils.h"
// Allocate RGB24 buffer
std::vector<uint8_t> buffer(width * height * 3);
auto colourspace = mediax::rtp::ColourspaceType::kColourspaceRgb24;
// Generate a test card into the buffer
CreateColourBarEbuTestCard(buffer.data(), width, height, colourspace);
CreateSmpteTestCard(buffer.data(), width, height, colourspace);
CreateBouncingBallTestCard(buffer.data(), width, height, colourspace);