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/ColorGainTest.lvt
namespace Eccelerators.Matrix.Tests
using Eccelerators.Matrix
using Eccelerators.Matrix.Hub75
/**
* Exhaustively checks bounded gain arithmetic against integer division.
*/
@Test
component ColorGainTest
{
gain: ColorGain
/**
* Owns the production scaler in the inherited test context.
*/
new()
{
this.gain = new ColorGain()
}
/**
* Covers every byte and every supported gain: 25,856 exact reference values.
*/
@Test
fn MatchesRoundedDivisionForEveryInput()
{
for (var percent = 0; percent <= 100; percent++) {
for (var value = 0; value < 256; value++) {
var expected = (value * percent + 50) / 100
var actual = this.gain.Scale(value as byte, percent as byte)
assert actual == (expected as byte)
}
}
}
}