anchor.diff:           ;; indexed-pattern may be used as a design in the rectangular-tile. If
            ;; it is bigger than our pattern we return +transparent-ink+.
            (element (if (array-in-bounds-p array y x)
  -                      (elt (pattern-designs pattern)
  -                           (aref (pattern-array pattern) y x))
  +                      (elt (pattern-designs pattern) (aref array y x))
                         +transparent-ink+)))
       (if (patternp element)
           ;; If design is a pattern we delegate the question
  
positive.code:          ;; indexed-pattern may be used as a design in the rectangular-tile. If
           ;; it is bigger than our pattern we return +transparent-ink+.
           (element (if (array-in-bounds-p array y x)
                        (elt (pattern-designs pattern)
                             (aref (pattern-array pattern) y x))
                        +transparent-ink+)))
      (if (patternp element)
          ;; If design is a pattern we delegate the question
  
negative.code:   ((array :type (simple-array (unsigned-byte 32) 2)))
    (:documentation "Helper class of RGBA result of another pattern."))
  
  (declaim (ftype (function (t) (values (unsigned-byte 32) &optional nil))
                  %rgba-value))
  (defun %rgba-value (element)
    "Helper function collapsing uniform design into 4-byte RGBA value."
    (flet ((transform (parameter)
             (logand (truncate (* parameter 255)) 255)))
      (etypecase element
        ((unsigned-byte 32) element)
        ;; Uniform-compositium is a masked-compositum rgb + opacity
        ((or color opacity uniform-compositum)
         (multiple-value-bind (red green blue opacity)
             (color-rgba element)
           (logior (ash (transform red)    24)
                   (ash (transform green)  16)
                   (ash (transform blue)    8)
                   (ash (transform opacity) 0))))
        (indirect-ink (%rgba-value (indirect-ink-ink element))))))
  
  (defgeneric %pattern-rgba-value (pattern x y)
    (:documentation "Returns a collapsed RGBA value for position [X, Y].")
    (:method ((pattern %rgba-pattern) (x fixnum) (y fixnum))
      (let ((array (pattern-array pattern)))
        (declare (type (array (unsigned-byte 32) 2) array))
        (if (array-in-bounds-p array y x)
            (aref array y x)
            #x00000000)))
    (:method ((pattern indirect-ink) x y)
      (%rgba-value (design-ink pattern x y)))
    (:method (design x y) ; fallback method
      (%rgba-value (design-ink design x y))))
  
  (defmethod design-ink ((pattern %rgba-pattern) x y)
    (let ((array (pattern-array pattern)))
      (declare (type (array (unsigned-byte 32) 2) array))
      (if (array-in-bounds-p array y x)
          (let* ((rgba-value (aref array y x))
                 (alpha (ldb (byte 8 0) rgba-value)))
            (flet ((color ()
                     (make-rgb-color (/ (ldb (byte 8 24) rgba-value) 255.0)
                                     (/ (ldb (byte 8 16) rgba-value) 255.0)
                                     (/ (ldb (byte 8  8) rgba-value) 255.0))))
              (case alpha
                (0 +transparent-ink+)
                (255 (color))
                (t (make-uniform-compositum (color) (/ alpha 255.0))))))
          +transparent-ink+)))
  
  (defgeneric %collapse-pattern (pattern)
  