clarify some notes and comments

This commit is contained in:
Matthew Flatt 2010-06-02 19:14:33 -06:00
parent 41ce8ece58
commit 233b131d9b
3 changed files with 23 additions and 7 deletions

View File

@ -154,7 +154,7 @@
(for/list ([i (in-range h)])
(let ([s (* i bw)])
(subbytes bstr s (+ s bw)))))])
(install-from-png-arrays s w h rows #t #f #f #t))
(install-bytes-rows s w h rows #t #f #f #t))
(values w h #t #f s #f)))]
(init-name 'bitmap%)))
@ -256,7 +256,7 @@
(destroy-png-reader r)
(let* ([s (cairo_image_surface_create CAIRO_FORMAT_ARGB32 w h)]
[pre? (and alpha? (memq kind '(png/alpha png/mask)))])
(install-from-png-arrays s w h rows b&w? alpha? pre? #f)
(install-bytes-rows s w h rows b&w? alpha? pre? #f)
(values s b&w?))))]
[(jpeg jpeg/alpha)
(let ([d (create-decompress in)])
@ -302,7 +302,7 @@
[alpha? #t]
[pre? #f]
[b&w? #f])
(install-from-png-arrays s w h rows b&w? alpha? pre? #f)
(install-bytes-rows s w h rows b&w? alpha? pre? #f)
(values s b&w?)))]
[(bmp bmp/mask bmp/alpha)
(let* ([s (cairo_image_surface_create CAIRO_FORMAT_ARGB32 10 10)])
@ -311,12 +311,26 @@
(let-values ([(w h rows) (read-xbm in)])
(if rows
(let ([s (cairo_image_surface_create CAIRO_FORMAT_ARGB32 w h)])
(install-from-png-arrays s w h rows #t #f #f #t)
(install-bytes-rows s w h rows #t #f #f #t)
(values s #t))
(values #f #f)))]
[else (values #f #f)])))
(define/private (install-from-png-arrays s w h rows b&w? alpha? pre? backward?)
;; s : Cairo bitmap surface
;; w, h : width and height in pixels
;; rows : a vector of `h' byte strings
;; b&w? : each bit in a byte string is a pixel (so each byte
;; string in `rows' is `(/ w 8)' bytes long)
;; if not `backward?': low bit is first and 0 is black
;; if `backward?': high bit is first and 1 is black
;; alpha? : relevant only if not `b&w?';
;; if true: each byte string has 4 bytes per pixel, RGBA
;; if false: each byte string has 3 bytes er pixel, RGB
;; pre? : should be #f if not `alpha?', otherwise a #t value
;; means that the RGB values should be multiplied by A value
;; (i.e., the values are not already pre-multiplied)
;; backward? : affects byte interpretation in `b&w?' mode; see above
(define/private (install-bytes-rows s w h rows b&w? alpha? pre? backward?)
(let* ([dest (begin
(cairo_surface_flush s)
(cairo_image_surface_get_data s))]

View File

@ -1,6 +1,8 @@
#lang scheme
(require "lzw.rkt")
;; FIXME: still need to handle transparency
(provide gif->rgba-rows)
(define-syntax-rule (when-debugging expr ...)

View File

@ -3,10 +3,10 @@ Mac OS X GRacket.
Get these packages (or newer, if compatible):
pkg-config-0.23.tar.gz
gettext-0.17.tar.gz
libpng-1.4.0.tar.gz
pixman-0.17.14.tar.gz
cairo-1.9.6.tar.gz
gettext-0.17.tar.gz
glib-2.22.4.tar.gz
pango-1.28.0.tar.gz
libjpeg62 (maybe in binary form)
@ -22,10 +22,10 @@ Patches:
Configures (where <dest> is some temporary area):
pkg-config: --prefix=<dest>
gettext: --prefix=<dest>
libpng: --prefix=<dest>
pixman: --prefix=<dest>
Cairo: PATH=<dest>/bin --disable-xlib --disable-ft --disable-fc --prefix=<dest>
gettext: --prefix=<dest>
glib: PATH=<dest>/bin CFLAGS=-I<dest>/include LDFLAGS=-L<dest>/lib --prefix=<dest>
Pango: PATH=<dest>/bin --without-x --with-included-modules=yes --with-dynamic-modules=no