1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: constructors kernel splitting unicode.case combinators
4 accessors images.bitmap images.tiff images.backend io.backend
8 ERROR: unknown-image-extension extension ;
10 : image-class ( path -- class )
11 file-extension >lower {
12 { "bmp" [ bitmap-image ] }
13 { "tiff" [ tiff-image ] }
14 [ unknown-image-extension ]
17 : load-image ( path -- image )
18 dup image-class new load-image* ;
20 : <image> ( path -- image )
21 load-image normalize-image ;