Random pickiness.
Spaces at EOFs, indentation, etc. original commit: 7d6e79023cf9872e6f6af2f89961b742c6296f1d
This commit is contained in:
parent
d0ee91fc1d
commit
67b89ffbb2
|
@ -43,7 +43,7 @@
|
||||||
[(pair? M_0) M_0]
|
[(pair? M_0) M_0]
|
||||||
[else
|
[else
|
||||||
(error 'visible% "expects matrix or rectangle, given: ~e" M_0)])])
|
(error 'visible% "expects matrix or rectangle, given: ~e" M_0)])])
|
||||||
|
|
||||||
(define/public (get-M) (if M M R))
|
(define/public (get-M) (if M M R))
|
||||||
|
|
||||||
;; create a matrix from this instance
|
;; create a matrix from this instance
|
||||||
|
|
|
@ -24,20 +24,20 @@ instead of this scaling code, we use the dc<%>'s scaling code.
|
||||||
(provide/contract [scale-bitmap
|
(provide/contract [scale-bitmap
|
||||||
(-> bytes? natural-number/c natural-number/c (and/c real? (not/c negative?))
|
(-> bytes? natural-number/c natural-number/c (and/c real? (not/c negative?))
|
||||||
bytes?)])
|
bytes?)])
|
||||||
|
|
||||||
|
|
||||||
; bmbytes: a bytes which represents an image --
|
; bmbytes: a bytes which represents an image --
|
||||||
; its size is a multiple of 4, and each
|
; its size is a multiple of 4, and each
|
||||||
; four consecutive bytes represent alpha,r,g,b.
|
; four consecutive bytes represent alpha,r,g,b.
|
||||||
|
|
||||||
|
|
||||||
; scale: given a bmbytes,
|
; scale: given a bmbytes,
|
||||||
; return a new bmbytes scaled by k in each direction.
|
; return a new bmbytes scaled by k in each direction.
|
||||||
;
|
;
|
||||||
; TODO: this code is meant for scaling by (>= k 1);
|
; TODO: this code is meant for scaling by (>= k 1);
|
||||||
; if (< k 1) then the result will ignore ~ (1-k) of the original's pixels.
|
; if (< k 1) then the result will ignore ~ (1-k) of the original's pixels.
|
||||||
; We should really do a proper averaging for that case.
|
; We should really do a proper averaging for that case.
|
||||||
;
|
;
|
||||||
(define (scale-bitmap bmbytes w h k)
|
(define (scale-bitmap bmbytes w h k)
|
||||||
(let* {[new-w (round/e (* w k))]
|
(let* {[new-w (round/e (* w k))]
|
||||||
[new-h (round/e (* h k))]
|
[new-h (round/e (* h k))]
|
||||||
|
|
|
@ -161,7 +161,7 @@ needed to really make this work:
|
||||||
(send output-text last-position))
|
(send output-text last-position))
|
||||||
(hash-ref range-ht stx-object (λ () null))))))))
|
(hash-ref range-ht stx-object (λ () null))))))))
|
||||||
(pop!))])
|
(pop!))])
|
||||||
|
|
||||||
;; reset `path' and `next-push' for use in pp hooks.
|
;; reset `path' and `next-push' for use in pp hooks.
|
||||||
(set! path '())
|
(set! path '())
|
||||||
(set! next-push 0)
|
(set! next-push 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user