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

Graphics.ColorSpace.Binary

Description

 
Synopsis

Documentation

data Bit Source #

Under the hood, binary pixels are represented as Word8, but can only take values of 0 or 1. Use zero/one to construct a bit and on/off to construct a binary pixel.

Instances
Eq Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

(==) :: Bit -> Bit -> Bool #

(/=) :: Bit -> Bit -> Bool #

Num Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

(+) :: Bit -> Bit -> Bit #

(-) :: Bit -> Bit -> Bit #

(*) :: Bit -> Bit -> Bit #

negate :: Bit -> Bit #

abs :: Bit -> Bit #

signum :: Bit -> Bit #

fromInteger :: Integer -> Bit #

Ord Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

compare :: Bit -> Bit -> Ordering #

(<) :: Bit -> Bit -> Bool #

(<=) :: Bit -> Bit -> Bool #

(>) :: Bit -> Bit -> Bool #

(>=) :: Bit -> Bit -> Bool #

max :: Bit -> Bit -> Bit #

min :: Bit -> Bit -> Bit #

Show Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

showsPrec :: Int -> Bit -> ShowS #

show :: Bit -> String #

showList :: [Bit] -> ShowS #

Storable Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

sizeOf :: Bit -> Int #

alignment :: Bit -> Int #

peekElemOff :: Ptr Bit -> Int -> IO Bit #

pokeElemOff :: Ptr Bit -> Int -> Bit -> IO () #

peekByteOff :: Ptr b -> Int -> IO Bit #

pokeByteOff :: Ptr b -> Int -> Bit -> IO () #

peek :: Ptr Bit -> IO Bit #

poke :: Ptr Bit -> Bit -> IO () #

Bits Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

Methods

(.&.) :: Bit -> Bit -> Bit #

(.|.) :: Bit -> Bit -> Bit #

xor :: Bit -> Bit -> Bit #

complement :: Bit -> Bit #

shift :: Bit -> Int -> Bit #

rotate :: Bit -> Int -> Bit #

zeroBits :: Bit #

bit :: Int -> Bit #

setBit :: Bit -> Int -> Bit #

clearBit :: Bit -> Int -> Bit #

complementBit :: Bit -> Int -> Bit #

testBit :: Bit -> Int -> Bool #

bitSizeMaybe :: Bit -> Maybe Int #

bitSize :: Bit -> Int #

isSigned :: Bit -> Bool #

shiftL :: Bit -> Int -> Bit #

unsafeShiftL :: Bit -> Int -> Bit #

shiftR :: Bit -> Int -> Bit #

unsafeShiftR :: Bit -> Int -> Bit #

rotateL :: Bit -> Int -> Bit #

rotateR :: Bit -> Int -> Bit #

popCount :: Bit -> Int #

Unbox Bit Source #

Unboxing of a Bit.

Instance details

Defined in Graphics.ColorSpace.Binary

Elevator Bit Source #

Values: 0 and 1

Instance details

Defined in Graphics.ColorSpace.Binary

Vector Vector Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

MVector MVector Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

ToRGBA X Bit Source # 
Instance details

Defined in Graphics.ColorSpace

ToRGB X Bit Source # 
Instance details

Defined in Graphics.ColorSpace

ToYA X Bit Source # 
Instance details

Defined in Graphics.ColorSpace

Bits (Pixel X Bit) Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

newtype Vector Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

newtype MVector s Bit Source # 
Instance details

Defined in Graphics.ColorSpace.Binary

newtype MVector s Bit = MV_Bit (MVector s Word8)

on :: Pixel X Bit Source #

Represents value True or 1 in binary. Often also called a foreground pixel of an object.

off :: Pixel X Bit Source #

Represents value False or 0 in binary. Often also called a background pixel.

isOn :: Pixel X Bit -> Bool Source #

Test if Pixel's value is on.

isOff :: Pixel X Bit -> Bool Source #

Test if Pixel's value is off.

fromBool :: Bool -> Pixel X Bit Source #

Convert a Bool to a binary pixel.

>>> isOn (fromBool True)
True

toNum :: Num a => Bit -> a Source #

fromNum :: (Eq a, Num a) => a -> Bit Source #