summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2022-07-19 14:43:04 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2022-07-19 14:43:04 +0200
commit279d03cdb8ca420ffc09b5eccf09c59eb46e9d02 (patch)
tree0c382c67c18a1994d6cc70c60e19e61e623c3c51
parent647ca0c2fad0d4749792698ca09adfa9c6d1b23b (diff)
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.
-rw-r--r--bytepusher.scm3
1 files changed, 1 insertions, 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))