From 279d03cdb8ca420ffc09b5eccf09c59eb46e9d02 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 19 Jul 2022 14:43:04 +0200 Subject: Simplify pixel conversion function: Accessing the memory directly instead of an intermediate bytevector makes things easier but still this looks like it's the bottleneck of the whole thing. --- bytepusher.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bytepusher.scm b/bytepusher.scm index 54c7e28..1be1365 100644 --- a/bytepusher.scm +++ b/bytepusher.scm @@ -140,11 +140,10 @@ (len (* width height)) (base (make-bytevector len)) (final (make-bytevector (* 4 len)))) - (bytevector-copy! memory initial base 0 len) (let loop ((i 0)) (bytevector-u32-set! final (* 4 i) - (pixel->color-fast (bytevector-u8-ref base i)) + (pixel->color-fast (get-byte (+ i initial))) (endianness big)) (unless (= i (- len 1)) (loop (+ 1 i)))) final)) -- cgit v1.2.3