diff --git a/collects/mrlib/gif.rkt b/collects/mrlib/gif.rkt index 7c6f323e..17448855 100644 --- a/collects/mrlib/gif.rkt +++ b/collects/mrlib/gif.rkt @@ -4,10 +4,9 @@ scheme/class scheme/list net/gifwrite - scheme/contract) + racket/contract) - (provide write-gif - write-animated-gif) + (provide write-gif) (define (force-bm bm) (if (procedure? bm) (bm) bm)) @@ -76,6 +75,16 @@ (define (write-gif bm filename) (write-gifs (list bm) #f filename #f #f #f)) + (provide/contract + [write-animated-gif + (->i ((bms (and/c (listof (or/c (is-a?/c bitmap%) (-> (is-a?/c bitmap%)))) pair?)) + (delay (integer-in 0 4294967295)) + (filename (or/c path? string?))) + (#:one-at-a-time? (one-at-a-time? any/c) + #:last-frame-delay (last-frame-delay (or/c (integer-in 0 4294967295) false/c)) + #:loop? (Loop? (delay) (lambda (x) (and delay #t)))) + any)]) + (define (write-animated-gif bms delay filename #:one-at-a-time? [one-at-a-time? #f] #:last-frame-delay [last-frame-delay #f] diff --git a/collects/mrlib/scribblings/gif.scrbl b/collects/mrlib/scribblings/gif.scrbl index 0b4916ed..84766dd9 100644 --- a/collects/mrlib/scribblings/gif.scrbl +++ b/collects/mrlib/scribblings/gif.scrbl @@ -21,8 +21,10 @@ a simple algorithm; see @scheme[quantize]. If the bitmap has a mask bitmap via @method[bitmap% get-loaded-mask], it is used to determine transparent pixels in the generated GIF image.} -@defproc[(write-animated-gif [bitmaps (listof (or/c (is-a?/c bitmap%) - (-> (is-a?/c bitmap%))))] +@defproc[(write-animated-gif [bitmaps (and/c + (listof (or/c (is-a?/c bitmap%) + (-> (is-a?/c bitmap%)))) + pair?)] [delay-csec (integer-in 0 #xFFFFFFFF)] [filename path-string] [#:loop loop? any/c (and delay-csec #t)]