Skip to content
Browse files

add print-object method for images

  • Loading branch information...
1 parent 25ca2e7 commit c14edc1a4f27481b9635cbff829181df5bcaf102 @hanshuebner hanshuebner committed Sep 22, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 images.lisp
8 images.lisp
@@ -29,6 +29,14 @@
(in-package :cl-gd)
+(defmethod print-object ((image image) stream)
+ (print-unreadable-object (image stream :identity t :type t)
+ (format stream "ptr ~X size ~D/~D (~:[true color~;~:*~D color~:P~])"
+ (uffi:pointer-address (img image))
+ (image-width image) (image-height image)
+ (unless (true-color-p image)
+ (number-of-colors :image image)))))
(defun create-image (width height &optional true-color)
"Allocates and returns a GD image structure with size WIDTH x
HEIGHT. Creates a true color image if TRUE-COLOR is true. You are

0 comments on commit c14edc1

Please sign in to comment.
Something went wrong with that request. Please try again.