Hoogle Search

Within LTS Haskell 24.40 (ghc-9.10.3)

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

  1. colorMap :: Pixel a => (PixelBaseComponent a -> PixelBaseComponent a) -> a -> a

    JuicyPixels Codec.Picture.Types

    Apply a function to each component of a pixel. If the color type possess an alpha (transparency channel), it is treated like the other color components.

  2. dynamicMap :: (forall pixel . Pixel pixel => Image pixel -> a) -> DynamicImage -> a

    JuicyPixels Codec.Picture.Types

    Helper function to help extract information from dynamic image. To get the width of a dynamic image, you can use the following snippet:

    dynWidth :: DynamicImage -> Int
    dynWidth img = dynamicMap imageWidth img
    

  3. dynamicPixelMap :: (forall pixel . Pixel pixel => Image pixel -> Image pixel) -> DynamicImage -> DynamicImage

    JuicyPixels Codec.Picture.Types

    Equivalent of the pixelMap function for the dynamic images. You can perform pixel colorspace independant operations with this function. For instance, if you want to extract a square crop of any image, without caring about colorspace, you can use the following snippet.

    dynSquare :: DynamicImage -> DynamicImage
    dynSquare = dynamicPixelMap squareImage
    
    squareImage :: Pixel a => Image a -> Image a
    squareImage img = generateImage (\x y -> pixelAt img x y) edge edge
    where edge = min (imageWidth img) (imageHeight img)
    

  4. extractLumaPlane :: LumaPlaneExtractable a => Image a -> Image (PixelBaseComponent a)

    JuicyPixels Codec.Picture.Types

    Extract a luma plane out of an image. This method is in the typeclass to help performant implementation.

    jpegToGrayScale :: FilePath -> FilePath -> IO ()
    jpegToGrayScale source dest
    

  5. 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.

  6. 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)
    

  7. pixelMapXY :: (Pixel a, Pixel b) => (Int -> Int -> a -> b) -> Image a -> Image b

    JuicyPixels Codec.Picture.Types

    Just like pixelMap only the function takes the pixel coordinates as additional parameters.

  8. toneMapping :: PixelF -> Image PixelRGBF -> Image PixelRGBF

    JuicyPixels Codec.Picture.Types

    Perform a tone mapping operation on an High dynamic range image.

  9. foldl1Map :: forall (f :: Type -> Type) b a . Foldable f => (b -> b -> b) -> (a -> b) -> T f a -> b

    non-empty Data.NonEmpty

    It holds:

    foldl1Map f g = foldl1 f . fmap g
    
    but foldl1Map does not need a Functor instance.

  10. parMap :: Strategy b -> (a -> b) -> [a] -> [b]

    parallel Control.Parallel.Strategies

    A combination of parList and map, encapsulating a common pattern:

    parMap strat f = withStrategy (parList strat) . map f
    

Page 480 of many | Previous | Next