From 60dc37269cd2dc8cdf23d9f77680f6af9490032f Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 30 May 2024 00:19:48 +0200 Subject: img, loader: separate out png codec into cgi, misc improvements * multi-processed and sandboxed PNG decoding & encoding (through local CGI) * improved request body passing (including support for output id as response body) * simplified & faster blob()/text() - now every request starts suspended, and OngoingData.buf has been replaced with loader's buffering capability * image caching: we no longer pull bitmaps from the container after every single getLines call Next steps: replace our bespoke PNG decoder with something more usable, add other decoders, and make them stream. --- src/img/bitmap.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/img/bitmap.nim') diff --git a/src/img/bitmap.nim b/src/img/bitmap.nim index 9f9b3401..a186b47f 100644 --- a/src/img/bitmap.nim +++ b/src/img/bitmap.nim @@ -8,7 +8,11 @@ type ImageBitmap* = ref object of Bitmap -proc newBitmap*(width, height: uint64): Bitmap = + NetworkBitmap* = ref object of Bitmap + outputId*: int + imageId*: int + +proc newBitmap*(width, height: uint64): ImageBitmap = return ImageBitmap( px: newSeq[ARGBColor](width * height), width: width, -- cgit 1.4.1-2-gfad0