massiv-io-0.1.6.0: Import/export of Image files into massiv Arrays

Copyright(c) Alexey Kuleshevich 2018-2019
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.IO

Contents

Description

 
Synopsis

Documentation

Encoding and decoding of images is done using JuicyPixels and netpbm packages.

List of image formats that are currently supported, and their exact ColorSpaces and precision for reading and writing without an implicit conversion:

readArray Source #

Arguments

:: Readable f arr 
=> f

File format that should be used while decoding the file

-> ReadOptions f

Any file format related decoding options. Use def for default.

-> FilePath

Path to the file

-> IO arr 

Read an array from one of the supported file formats.

readImage Source #

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

readImageAuto Source #

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

writeArray Source #

Arguments

:: Writable f arr 
=> f

Format to use while encoding the array

-> WriteOptions f

Any file format related encoding options. Use def for default.

-> FilePath 
-> arr 
-> IO () 

writeImage :: (Source r Ix2 (Pixel cs e), ColorSpace cs e) => FilePath -> Image r cs e -> IO () Source #

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 (Image r RGBA Double) being saved as PNG file would be written as (Image r RGBA Word16), thus using highest supported precision 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 () Source #

Write an image to file while performing all necessary precisiona and color space conversions.

Displaying

data ExternalViewer Source #

External viewing application to use for displaying images.

Constructors

ExternalViewer FilePath [String] Int

Any custom viewer, which can be specified:

  • FilePath - to the actual viewer executable.
  • [String] - command line arguments that will be passed to the executable.
  • Int - position index in the above list where FilePath to an image should be injected

displayImage :: Writable (Auto TIF) (Image r cs e) => Image r cs e -> IO () Source #

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.

displayImageUsing Source #

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 () Source #

Displays an image file by calling an external image viewer.

Common viewers

defaultViewer :: ExternalViewer Source #

Default viewer is inferred from the operating system.

gpicviewViewer :: ExternalViewer Source #

gpicview /tmp/hip/img.tiff

GPicView

fehViewer :: ExternalViewer Source #

feh --fullscreen --auto-zoom /tmp/hip/img.tiff

FEH

gimpViewer :: ExternalViewer Source #

gimp /tmp/hip/img.tiff

GIMP

Supported Image Formats

class Writable f arr where Source #

Arrays that can be written into a file.

Methods

encode :: f -> WriteOptions f -> arr -> ByteString Source #

Encode an array into a ByteString.

Instances
(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TIF (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TIF -> WriteOptions TIF -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TGA (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TGA -> WriteOptions TGA -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable JPG (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: JPG -> WriteOptions JPG -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable HDR (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: HDR -> WriteOptions HDR -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable GIF (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: GIF -> WriteOptions GIF -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable PNG (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: PNG -> WriteOptions PNG -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable BMP (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: BMP -> WriteOptions BMP -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Writable (Encode (Image r cs e)) (Image r cs e) Source # 
Instance details

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 Source #

class Readable f arr where Source #

File formats that can be read into an Array.

Methods

decode :: f -> ReadOptions f -> ByteString -> arr Source #

Decode a ByteString into an Array.

Instances
ColorSpace cs e => Readable TIF (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TIF -> ReadOptions TIF -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable TGA (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TGA -> ReadOptions TGA -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable JPG (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: JPG -> ReadOptions JPG -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable HDR (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: HDR -> ReadOptions HDR -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable GIF (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: GIF -> ReadOptions GIF -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable PNG (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: PNG -> ReadOptions PNG -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable BMP (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: BMP -> ReadOptions BMP -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable PPM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PPM -> ReadOptions PPM -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable PGM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PGM -> ReadOptions PGM -> ByteString -> Image S cs e Source #

ColorSpace cs e => Readable PBM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PBM -> ReadOptions PBM -> ByteString -> Image S cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Readable (Decode (Image r cs e)) (Image r cs e) Source # 
Instance details

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 Source #

class (Default (ReadOptions f), Default (WriteOptions f), Show f) => FileFormat f where Source #

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

ext

Associated Types

type ReadOptions f Source #

Options that can be used during reading a file in this format.

type WriteOptions f Source #

Options that can be used during writing a file in this format.

Methods

ext :: f -> String Source #

Default file extension for this file format.

exts :: f -> [String] Source #

Other known file extensions for this file format, eg. ".jpeg", ".jpg".

isFormat :: String -> f -> Bool Source #

Checks if a file extension corresponds to the format, eg. isFormat ".png" PNG == True

Instances
FileFormat TIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TIF :: Type Source #

type WriteOptions TIF :: Type Source #

FileFormat TGA Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TGA :: Type Source #

type WriteOptions TGA :: Type Source #

FileFormat JPG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions JPG :: Type Source #

type WriteOptions JPG :: Type Source #

FileFormat HDR Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions HDR :: Type Source #

type WriteOptions HDR :: Type Source #

FileFormat GIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions GIF :: Type Source #

type WriteOptions GIF :: Type Source #

FileFormat PNG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions PNG :: Type Source #

type WriteOptions PNG :: Type Source #

FileFormat BMP Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions BMP :: Type Source #

type WriteOptions BMP :: Type Source #

FileFormat PPM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PPM :: Type Source #

type WriteOptions PPM :: Type Source #

FileFormat PGM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PGM :: Type Source #

type WriteOptions PGM :: Type Source #

FileFormat PBM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PBM :: Type Source #

type WriteOptions PBM :: Type Source #

FileFormat f => FileFormat (Auto f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Associated Types

type ReadOptions (Auto f) :: Type Source #

type WriteOptions (Auto f) :: Type Source #

Methods

ext :: Auto f -> String Source #

exts :: Auto f -> [String] Source #

isFormat :: String -> Auto f -> Bool Source #

FileFormat (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: Type Source #

type WriteOptions (Sequence (Auto GIF)) :: Type Source #

FileFormat (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: Type Source #

type WriteOptions (Sequence (Auto PPM)) :: Type Source #

FileFormat (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: Type Source #

type WriteOptions (Sequence (Auto PGM)) :: Type Source #

FileFormat (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: Type Source #

type WriteOptions (Sequence (Auto PBM)) :: Type Source #

FileFormat (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: Type Source #

type WriteOptions (Sequence GIF) :: Type Source #

FileFormat (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: Type Source #

type WriteOptions (Sequence PPM) :: Type Source #

FileFormat (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: Type Source #

type WriteOptions (Sequence PGM) :: Type Source #

FileFormat (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: Type Source #

type WriteOptions (Sequence PBM) :: Type Source #

FileFormat (Decode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Decode (Image r cs e)) :: Type Source #

type WriteOptions (Decode (Image r cs e)) :: Type Source #

Methods

ext :: Decode (Image r cs e) -> String Source #

exts :: Decode (Image r cs e) -> [String] Source #

isFormat :: String -> Decode (Image r cs e) -> Bool Source #

FileFormat (Encode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Encode (Image r cs e)) :: Type Source #

type WriteOptions (Encode (Image r cs e)) :: Type Source #

Methods

ext :: Encode (Image r cs e) -> String Source #

exts :: Encode (Image r cs e) -> [String] Source #

isFormat :: String -> Encode (Image r cs e) -> Bool Source #

newtype Auto f Source #

Constructors

Auto f 
Instances
Show f => Show (Auto f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Methods

showsPrec :: Int -> Auto f -> ShowS #

show :: Auto f -> String #

showList :: [Auto f] -> ShowS #

FileFormat f => FileFormat (Auto f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Associated Types

type ReadOptions (Auto f) :: Type Source #

type WriteOptions (Auto f) :: Type Source #

Methods

ext :: Auto f -> String Source #

exts :: Auto f -> [String] Source #

isFormat :: String -> Auto f -> Bool Source #

FileFormat (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: Type Source #

type WriteOptions (Sequence (Auto GIF)) :: Type Source #

FileFormat (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: Type Source #

type WriteOptions (Sequence (Auto PPM)) :: Type Source #

FileFormat (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: Type Source #

type WriteOptions (Sequence (Auto PGM)) :: Type Source #

FileFormat (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: Type Source #

type WriteOptions (Sequence (Auto PBM)) :: Type Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Auto f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

type ReadOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Auto f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

type WriteOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

newtype Sequence f Source #

Special wrapper for formats that support encoding/decoding sequence of array.

Constructors

Sequence f 
Instances
Show f => Show (Sequence f) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Base

Methods

showsPrec :: Int -> Sequence f -> ShowS #

show :: Sequence f -> String #

showList :: [Sequence f] -> ShowS #

FileFormat (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: Type Source #

type WriteOptions (Sequence (Auto GIF)) :: Type Source #

FileFormat (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: Type Source #

type WriteOptions (Sequence (Auto PPM)) :: Type Source #

FileFormat (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: Type Source #

type WriteOptions (Sequence (Auto PGM)) :: Type Source #

FileFormat (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: Type Source #

type WriteOptions (Sequence (Auto PBM)) :: Type Source #

FileFormat (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: Type Source #

type WriteOptions (Sequence GIF) :: Type Source #

FileFormat (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: Type Source #

type WriteOptions (Sequence PPM) :: Type Source #

FileFormat (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: Type Source #

type WriteOptions (Sequence PGM) :: Type Source #

FileFormat (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: Type Source #

type WriteOptions (Sequence PBM) :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

newtype EncodeError Source #

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 

newtype DecodeError Source #

This exception can be thrown while reading/decoding a file and indicates an error in the file itself.

Constructors

DecodeError String 

newtype ConvertError Source #

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 

type Image r cs e = Array r Ix2 (Pixel cs e) Source #

defaultReadOptions :: FileFormat f => f -> ReadOptions f Source #

Generate default read options for a file format

defaultWriteOptions :: FileFormat f => f -> WriteOptions f Source #

Generate default write options for a file format

data Encode out Source #

Instances
Show (Encode out) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

showsPrec :: Int -> Encode out -> ShowS #

show :: Encode out -> String #

showList :: [Encode out] -> ShowS #

FileFormat (Encode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Encode (Image r cs e)) :: Type Source #

type WriteOptions (Encode (Image r cs e)) :: Type Source #

Methods

ext :: Encode (Image r cs e) -> String Source #

exts :: Encode (Image r cs e) -> [String] Source #

isFormat :: String -> Encode (Image r cs e) -> Bool Source #

Writable (Encode (Image r cs e)) (Image r cs e) Source # 
Instance details

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 Source #

type ReadOptions (Encode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type ReadOptions (Encode (Image r cs e)) = ()
type WriteOptions (Encode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type WriteOptions (Encode (Image r cs e)) = ()

encodeImage Source #

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 imageWriteFormats and imageWriteAutoFormats

-> 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)] Source #

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)] Source #

List of image formats that can be encoded with any necessary color space conversions.

data Decode out Source #

Instances
Show (Decode out) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Methods

showsPrec :: Int -> Decode out -> ShowS #

show :: Decode out -> String #

showList :: [Decode out] -> ShowS #

FileFormat (Decode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

Associated Types

type ReadOptions (Decode (Image r cs e)) :: Type Source #

type WriteOptions (Decode (Image r cs e)) :: Type Source #

Methods

ext :: Decode (Image r cs e) -> String Source #

exts :: Decode (Image r cs e) -> [String] Source #

isFormat :: String -> Decode (Image r cs e) -> Bool Source #

Readable (Decode (Image r cs e)) (Image r cs e) Source # 
Instance details

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 Source #

type ReadOptions (Decode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type ReadOptions (Decode (Image r cs e)) = ()
type WriteOptions (Decode (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image

type WriteOptions (Decode (Image r cs e)) = ()

decodeImage Source #

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)] Source #

List of image formats decodable with no colorspace conversion

imageReadAutoFormats :: (Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => [Decode (Image r cs e)] Source #

List of image formats decodable with no colorspace conversion

JuicyPixels formats

BMP

data BMP Source #

Bitmap image with .bmp extension.

Constructors

BMP 
Instances
Show BMP Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> BMP -> ShowS #

show :: BMP -> String #

showList :: [BMP] -> ShowS #

FileFormat BMP Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions BMP :: Type Source #

type WriteOptions BMP :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable BMP (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: BMP -> WriteOptions BMP -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable BMP (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: BMP -> ReadOptions BMP -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto BMP -> WriteOptions (Auto BMP) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto BMP) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto BMP -> ReadOptions (Auto BMP) -> ByteString -> Image r cs e Source #

type ReadOptions BMP Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions BMP = ()
type WriteOptions BMP Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions BMP = ()

GIF

data GIF Source #

Graphics Interchange Format image with .gif extension.

Constructors

GIF 
Instances
Show GIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> GIF -> ShowS #

show :: GIF -> String #

showList :: [GIF] -> ShowS #

FileFormat GIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions GIF :: Type Source #

type WriteOptions GIF :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable GIF (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: GIF -> WriteOptions GIF -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable GIF (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: GIF -> ReadOptions GIF -> ByteString -> Image S cs e Source #

FileFormat (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence (Auto GIF)) :: Type Source #

type WriteOptions (Sequence (Auto GIF)) :: Type Source #

FileFormat (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions (Sequence GIF) :: Type Source #

type WriteOptions (Sequence GIF) :: Type Source #

(ColorSpace cs e, ToY cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto GIF -> WriteOptions (Auto GIF) -> Image r cs e -> ByteString Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable (Sequence GIF) (Array B Ix1 (GifDelay, Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto GIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto GIF -> ReadOptions (Auto GIF) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto GIF)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (GifDelay, Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

ColorSpace cs e => Readable (Sequence GIF) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions GIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions GIF = ()
type WriteOptions GIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence (Auto GIF)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions (Sequence GIF) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

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

type GifDelay = Int #

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

data HDR Source #

High-dynamic-range image with .hdr or .pic extension.

Constructors

HDR 
Instances
Show HDR Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> HDR -> ShowS #

show :: HDR -> String #

showList :: [HDR] -> ShowS #

FileFormat HDR Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions HDR :: Type Source #

type WriteOptions HDR :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable HDR (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: HDR -> WriteOptions HDR -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable HDR (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: HDR -> ReadOptions HDR -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToRGB cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto HDR -> WriteOptions (Auto HDR) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto HDR) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto HDR -> ReadOptions (Auto HDR) -> ByteString -> Image r cs e Source #

type ReadOptions HDR Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions HDR = ()
type WriteOptions HDR Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions HDR = ()

JPG

data JPG Source #

Joint Photographic Experts Group image with .jpg or .jpeg extension.

Constructors

JPG 
Instances
Show JPG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> JPG -> ShowS #

show :: JPG -> String #

showList :: [JPG] -> ShowS #

FileFormat JPG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions JPG :: Type Source #

type WriteOptions JPG :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable JPG (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: JPG -> WriteOptions JPG -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable JPG (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: JPG -> ReadOptions JPG -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToYCbCr cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto JPG -> WriteOptions (Auto JPG) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto JPG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto JPG -> ReadOptions (Auto JPG) -> ByteString -> Image r cs e Source #

type ReadOptions JPG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions JPG = ()
type WriteOptions JPG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

woSetQualityJPG :: Word8 -> WriteOptionsJPG -> WriteOptionsJPG Source #

Set the image quality, supplied value will be clamped to [0, 100] range. This setting directly affects the Jpeg compression level.

PNG

data PNG Source #

Portable Network Graphics image with .png extension.

Constructors

PNG 
Instances
Show PNG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> PNG -> ShowS #

show :: PNG -> String #

showList :: [PNG] -> ShowS #

FileFormat PNG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions PNG :: Type Source #

type WriteOptions PNG :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable PNG (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: PNG -> WriteOptions PNG -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable PNG (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: PNG -> ReadOptions PNG -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToYA cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto PNG -> WriteOptions (Auto PNG) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PNG) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto PNG -> ReadOptions (Auto PNG) -> ByteString -> Image r cs e Source #

type ReadOptions PNG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions PNG = ()
type WriteOptions PNG Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions PNG = ()

TGA

data TGA Source #

Truevision Graphics Adapter image with .tga extension.

Constructors

TGA 
Instances
Show TGA Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> TGA -> ShowS #

show :: TGA -> String #

showList :: [TGA] -> ShowS #

FileFormat TGA Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TGA :: Type Source #

type WriteOptions TGA :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TGA (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TGA -> WriteOptions TGA -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable TGA (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TGA -> ReadOptions TGA -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TGA -> WriteOptions (Auto TGA) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TGA) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TGA -> ReadOptions (Auto TGA) -> ByteString -> Image r cs e Source #

type ReadOptions TGA Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions TGA = ()
type WriteOptions TGA Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions TGA = ()

TIF

data TIF Source #

Tagged Image File Format image with .tif or .tiff extension.

Constructors

TIF 
Instances
Show TIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

showsPrec :: Int -> TIF -> ShowS #

show :: TIF -> String #

showList :: [TIF] -> ShowS #

FileFormat TIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Associated Types

type ReadOptions TIF :: Type Source #

type WriteOptions TIF :: Type Source #

(ColorSpace cs e, Source r Ix2 (Pixel cs e)) => Writable TIF (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: TIF -> WriteOptions TIF -> Image r cs e -> ByteString Source #

ColorSpace cs e => Readable TIF (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: TIF -> ReadOptions TIF -> ByteString -> Image S cs e Source #

(ColorSpace cs e, ToRGBA cs e, Source r Ix2 (Pixel cs e)) => Writable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

encode :: Auto TIF -> WriteOptions (Auto TIF) -> Image r cs e -> ByteString Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto TIF) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

Methods

decode :: Auto TIF -> ReadOptions (Auto TIF) -> ByteString -> Image r cs e Source #

type ReadOptions TIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type ReadOptions TIF = ()
type WriteOptions TIF Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.JuicyPixels

type WriteOptions TIF = ()

JuciyPixels conversion

To JuicyPixels

toAnyCS :: forall r' cs' e' r cs e. (Source r' Ix2 (Pixel cs' e'), Mutable r Ix2 (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) Source #

From JuicyPixels

fromDynamicImage :: forall cs e. ColorSpace cs e => DynamicImage -> Maybe (Image S cs e) Source #

Netpbm formats

PBM

data PBM Source #

Netpbm: portable bitmap image with .pbm extension.

Constructors

PBM 
Instances
Show PBM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PBM -> ShowS #

show :: PBM -> String #

showList :: [PBM] -> ShowS #

FileFormat PBM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PBM :: Type Source #

type WriteOptions PBM :: Type Source #

ColorSpace cs e => Readable PBM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PBM -> ReadOptions PBM -> ByteString -> Image S cs e Source #

FileFormat (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PBM)) :: Type Source #

type WriteOptions (Sequence (Auto PBM)) :: Type Source #

FileFormat (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PBM) :: Type Source #

type WriteOptions (Sequence PBM) :: Type Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PBM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PBM -> ReadOptions (Auto PBM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PBM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PBM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PBM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PBM = ()
type WriteOptions PBM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PBM = ()
type ReadOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PBM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PBM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

PGM

data PGM Source #

Netpbm: portable graymap image with .pgm extension.

Constructors

PGM 
Instances
Show PGM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PGM -> ShowS #

show :: PGM -> String #

showList :: [PGM] -> ShowS #

FileFormat PGM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PGM :: Type Source #

type WriteOptions PGM :: Type Source #

ColorSpace cs e => Readable PGM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PGM -> ReadOptions PGM -> ByteString -> Image S cs e Source #

FileFormat (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PGM)) :: Type Source #

type WriteOptions (Sequence (Auto PGM)) :: Type Source #

FileFormat (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PGM) :: Type Source #

type WriteOptions (Sequence PGM) :: Type Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PGM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PGM -> ReadOptions (Auto PGM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PGM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PGM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PGM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PGM = ()
type WriteOptions PGM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PGM = ()
type ReadOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PGM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PGM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

PPM

data PPM Source #

Netpbm: portable pixmap image with .ppm extension.

Constructors

PPM 
Instances
Show PPM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

showsPrec :: Int -> PPM -> ShowS #

show :: PPM -> String #

showList :: [PPM] -> ShowS #

FileFormat PPM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions PPM :: Type Source #

type WriteOptions PPM :: Type Source #

ColorSpace cs e => Readable PPM (Image S cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: PPM -> ReadOptions PPM -> ByteString -> Image S cs e Source #

FileFormat (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence (Auto PPM)) :: Type Source #

type WriteOptions (Sequence (Auto PPM)) :: Type Source #

FileFormat (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Associated Types

type ReadOptions (Sequence PPM) :: Type Source #

type WriteOptions (Sequence PPM) :: Type Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Auto PPM) (Image r cs e) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

Methods

decode :: Auto PPM -> ReadOptions (Auto PPM) -> ByteString -> Image r cs e Source #

(Mutable r Ix2 (Pixel cs e), ColorSpace cs e) => Readable (Sequence (Auto PPM)) (Array B Ix1 (Image r cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

ColorSpace cs e => Readable (Sequence PPM) (Array B Ix1 (Image S cs e)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PPM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions PPM = ()
type WriteOptions PPM Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions PPM = ()
type ReadOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type ReadOptions (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence (Auto PPM)) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm

type WriteOptions (Sequence PPM) Source # 
Instance details

Defined in Data.Massiv.Array.IO.Image.Netpbm