Livt packages
Eccelerators.Matrix
Version 1.0.1
Reusable RGB matrix drawing, color conversion, animation pacing, and HUB75 display components for Livt.
Published files (48)
- ColorConverterTest.lvt
- ColorGainTest.lvt
- ColorSampleBitmap.lvt
- ConvertedPainterTest.lvt
- DisplayTestBitmap.lvt
- Hub75ChainTest.lvt
- Hub75Clock100Test.lvt
- Hub75Clock50Test.lvt
- Hub75Clock75Test.lvt
- Hub75Color6Test.lvt
- Hub75ColorTest.lvt
- Hub75Display4Test.lvt
- Hub75Display6Test.lvt
- Hub75FramebufferTest.lvt
- Hub75GeometryTest.lvt
- MatrixColorTest.lvt
- MatrixFramePacerTest.lvt
- MatrixPictureHoldTest.lvt
- MatrixPictureSequenceTest.lvt
- MatrixPipelineTest.lvt
- MatrixRendererPacingTest.lvt
- MatrixRendererTest.lvt
- MemoryDisplay.lvt
- RendererClient.lvt
tests/MatrixColorTest.lvt
namespace Eccelerators.Matrix.Tests
using Eccelerators.Matrix
using Eccelerators.Matrix.Hub75
/**
* Check public color packing and quantization independently at channel boundaries.
*/
@Test
component MatrixColorTest
{
/**
* Verify channel order, truncation, full scale and all sixteen red levels.
*/
@Test
fn PacksAndQuantizes()
{
assert MatrixColor.Rgb(0x12, 0x34, 0x56) == (0x123456 as logic[24])
assert MatrixColor.ToRgb444(0x123456 as logic[24]) == (0x135 as logic[12])
assert MatrixColor.ToRgb444(0xFFFFFF as logic[24]) == (0xFFF as logic[12])
assert MatrixColor.ToRgb444(0x0F0F0F as logic[24]) == (0 as logic[12])
assert MatrixColor.FromRgb111(0b101) == (0xFF00FF as logic[24])
for (var level = 0; level < 16; level++) {
assert MatrixColor.ToRgb444((level << 20) as logic[24]) == ((level << 8) as logic[12])
}
}
}