| Copyright | (c) Alexey Kuleshevich 2018 |
|---|---|
| License | BSD3 |
| Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Massiv.Array.IO
Contents
Description
Synopsis
- readArray :: Readable f arr => f -> ReadOptions f -> FilePath -> IO arr
- readImage :: (Source S Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> IO (Image S cs e)
- readImageAuto :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> IO (Image r cs e)
- writeArray :: Writable f arr => f -> WriteOptions f -> FilePath -> arr -> IO ()
- writeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> Image r cs e -> IO ()
- writeImageAuto :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => FilePath -> Image r cs e -> IO ()
- data ExternalViewer = ExternalViewer FilePath [String] Int
- displayImage :: Writable (Auto TIF) (Image r cs e) => Image r cs e -> IO ()
- displayImageUsing :: Writable (Auto TIF) (Image r cs e) => ExternalViewer -> Bool -> Image r cs e -> IO ()
- displayImageFile :: ExternalViewer -> FilePath -> IO ()
- defaultViewer :: ExternalViewer
- eogViewer :: ExternalViewer
- gpicviewViewer :: ExternalViewer
- fehViewer :: ExternalViewer
- gimpViewer :: ExternalViewer
- class Writable f arr where
- class Readable f arr where
- class (Default (ReadOptions f), Default (WriteOptions f), Show f) => FileFormat f where
- type ReadOptions f
- type WriteOptions f
- newtype Auto f = Auto f
- newtype Sequence f = Sequence f
- newtype EncodeError = EncodeError String
- newtype DecodeError = DecodeError String
- newtype ConvertError = ConvertError String
- type Image r cs e = Array r Ix2 (Pixel cs e)
- defaultReadOptions :: FileFormat f => f -> ReadOptions f
- defaultWriteOptions :: FileFormat f => f -> WriteOptions f
- data Encode out
- encodeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => [Encode (Image r cs e)] -> FilePath -> Image r cs e -> ByteString
- imageWriteFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => [Encode (Image r cs e)]
- imageWriteAutoFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => [Encode (Image r cs e)]
- data Decode out
- decodeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image r cs e)] -> FilePath -> ByteString -> Image r cs e
- imageReadFormats :: (Source S Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image S cs e)]
- imageReadAutoFormats :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image r cs e)]
- data BMP = BMP
- data GIF = GIF
- data WriteOptionsGIF
- woGetPaletteOptionsGIF :: WriteOptionsGIF -> PaletteOptions
- woSetPaletteOptionsGIF :: PaletteOptions -> WriteOptionsGIF -> WriteOptionsGIF
- data PaletteOptions = PaletteOptions {}
- data PaletteCreationMethod
- data WriteOptionsSequenceGIF
- woGetGifLoopingGIFs :: WriteOptionsSequenceGIF -> GifLooping
- woGetPaletteOptionsGIFs :: WriteOptionsSequenceGIF -> PaletteOptions
- woSetGifLoopingGIFs :: GifLooping -> WriteOptionsSequenceGIF -> WriteOptionsSequenceGIF
- woSetPaletteOptionsGIFs :: PaletteOptions -> WriteOptionsSequenceGIF -> WriteOptionsSequenceGIF
- type GifDelay = Int
- data GifLooping
- data HDR = HDR
- data JPG = JPG
- data WriteOptionsJPG
- woGetQualityJPG :: WriteOptionsJPG -> Word8
- woSetQualityJPG :: Word8 -> WriteOptionsJPG -> WriteOptionsJPG
- data PNG = PNG
- data TGA = TGA
- data TIF = TIF
- toAnyCS :: forall r' cs' e' r cs e. (Source r' Ix2 (Pixel cs' e'), Mutable r Ix2 (Pixel cs e), Storable (Pixel cs e), ColorSpace cs e, ToYA cs' e', ToRGBA cs' e', ToHSIA cs' e', ToCMYKA cs' e', ToYCbCrA cs' e') => Image r' cs' e' -> Maybe (Image r cs e)
- toJPImageY8 :: Source r Ix2 (Pixel Y Word8) => Image r Y Word8 -> Image Pixel8
- toJPImageYA8 :: Source r Ix2 (Pixel YA Word8) => Image r YA Word8 -> Image PixelYA8
- toJPImageY16 :: Source r Ix2 (Pixel Y Word16) => Image r Y Word16 -> Image Pixel16
- toJPImageYA16 :: Source r Ix2 (Pixel YA Word16) => Image r YA Word16 -> Image PixelYA16
- toJPImageYF :: Source r Ix2 (Pixel Y Float) => Image r Y Float -> Image PixelF
- toJPImageRGB8 :: Source r Ix2 (Pixel RGB Word8) => Image r RGB Word8 -> Image PixelRGB8
- toJPImageRGBA8 :: Source r Ix2 (Pixel RGBA Word8) => Image r RGBA Word8 -> Image PixelRGBA8
- toJPImageRGB16 :: Source r Ix2 (Pixel RGB Word16) => Image r RGB Word16 -> Image PixelRGB16
- toJPImageRGBA16 :: Source r Ix2 (Pixel RGBA Word16) => Image r RGBA Word16 -> Image PixelRGBA16
- toJPImageRGBF :: Source r Ix2 (Pixel RGB Float) => Image r RGB Float -> Image PixelRGBF
- toJPImageYCbCr8 :: Source r Ix2 (Pixel YCbCr Word8) => Image r YCbCr Word8 -> Image PixelYCbCr8
- toJPImageCMYK8 :: Source r Ix2 (Pixel CMYK Word8) => Image r CMYK Word8 -> Image PixelCMYK8
- fromDynamicImage :: forall cs e. (ColorSpace cs e, Source S Ix2 (Pixel cs e)) => DynamicImage -> Maybe (Image S cs e)
- fromAnyDynamicImage :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => DynamicImage -> Maybe (Image r cs e)
- data PBM = PBM
- data PGM = PGM
- data PPM = PPM
Reading
Arguments
| :: Readable f arr | |
| => f | File format that should be used while decoding the file |
| -> ReadOptions f | Any file format related decoding options. Use |
| -> FilePath | Path to the file |
| -> IO arr |
Read an array from one of the supported file formats.
Arguments
| :: (Source S Ix2 (Pixel cs e), ColorSpace cs e) | |
| => FilePath | File path for an image |
| -> IO (Image S cs e) |
Try to guess an image format from file's extension, then attempt to decode it as such. In order
to supply the format manually and thus avoid this guessing technique, use readArray
instead. Color space and precision of the result array must match exactly that of the actual
image, in order to apply auto conversion use readImageAuto instead.
Might throw ConvertError, DecodeError and other standard errors related to file IO.
Result image will be read as specified by the type signature:
>>>frog <- readImage "files/frog.jpg" :: IO (Image S YCbCr Word8)>>>displayImage frog
In case when the result image type does not match the color space or precision of the actual
image file, ConvertError will be thrown.
>>>frog <- readImage "files/frog.jpg" :: IO (Image S CMYK Word8)>>>displayImage frog*** Exception: ConvertError "Cannot decode JPG image <Image S YCbCr Word8> as <Image S CMYK Word8>"
Whenever image is not in the color space or precision that we need, either use readImageAuto or
manually convert to the desired one by using the appropriate conversion functions:
>>>frogCMYK <- readImageAuto "files/frog.jpg" :: IO (Image S CMYK Double)>>>displayImage frogCMYK
Arguments
| :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) | |
| => FilePath | File path for an image |
| -> IO (Image r cs e) |
Same as readImage, but will perform any possible color space and
precision conversions in order to match the result image type. Very useful
whenever image format isn't known at compile time.
Writing
Arguments
| :: Writable f arr | |
| => f | Format to use while encoding the array |
| -> WriteOptions f | Any file format related encoding options. Use |
| -> FilePath | |
| -> arr | |
| -> IO () |
writeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> Image r cs e -> IO () #
This function will guess an output file format from the file extension and will write to file
any image with the colorspace that is supported by that format. Precision of the image might be
adjusted using Elevator if precision of the source array is not supported by the image file
format. For instance an ( being saved as Image r RGBA Double)PNG file would be written as
(, thus using highest supported precision Image r RGBA Word16)Word16 for that
format. If automatic colors space is also desired, writeImageAuto can be used instead.
Can throw ConvertError, EncodeError and other usual IO errors.
writeImageAuto :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => FilePath -> Image r cs e -> IO () #
Write an image to file while performing all necessary precisiona and color space conversions.
Displaying
data ExternalViewer #
External viewing application to use for displaying images.
Constructors
| ExternalViewer FilePath [String] Int | Any custom viewer, which can be specified:
|
Instances
| Show ExternalViewer # | |
Defined in Data.Massiv.Array.IO Methods showsPrec :: Int -> ExternalViewer -> ShowS # show :: ExternalViewer -> String # showList :: [ExternalViewer] -> ShowS # | |
displayImage :: Writable (Auto TIF) (Image r cs e) => Image r cs e -> IO () #
Makes a call to an external viewer that is set as a default image viewer by the OS. This is a non-blocking function call, so it might take some time before an image will appear.
Arguments
| :: Writable (Auto TIF) (Image r cs e) | |
| => ExternalViewer | Image viewer program |
| -> Bool | Should a call block the cuurrent thread untul viewer is closed. |
| -> Image r cs e | |
| -> IO () |
An image is written as a .tiff file into an operating system's temporary
directory and passed as an argument to the external viewer program.
displayImageFile :: ExternalViewer -> FilePath -> IO () #
Displays an image file by calling an external image viewer.
Common viewers
defaultViewer :: ExternalViewer #
Default viewer is inferred from the operating system.
eog /tmp/hip/img.tiff
gpicviewViewer :: ExternalViewer #
gpicview /tmp/hip/img.tiff
feh --fullscreen --auto-zoom /tmp/hip/img.tiff
gimpViewer :: ExternalViewer #
gimp /tmp/hip/img.tiff
Supported Image Formats
Arrays that can be written into a file.
Minimal complete definition
Instances
File formats that can be read into an Array.
Minimal complete definition
Instances
class (Default (ReadOptions f), Default (WriteOptions f), Show f) => FileFormat f where #
File format. Helps in guessing file format from a file extension, as well as supplying format specific options during saving the file.
Minimal complete definition
Associated Types
type ReadOptions f #
Options that can be used during reading a file in this format.
type WriteOptions f #
Options that can be used during writing a file in this format.
Methods
Default file extension for this file format.
Other known file extensions for this file format, eg. ".jpeg", ".jpg".
isFormat :: String -> f -> Bool #
Checks if a file extension corresponds to the format, eg.
isFormat ".png" PNG == True
Instances
| FileFormat TIF # | |
| FileFormat TGA # | |
| FileFormat JPG # | |
| FileFormat HDR # | |
| FileFormat GIF # | |
| FileFormat PNG # | |
| FileFormat BMP # | |
| FileFormat PPM # | |
| FileFormat PGM # | |
| FileFormat PBM # | |
| FileFormat f => FileFormat (Auto f) # | |
| FileFormat (Sequence (Auto GIF)) # | |
| FileFormat (Sequence (Auto PPM)) # | |
| FileFormat (Sequence (Auto PGM)) # | |
| FileFormat (Sequence (Auto PBM)) # | |
| FileFormat (Sequence GIF) # | |
| FileFormat (Sequence PPM) # | |
| FileFormat (Sequence PGM) # | |
| FileFormat (Sequence PBM) # | |
| FileFormat (Decode (Image r cs e)) # | |
| FileFormat (Encode (Image r cs e)) # | |
Constructors
| Auto f |
Instances
Special wrapper for formats that support encoding/decoding sequence of array.
Constructors
| Sequence f |
Instances
newtype EncodeError #
This exception can be thrown while writing/encoding into a file and indicates an error in an array that is being encoded.
Constructors
| EncodeError String |
Instances
| Show EncodeError # | |
Defined in Data.Massiv.Array.IO.Base Methods showsPrec :: Int -> EncodeError -> ShowS # show :: EncodeError -> String # showList :: [EncodeError] -> ShowS # | |
| Exception EncodeError # | |
Defined in Data.Massiv.Array.IO.Base Methods toException :: EncodeError -> SomeException # fromException :: SomeException -> Maybe EncodeError # displayException :: EncodeError -> String # | |
newtype DecodeError #
This exception can be thrown while reading/decoding a file and indicates an error in the file itself.
Constructors
| DecodeError String |
Instances
| Show DecodeError # | |
Defined in Data.Massiv.Array.IO.Base Methods showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # | |
| Exception DecodeError # | |
Defined in Data.Massiv.Array.IO.Base Methods toException :: DecodeError -> SomeException # fromException :: SomeException -> Maybe DecodeError # displayException :: DecodeError -> String # | |
newtype ConvertError #
Conversion error, which is thrown when there is a mismatch between the expected array type and the one supported by the file format. It is also thrown upon a failure of automatic conversion between those types, in case such conversion is utilized.
Constructors
| ConvertError String |
Instances
| Show ConvertError # | |
Defined in Data.Massiv.Array.IO.Base Methods showsPrec :: Int -> ConvertError -> ShowS # show :: ConvertError -> String # showList :: [ConvertError] -> ShowS # | |
| Exception ConvertError # | |
Defined in Data.Massiv.Array.IO.Base Methods toException :: ConvertError -> SomeException # fromException :: SomeException -> Maybe ConvertError # displayException :: ConvertError -> String # | |
defaultReadOptions :: FileFormat f => f -> ReadOptions f #
Generate default read options for a file format
defaultWriteOptions :: FileFormat f => f -> WriteOptions f #
Generate default write options for a file format
Instances
| Show (Encode out) # | |
| FileFormat (Encode (Image r cs e)) # | |
| Writable (Encode (Image r cs e)) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image Methods encode :: Encode (Image r cs e) -> WriteOptions (Encode (Image r cs e)) -> Image r cs e -> ByteString # | |
| type ReadOptions (Encode (Image r cs e)) # | |
Defined in Data.Massiv.Array.IO.Image | |
| type WriteOptions (Encode (Image r cs e)) # | |
Defined in Data.Massiv.Array.IO.Image | |
Arguments
| :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) | |
| => [Encode (Image r cs e)] | List of image formats to choose from (useful lists are
|
| -> FilePath | File name with extension, so the format can be inferred |
| -> Image r cs e | Image to encode |
| -> ByteString |
Encode an image into a lazy ByteString, while selecting the appropriate format from the
file extension.
imageWriteFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => [Encode (Image r cs e)] #
List of image formats that can be encoded without any color space conversion.
imageWriteAutoFormats :: (Source r Ix2 (Pixel cs e), ColorSpace cs e, ToYA cs e, ToRGBA cs e, ToYCbCr cs e, ToCMYK cs e) => [Encode (Image r cs e)] #
List of image formats that can be encoded with any necessary color space conversions.
Instances
| Show (Decode out) # | |
| FileFormat (Decode (Image r cs e)) # | |
| Readable (Decode (Image r cs e)) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image Methods decode :: Decode (Image r cs e) -> ReadOptions (Decode (Image r cs e)) -> ByteString -> Image r cs e # | |
| type ReadOptions (Decode (Image r cs e)) # | |
Defined in Data.Massiv.Array.IO.Image | |
| type WriteOptions (Decode (Image r cs e)) # | |
Defined in Data.Massiv.Array.IO.Image | |
Arguments
| :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) | |
| => [Decode (Image r cs e)] | List of available formats to choose from |
| -> FilePath | File name with extension, so format can be inferred |
| -> ByteString | Encoded image |
| -> Image r cs e |
Decode an image from the strict ByteString while inferring format the image is encoded in
from the file extension
imageReadFormats :: (Source S Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image S cs e)] #
List of image formats decodable with no colorspace conversion
imageReadAutoFormats :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image r cs e)] #
List of image formats decodable with no colorspace conversion
JuicyPixels formats
BMP
Bitmap image with .bmp extension.
Constructors
| BMP |
Instances
| Show BMP # | |
| FileFormat BMP # | |
| (ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable BMP (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: BMP -> WriteOptions BMP -> Image r cs e -> ByteString # | |
| ColorSpace cs e => Readable BMP (Image S cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: BMP -> ReadOptions BMP -> ByteString -> Image S cs e # | |
| (ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString # | |
| (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e # | |
| type ReadOptions BMP # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
| type WriteOptions BMP # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
GIF
Graphics Interchange Format image with .gif extension.
Constructors
| GIF |
Instances
data WriteOptionsGIF #
Instances
| Default WriteOptionsGIF # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods def :: WriteOptionsGIF # | |
data PaletteOptions #
To specify how the palette will be created.
Constructors
| PaletteOptions | |
Fields
| |
data PaletteCreationMethod #
Define which palette creation method is used.
Constructors
| MedianMeanCut | MedianMeanCut method, provide the best results (visualy) at the cost of increased calculations. |
| Uniform | Very fast algorithm (one pass), doesn't provide good looking results. |
Animated
data WriteOptionsSequenceGIF #
Instances
| Default WriteOptionsSequenceGIF # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods | |
Delay to wait before showing the next Gif image. The delay is expressed in 100th of seconds.
data GifLooping #
Help to control the behaviour of GIF animation looping.
Constructors
| LoopingNever | The animation will stop once the end is reached |
| LoopingForever | The animation will restart once the end is reached |
| LoopingRepeat Word16 | The animation will repeat n times before stoping |
HDR
High-dynamic-range image with .hdr or .pic extension.
Constructors
| HDR |
Instances
| Show HDR # | |
| FileFormat HDR # | |
| (ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable HDR (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: HDR -> WriteOptions HDR -> Image r cs e -> ByteString # | |
| ColorSpace cs e => Readable HDR (Image S cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: HDR -> ReadOptions HDR -> ByteString -> Image S cs e # | |
| (ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString # | |
| (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e # | |
| type ReadOptions HDR # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
| type WriteOptions HDR # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
JPG
Joint Photographic Experts Group image with .jpg or .jpeg extension.
Constructors
| JPG |
Instances
data WriteOptionsJPG #
Instances
| Show WriteOptionsJPG # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods showsPrec :: Int -> WriteOptionsJPG -> ShowS # show :: WriteOptionsJPG -> String # showList :: [WriteOptionsJPG] -> ShowS # | |
| Default WriteOptionsJPG # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods def :: WriteOptionsJPG # | |
woGetQualityJPG :: WriteOptionsJPG -> Word8 #
woSetQualityJPG :: Word8 -> WriteOptionsJPG -> WriteOptionsJPG #
Set the image quality, supplied value will be clamped to [0, 100]
range. This setting directly affects the Jpeg compression level.
PNG
Portable Network Graphics image with .png extension.
Constructors
| PNG |
Instances
TGA
Truevision Graphics Adapter image with .tga extension.
Constructors
| TGA |
Instances
| Show TGA # | |
| FileFormat TGA # | |
| (ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TGA (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: TGA -> WriteOptions TGA -> Image r cs e -> ByteString # | |
| ColorSpace cs e => Readable TGA (Image S cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: TGA -> ReadOptions TGA -> ByteString -> Image S cs e # | |
| (ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString # | |
| (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e # | |
| type ReadOptions TGA # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
| type WriteOptions TGA # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
TIF
Tagged Image File Format image with .tif or .tiff extension.
Constructors
| TIF |
Instances
| Show TIF # | |
| FileFormat TIF # | |
| (ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TIF (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: TIF -> WriteOptions TIF -> Image r cs e -> ByteString # | |
| ColorSpace cs e => Readable TIF (Image S cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: TIF -> ReadOptions TIF -> ByteString -> Image S cs e # | |
| (ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString # | |
| (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels Methods decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e # | |
| type ReadOptions TIF # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
| type WriteOptions TIF # | |
Defined in Data.Massiv.Array.IO.Image.JuicyPixels | |
JuciyPixels conversion
To JuicyPixels
toAnyCS :: forall r' cs' e' r cs e. (Source r' Ix2 (Pixel cs' e'), Mutable r Ix2 (Pixel cs e), Storable (Pixel cs e), ColorSpace cs e, ToYA cs' e', ToRGBA cs' e', ToHSIA cs' e', ToCMYKA cs' e', ToYCbCrA cs' e') => Image r' cs' e' -> Maybe (Image r cs e) #
From JuicyPixels
fromDynamicImage :: forall cs e. (ColorSpace cs e, Source S Ix2 (Pixel cs e)) => DynamicImage -> Maybe (Image S cs e) #
fromAnyDynamicImage :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => DynamicImage -> Maybe (Image r cs e) #
Netpbm formats
PBM
Netpbm: portable bitmap image with .pbm extension.
Constructors
| PBM |
Instances
PGM
Netpbm: portable graymap image with .pgm extension.
Constructors
| PGM |
Instances
PPM
Netpbm: portable pixmap image with .ppm extension.
Constructors
| PPM |