home *** CD-ROM | disk | FTP | other *** search
/ vis-ftp.cs.umass.edu / vis-ftp.cs.umass.edu.tar / vis-ftp.cs.umass.edu / pub / Software / ASCENDER / ascendMar8.tar / UMass / ISR / patch.lisp < prev    next >
Lisp/Scheme  |  1995-04-11  |  872b  |  23 lines

  1. ;;; -*- Mode:Common-Lisp; Package:ISR2;  Base:10; Patch-file:T -*-
  2. ;;;
  3.  
  4. ;;;   So far so good.  No patches to date,   6/20/91
  5.  
  6. ;;; Fix pixel-count so that it can take a pixelmap as well as a path to one
  7. ;;;           -- BAD 6/23/91.
  8. (defun pixel-count (token-pixelmap-path)
  9.   (with-lock (*scratch-bitplane-lock*)
  10.     (let* ((pixelmap (if (pixelmap-p token-pixelmap-path)
  11.              token-pixelmap-path
  12.              (value token-pixelmap-path)))
  13.        (extents (pixelmap-extents pixelmap))
  14.        (bitplane (pixelmap-bitplane pixelmap)))
  15.       (check-bitplane-and-extents extents bitplane)
  16.       (let ((min-x (minx-of extents))
  17.         (max-x (maxx-of extents))
  18.         (min-y (miny-of extents))
  19.         (max-y (maxy-of extents)))
  20.     (clear-scratch-bitplane)
  21.     (bitplane-to-scratch-plane extents bitplane :alu tv:alu-seta)
  22.     (scratch-bitplane-count (1+ (- max-x min-x)) (1+ (- max-y min-y)) min-x min-y)))))
  23.