! Copyright (C) 2021 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
-USING: accessors colors combinators generalizations io io.binary
+USING: accessors colors combinators endian generalizations io
io.encodings.binary io.files io.streams.byte-array kernel math
-math.bitwise namespaces sequences ;
+math.bitwise math.functions namespaces sequences ;
IN: tinyvg
[ read1 255 /f ] 4 call-n <rgba> ;
: write-rgba-8888 ( rgba -- )
- >rgba-components [ 255 * >integer write1 ] 4 napply ;
+ >rgba-components [ 255 * round >integer write1 ] 4 napply ;
: read-rgb-565 ( -- rgba )
2 read le>
C: <quadratic-bezier> quadratic-bezier
: read-tag ( -- line-width/f tag )
- read1 [ 4 bit? [ read-unit ] [ f ] if* ] [ 3 bits ] bi ;
+ read1 [ 4 bit? [ read-unit ] [ f ] if ] [ 3 bits ] bi ;
: read-arc ( -- large-arc? sweep? )
read1 [ 0 bit? ] [ 1 bit? ] bi ;