Hoogle Search

Within LTS Haskell 24.25 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mixWith :: Pixel a => (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> a

    JuicyPixels Codec.Picture.Types

    Call the function for every component of the pixels. For example for RGB pixels mixWith is declared like this:

    mixWith f (PixelRGB8 ra ga ba) (PixelRGB8 rb gb bb) =
    PixelRGB8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb)
    

  2. mixWithAlpha :: Pixel a => (Int -> PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> (PixelBaseComponent a -> PixelBaseComponent a -> PixelBaseComponent a) -> a -> a -> a

    JuicyPixels Codec.Picture.Types

    Extension of the mixWith which separate the treatment of the color components of the alpha value (transparency component). For pixel without alpha components, it is equivalent to mixWith.

    mixWithAlpha f fa (PixelRGBA8 ra ga ba aa) (PixelRGB8 rb gb bb ab) =
    PixelRGBA8 (f 0 ra rb) (f 1 ga gb) (f 2 ba bb) (fa aa ab)
    

  3. mutablePixelBaseIndex :: Pixel a => MutableImage s a -> Int -> Int -> Int

    JuicyPixels Codec.Picture.Types

    Calculate theindex for the begining of the pixel at position x y

  4. packPixel :: PackeablePixel a => a -> PackedRepresentation a

    JuicyPixels Codec.Picture.Types

    The packing function, allowing to transform to a primitive.

  5. pixelAt :: Pixel a => Image a -> Int -> Int -> a

    JuicyPixels Codec.Picture.Types

    Extract a pixel at a given position, (x, y), the origin is assumed to be at the corner top left, positive y to the bottom of the image

  6. pixelBaseIndex :: Pixel a => Image a -> Int -> Int -> Int

    JuicyPixels Codec.Picture.Types

    Calculate the index for the begining of the pixel

  7. pixelFold :: forall acc pixel . Pixel pixel => (acc -> Int -> Int -> pixel -> acc) -> acc -> Image pixel -> acc

    JuicyPixels Codec.Picture.Types

    Fold over the pixel of an image with a raster scan order: from top to bottom, left to right

  8. pixelFoldM :: (Pixel pixel, Monad m) => (acc -> Int -> Int -> pixel -> m acc) -> acc -> Image pixel -> m acc

    JuicyPixels Codec.Picture.Types

    Fold over the pixel of an image with a raster scan order: from top to bottom, left to right, carrying out a state

  9. pixelFoldMap :: forall m px . (Pixel px, Monoid m) => (px -> m) -> Image px -> m

    JuicyPixels Codec.Picture.Types

    Fold over the pixel of an image with a raster scan order: from top to bottom, left to right. This functions is analog to the foldMap from the Foldable typeclass, but due to the Pixel constraint, Image cannot be made an instance of it.

  10. pixelMap :: (Pixel a, Pixel b) => (a -> b) -> Image a -> Image b

    JuicyPixels Codec.Picture.Types

    map equivalent for an image, working at the pixel level. Little example : a brightness function for an rgb image

    brightnessRGB8 :: Int -> Image PixelRGB8 -> Image PixelRGB8
    brightnessRGB8 add = pixelMap brightFunction
    where up v = fromIntegral (fromIntegral v + add)
    brightFunction (PixelRGB8 r g b) =
    PixelRGB8 (up r) (up g) (up b)
    

Page 109 of many | Previous | Next