Copyright | (c) Eric Mertens 2018 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Advent.Visualize
Description
Thin wrapper around the JuicyPixels library to make it easy to generate small animations from solution files.
Synopsis
- data Image a
- data PixelRGB8 = PixelRGB8 !Pixel8 !Pixel8 !Pixel8
- writePng :: PngSavable pixel => FilePath -> Image pixel -> IO ()
- writeAnimation :: FilePath -> Int -> [Image PixelRGB8] -> IO ()
- generateImage :: Pixel px => (Int -> Int -> px) -> Int -> Int -> Image px
- coordImage :: Pixel p => (Coord, Coord) -> (Coord -> p) -> Image p
- colorWheel :: Word8 -> PixelRGB8
Documentation
Constructors
PixelRGB8 !Pixel8 !Pixel8 !Pixel8 |
Instances
BmpEncodable PixelRGB8 | |
Defined in Codec.Picture.Bitmap | |
PngPaletteSaveable PixelRGB8 | |
Defined in Codec.Picture.Png.Internal.Export Methods encodePalettedPng :: Image PixelRGB8 -> Image Pixel8 -> Either String ByteString encodePalettedPngWithMetadata :: Metadatas -> Image PixelRGB8 -> Image Pixel8 -> Either String ByteString | |
PngSavable PixelRGB8 | |
Defined in Codec.Picture.Png.Internal.Export Methods encodePng :: Image PixelRGB8 -> ByteString encodePngWithMetadata :: Metadatas -> Image PixelRGB8 -> ByteString | |
TgaSaveable PixelRGB8 | |
Defined in Codec.Picture.Tga Methods tgaDataOfImage :: Image PixelRGB8 -> ByteString tgaPixelDepthOfImage :: Image PixelRGB8 -> Word8 tgaTypeOfImage :: Image PixelRGB8 -> TgaImageType | |
TiffSaveable PixelRGB8 | |
Defined in Codec.Picture.Tiff Methods colorSpaceOfPixel :: PixelRGB8 -> TiffColorspace extraSampleCodeOfPixel :: PixelRGB8 -> Maybe ExtraSample subSamplingInfo :: PixelRGB8 -> Vector Word32 sampleFormat :: PixelRGB8 -> [TiffSampleFormat] | |
LumaPlaneExtractable PixelRGB8 | |
Defined in Codec.Picture.Types Methods computeLuma :: PixelRGB8 -> PixelBaseComponent PixelRGB8 extractLumaPlane :: Image PixelRGB8 -> Image (PixelBaseComponent PixelRGB8) | |
Pixel PixelRGB8 | |
Defined in Codec.Picture.Types Associated Types type PixelBaseComponent PixelRGB8 Methods mixWith :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 mixWithAlpha :: (Int -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 -> PixelRGB8 pixelOpacity :: PixelRGB8 -> PixelBaseComponent PixelRGB8 componentCount :: PixelRGB8 -> Int colorMap :: (PixelBaseComponent PixelRGB8 -> PixelBaseComponent PixelRGB8) -> PixelRGB8 -> PixelRGB8 pixelBaseIndex :: Image PixelRGB8 -> Int -> Int -> Int mutablePixelBaseIndex :: MutableImage s PixelRGB8 -> Int -> Int -> Int pixelAt :: Image PixelRGB8 -> Int -> Int -> PixelRGB8 readPixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> m PixelRGB8 writePixel :: PrimMonad m => MutableImage (PrimState m) PixelRGB8 -> Int -> Int -> PixelRGB8 -> m () unsafePixelAt :: Vector (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 unsafeReadPixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> m PixelRGB8 unsafeWritePixel :: PrimMonad m => STVector (PrimState m) (PixelBaseComponent PixelRGB8) -> Int -> PixelRGB8 -> m () | |
Show PixelRGB8 | |
Eq PixelRGB8 | |
Ord PixelRGB8 | |
Decimable PixelRGB16 PixelRGB8 | |
Defined in Codec.Picture Methods decimateBitDepth :: Image PixelRGB16 -> Image PixelRGB8 | |
Decimable PixelRGBF PixelRGB8 | |
Defined in Codec.Picture Methods decimateBitDepth :: Image PixelRGBF -> Image PixelRGB8 | |
ColorConvertible Pixel8 PixelRGB8 | |
Defined in Codec.Picture.Types | |
ColorConvertible PixelRGB8 PixelRGB16 | |
Defined in Codec.Picture.Types | |
ColorConvertible PixelRGB8 PixelRGBA16 | |
Defined in Codec.Picture.Types | |
ColorConvertible PixelRGB8 PixelRGBA8 | |
Defined in Codec.Picture.Types | |
ColorConvertible PixelRGB8 PixelRGBF | |
Defined in Codec.Picture.Types | |
ColorConvertible PixelYA8 PixelRGB8 | |
Defined in Codec.Picture.Types | |
ColorPlane PixelRGB8 PlaneBlue | |
Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneBlue -> Int | |
ColorPlane PixelRGB8 PlaneGreen | |
Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneGreen -> Int | |
ColorPlane PixelRGB8 PlaneRed | |
Defined in Codec.Picture.Types Methods toComponentIndex :: PixelRGB8 -> PlaneRed -> Int | |
ColorSpaceConvertible PixelCMYK8 PixelRGB8 | |
Defined in Codec.Picture.Types | |
ColorSpaceConvertible PixelRGB8 PixelCMYK8 | |
Defined in Codec.Picture.Types | |
ColorSpaceConvertible PixelRGB8 PixelYCbCr8 | |
Defined in Codec.Picture.Types | |
ColorSpaceConvertible PixelYCbCr8 PixelRGB8 | |
Defined in Codec.Picture.Types | |
ColorSpaceConvertible PixelYCbCrK8 PixelRGB8 | |
Defined in Codec.Picture.Types Methods convertPixel :: PixelYCbCrK8 -> PixelRGB8 convertImage :: Image PixelYCbCrK8 -> Image PixelRGB8 | |
TransparentPixel PixelRGBA8 PixelRGB8 | |
Defined in Codec.Picture.Types Methods dropTransparency :: PixelRGBA8 -> PixelRGB8 getTransparency :: PixelRGBA8 -> PixelBaseComponent PixelRGBA8 | |
type PixelBaseComponent PixelRGB8 | |
Defined in Codec.Picture.Types |
Arguments
:: FilePath | output filename |
-> Int | frame delay in centiseconds |
-> [Image PixelRGB8] | animation frames |
-> IO () |
Save a looping animated GIF to disk given the animation frames and a delay.
Arguments
:: Pixel p | |
=> (Coord, Coord) | inclusive coordinate range |
-> (Coord -> p) | pixel coloring function |
-> Image p |
Generate an image given coordinate bounds and a projection from coordinates to colors.
colorWheel :: Word8 -> PixelRGB8 Source #
Assign a gradient rainbow to the values of a 8-bit number.