Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added error conditionification to ilu.

  • Loading branch information...
commit f975abf00fc5575b1d288ab8fc860442a805fa08 1 parent e932a38
@Ralith Ralith authored Josh Marchán committed
Showing with 52 additions and 28 deletions.
  1. +52 −28 ilu.lisp
View
80 ilu.lisp
@@ -47,47 +47,71 @@
(defcfun ("iluInit" init) :void)
-(defcfun ("iluAlienify" alienify) :boolean)
-(defcfun ("iluBlurAvg" blur-avg) :boolean (iter :uint))
-(defcfun ("iluBlurGaussian" blur-gaussian) :boolean (iter :uint))
-(defcfun ("iluBuildMipmaps" build-mipmaps) :boolean)
-(defcfun ("iluColoursUsed" colours-used) :boolean)
-(defcfun ("iluColoursUsed" colors-used) :boolean)
-(defcfun ("iluCompareImage" compare-image) :boolean (comp :uint))
-(defcfun ("iluContrast" contrast) :boolean (contrast :float))
-(defcfun ("iluCrop" crop) :boolean
+(defcfun ("iluAlienify" %alienify) :boolean)
+(deferrwrap alienify)
+(defcfun ("iluBlurAvg" %blur-avg) :boolean (iter :uint))
+(deferrwrap blur-avg (iter))
+(defcfun ("iluBlurGaussian" %blur-gaussian) :boolean (iter :uint))
+(deferrwrap blur-gaussian (iter))
+(defcfun ("iluBuildMipmaps" %build-mipmaps) :boolean)
+(deferrwrap build-mipmaps)
+(defcfun ("iluColoursUsed" %colours-used) :boolean)
+(deferrwrap colours-used)
+(defun colors-used ()
+ (colours-used))
+(defcfun ("iluCompareImage" %compare-image) :boolean (comp :uint))
+(deferrwrap compare-image (comp))
+(defcfun ("iluContrast" %contrast) :boolean (contrast :float))
+(deferrwrap contrast (contrast))
+(defcfun ("iluCrop" %crop) :boolean
(x-offset :uint) (y-offset :uint) (z-offset :uint)
(width :uint) (height :uint) (depth :uint))
+(deferrwrap crop (x y z width height depth))
(defcfun ("iluDeleteImage" delete-image) :void (id :uint))
-(defcfun ("iluEdgeDetectP" edge-detect-p) :boolean)
-(defcfun ("iluEdgeDetectS" edge-detect-s) :boolean)
-(defcfun ("iluEmboss" emboss) :boolean)
-(defcfun ("iluEnlargeCanvas" enlarge-canvas) :boolean
+(defcfun ("iluEdgeDetectP" %edge-detect-p) :boolean)
+(deferrwrap edge-detect-p)
+(defcfun ("iluEdgeDetectS" %edge-detect-s) :boolean)
+(deferrwrap edge-detect-s)
+(defcfun ("iluEmboss" %emboss) :boolean)
+(deferrwrap emboss)
+(defcfun ("iluEnlargeCanvas" %enlarge-canvas) :boolean
(width :uint) (height :uint) (depth :uint))
+(deferrwrap enlarge-canvas (width height depth))
(defcfun ("iluErrorString" error-string) :string
- (error il::error))
-(defcfun ("iluFlipImage" flip-image) :boolean)
-(defcfun ("iluGammaCorrect" gamma-correct) :boolean (gamma :float))
+ (error %il:error))
+(defcfun ("iluFlipImage" %flip-image) :boolean)
+(deferrwrap flip-image)
+(defcfun ("iluGammaCorrect" %gamma-correct) :boolean (gamma :float))
+(deferrwrap gamma-correct (gamma))
(defcfun ("iluGenImage" gen-image) :uint)
;; (defcfun ("iluGetImageInfo" get-image-info) :void (info :pointer))
(defcfun ("iluGetInteger" get-integer) :int (mode mode))
;; (defcfun ("iluGetString" get-string) :string)
;; (defcfun ("iluImageParameter" image-parameter) :void (pname pname) (param param))
-(defcfun ("iluInvertAlpha" invert-alpha) :boolean)
-(defcfun ("iluMirror" mirror) :boolean)
-(defcfun ("iluNegative" negative) :boolean)
-(defcfun ("iluNoisify" noisify) :boolean
+(defcfun ("iluInvertAlpha" %invert-alpha) :boolean)
+(deferrwrap invert-alpha)
+(defcfun ("iluMirror" %mirror) :boolean)
+(deferrwrap mirror)
+(defcfun ("iluNegative" %negative) :boolean)
+(deferrwrap negative)
+(defcfun ("iluNoisify" %noisify) :boolean
(x-dim :float) (y-dim :float) (z-dim :float))
-(defcfun ("iluPixelize" pixelize) :boolean (pix-size :uint))
-(defcfun ("iluRotate" rotate) :boolean (angle :float))
+(deferrwrap noisify (x y z))
+(defcfun ("iluPixelize" %pixelize) :boolean (pixel-size :uint))
+(deferrwrap pixelize (pixel-size))
+(defcfun ("iluRotate" %rotate) :boolean (angle :float))
+(deferrwrap rotate (angle))
(defcfun ("iluSaturate4f" saturate-4f) :boolean
(r :float) (g :float) (b :float))
(defun saturate (&key (r 1.0) (g 1.0) (b 1.0))
- (saturate-4f r g b))
-(defcfun ("iluScale" scale) :boolean
+ (maybe-error (saturate-4f r g b)))
+(defcfun ("iluScale" %scale) :boolean
(width :uint) (height :uint) (depth :uint))
-(defcfun ("iluSharpen" sharpen) :boolean
+(deferrwrap scale (width height depth))
+(defcfun ("iluSharpen" %sharpen) :boolean
(factor :float) (iter :uint))
-(defcfun ("iluSwapColours" swap-colours) :boolean)
-(defcfun ("iluSwapColours" swap-colors) :boolean)
-
+(deferrwrap sharpen (factor iter))
+(defcfun ("iluSwapColours" %swap-colours) :boolean)
+(deferrwrap swap-colours)
+(defun swap-colors ()
+ (swap-colours))
Please sign in to comment.
Something went wrong with that request. Please try again.