Browse files

deleted references to .h files in code (ignored anywa). changed refer…

…ence to libpng version and added note.
  • Loading branch information...
1 parent 4bfb478 commit 43fc177abe982b4e217691f24fbb92236a539835 @timsears committed Feb 7, 2012
Showing with 20 additions and 19 deletions.
  1. BIN Spectrum.png
  2. BIN Water-small.png
  3. BIN Water.png
  4. +1 −1 libpng.cabal
  5. +19 −18 src/Codec/Image/LibPNG.hs
View
BIN Spectrum.png
Deleted file not rendered
View
BIN Water-small.png
Deleted file not rendered
View
BIN Water.png
Deleted file not rendered
View
2 libpng.cabal
@@ -29,7 +29,7 @@ library
hs-source-dirs: src
extra-libraries: png
build-depends: base >= 4.2 && < 5
- ghc-options: -Wall -O2
+ ghc-options: -Wall -O2
if flag(threaded)
ghc-options: -threaded
View
37 src/Codec/Image/LibPNG.hs
@@ -93,8 +93,9 @@ pixelssFromImage image = mapM ( pixelsFromRow width ) rows where
width = widthImage image
rows = rowsImage image
+-- | EDIT THIS TO REFLECT THE VERSION OF libpng THAT YOU HAVE!
c_PNG_LIBPNG_VER_STRING :: CString
-c_PNG_LIBPNG_VER_STRING = unsafePerformIO $ newCString "1.2.44"
+c_PNG_LIBPNG_VER_STRING = unsafePerformIO $ newCString "1.5.8"
c_PNG_INTERLACE_NONE :: Int
c_PNG_INTERLACE_NONE = 0
@@ -111,17 +112,17 @@ c_PNG_COLOR_TYPE_RGB = 2
c_PNG_FILLER_AFTER :: Int
c_PNG_FILLER_AFTER = 1
-foreign import ccall "png.h png_create_read_struct"
+foreign import ccall "png_create_read_struct"
c_png_create_read_struct :: CString -> Ptr () -> Ptr () -> Ptr ()
-> IO PNG
-foreign import ccall "png.h png_create_write_struct"
+foreign import ccall "png_create_write_struct"
c_png_create_write_struct :: CString -> Ptr () -> Ptr () -> Ptr ()
-> IO PNG
type CFile = Ptr ()
-foreign import ccall "png.h png_init_io"
+foreign import ccall "png_init_io"
c_png_init_io :: PNG -> CFile -> IO ()
foreign import ccall "stdio.h fopen"
@@ -132,52 +133,52 @@ foreign import ccall "stdio.h fclose"
type PNGInfo = Ptr ()
-foreign import ccall "png.h png_create_info_struct"
+foreign import ccall "png_create_info_struct"
c_png_create_info_struct :: PNG -> IO PNGInfo
-foreign import ccall "png.h png_set_IHDR"
+foreign import ccall "png_set_IHDR"
c_png_set_IHDR :: PNG -> PNGInfo -> Word -> Word
-> Int -> Int -> Int -> Int -> Int
-> IO ()
-foreign import ccall "png.h png_get_IHDR"
+foreign import ccall "png_get_IHDR"
c_png_get_IHDR :: PNG -> PNGInfo -> Ptr Word -> Ptr Word
-> Ptr Int -> Ptr Int -> Ptr Int -> Ptr Int -> Ptr Int
-> IO ()
-foreign import ccall "png.h png_write_info"
+foreign import ccall "png_write_info"
c_png_write_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_read_info"
+foreign import ccall "png_read_info"
c_png_read_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_read_update_info"
+foreign import ccall "png_read_update_info"
c_png_read_update_info :: PNG -> PNGInfo -> IO ()
-foreign import ccall "png.h png_get_image_width"
+foreign import ccall "png_get_image_width"
c_png_get_image_width :: PNG -> PNGInfo -> IO Word
-foreign import ccall "png.h png_get_image_height"
+foreign import ccall "png_get_image_height"
c_png_get_image_height :: PNG -> PNGInfo -> IO Word
-foreign import ccall "png.h png_get_color_type"
+foreign import ccall "png_get_color_type"
c_png_get_color_type :: PNG -> PNGInfo -> IO Word8
-foreign import ccall "png.h png_set_filler"
+foreign import ccall "png_set_filler"
c_png_set_filler :: PNG -> Word -> Int -> IO ()
type RowPtrPointer = Ptr (Ptr Word8)
-foreign import ccall "png.h png_write_image"
+foreign import ccall "png_write_image"
c_png_write_image :: PNG -> RowPtrPointer -> IO ()
-foreign import ccall "png.h png_read_image"
+foreign import ccall "png_read_image"
c_png_read_image :: PNG -> RowPtrPointer -> IO ()
-foreign import ccall "png.h png_read_end"
+foreign import ccall "png_read_end"
c_png_read_end :: PNG -> Ptr () -> IO ()
-foreign import ccall "png.h png_write_end"
+foreign import ccall "png_write_end"
c_png_write_end :: PNG -> Ptr () -> IO ()
withForeignPtrs :: [ForeignPtr a] -> ([Ptr a] -> IO b) -> IO b

0 comments on commit 43fc177

Please sign in to comment.