Optimise for minimal memory

This commit is contained in:
2025-07-15 22:13:17 +02:00
parent 480a38baac
commit 71535ec456
6 changed files with 86 additions and 13 deletions

View File

@@ -15,12 +15,25 @@ public class HomeController(IMediator mediator) : ControllerBase
return Ok(await mediator.Send(new Weather.Command()));
}
[HttpGet("default.png")]
[HttpGet("default.bmp")]
public async Task<IActionResult> GetImage()
{
return File(await mediator.Send(new ImageGeneration.Command()), "image/png");
return File(await mediator.Send(new ImageGeneration.Command()), "image/bmp");
}
/*[HttpGet("screen/buffers")]
public async Task<IActionResult> GetCombinedBuffers()
{
var (black, red) = await mediator.Send(new ImageGeneration.Command());
// Combine buffers
byte[] combined = new byte[black.Length + red.Length];
Buffer.BlockCopy(black, 0, combined, 0, black.Length);
Buffer.BlockCopy(red, 0, combined, black.Length, red.Length);
return File(combined, "application/octet-stream");
}*/
[HttpGet("departureboard")]
public async Task<ActionResult<List<TimeTable>>> GetDepartureBoard()
{