Make updates to the sixel image easier (e.g. changing algorithm)

This commit is contained in:
tznind
2024-10-04 07:49:00 +01:00
parent 9d5d853de3
commit 36a8cba6e4

View File

@@ -60,6 +60,7 @@ public class Images : Scenario
private RadioGroup _rgPaletteBuilder;
private RadioGroup _rgDistanceAlgorithm;
private NumericUpDown _popularityThreshold;
private SixelToRender _sixelImage;
public override void Main ()
{
@@ -438,13 +439,25 @@ public class Images : Scenario
_pxX.Value,
_pxY.Value);
// TODO: Static way of doing this, suboptimal
Application.Sixel.Add (
new()
{
SixelData = _encodedSixelData,
ScreenPosition = _screenLocationForSixel
});
if (_sixelImage == null)
{
_sixelImage = new ()
{
SixelData = _encodedSixelData,
ScreenPosition = _screenLocationForSixel
};
Application.Sixel.Add (_sixelImage);
}
else
{
_sixelImage.ScreenPosition = _screenLocationForSixel;
_sixelImage.SixelData = _encodedSixelData;
}
_sixelView.SetNeedsDisplay();
}
private void SixelViewOnDrawContent (object sender, DrawEventArgs e)