anchor.diff:  ;;; Note: Originally based on Troels' Henriksen's
   ;;; clim-demo:image-viewer
   ;;;
  +
   (in-package :spectacle)
   
   (defclass spectacle-gadget (value-gadget)
  
positive.code:                        (pattern image-pattern))
            viewer
          (setf pattern nil)
          (with-image-bounds (oldy oldx) image
            (let ((scale (apply #'min
                                (append (list (/ bounding-rectangle-height oldy))
                                        (list (/ bounding-rectangle-width oldx))))))
              (setf (first transform-parameters) scale
                    (second transform-parameters) scale
                    transform nil)))
          (setf image image)))))
  
  (define-spectacle-command (redraw  :name t :menu t)
      ()
    (let ((viewer (find-pane-named *application-frame* 'viewer)))
      (handle-repaint viewer (sheet-region viewer))))
  
  (define-spectacle-command (set-angle  :name t :menu t)
      ((degrees 'number :default 0 :insert-default t))
    (let ((viewer (find-pane-named *application-frame* 'viewer)))
      (with-accessors ((image gadget-value)
  
negative.code:         (run))))
  
  (defun rgb-image-to-climi-rgb-pattern (image)
    (declare (optimize (speed 3))
             (type 8-bit-rgb-image image))
    (with-image-bounds (y x) image
      (let ((cimg (make-32-bit-gray-image y x)))
        (declare (type 32-bit-gray-image cimg))
        (set-pixels (i j) cimg
          (multiple-value-bind (r g b)
              (pixel image i j)
  