Copyright | (c) Matthew Mosior 2023 |
---|---|
License | BSD-style |
Maintainer | mattm.github@gmail.com |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
WARNING
This module is considered internal.
The Package Versioning Policy does not apply.
The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.
Authors importing this library are expected to track development closely.
All credit goes to the author(s)/maintainer(s) of the containers library for the above warning text.
Description
This library utilizes massiv's superb performance characteristics to supply alternative rasterization functionality to that which is provided by the gloss-raster package.
Synopsis
- data ColorMassiv = RGBA !Float !Float !Float !Float
- rgbMassiv :: Float -> Float -> Float -> ColorMassiv
- rgbMassivI :: Int -> Int -> Int -> ColorMassiv
- rgbMassiv8w :: Word8 -> Word8 -> Word8 -> ColorMassiv
- rgbMassiv' :: Float -> Float -> Float -> ColorMassiv
- rgbMassivI' :: Int -> Int -> Int -> ColorMassiv
- makeColorMassiv :: Float -> Float -> Float -> Float -> ColorMassiv
- makeColorMassivI :: Int -> Int -> Int -> Int -> ColorMassiv
- makeRawColorMassiv :: Float -> Float -> Float -> Float -> ColorMassiv
- makeRawColorMassivI :: Int -> Int -> Int -> Int -> ColorMassiv
- rgbaOfColorMassiv :: ColorMassiv -> (Float, Float, Float, Float)
Graphics.Gloss.Raster.Array Replacement functions - INTERNAL
data ColorMassiv Source #
Custom Color data type.
Instances
rgbMassiv :: Float -> Float -> Float -> ColorMassiv Source #
Construct a color from red, green, blue components.
Each component is clamped to the range [0..1]
rgbMassivI :: Int -> Int -> Int -> ColorMassiv Source #
Construct a color from red, green, blue components.
Each component is clamped to the range [0..255]
rgbMassiv8w :: Word8 -> Word8 -> Word8 -> ColorMassiv Source #
Construct a color from red, green, blue components.
rgbMassiv' :: Float -> Float -> Float -> ColorMassiv Source #
Like rgb
, but take pre-clamped components for speed.
If you're building a new color for every pixel then use this version, however if your components are out of range then the picture you get will be implementation dependent.
rgbMassivI' :: Int -> Int -> Int -> ColorMassiv Source #
Like rgbI
, but take pre-clamped components for speed.
If you're building a new color for every pixel then use this version, however if your components are out of range then the picture you get will be implementation dependent.
:: Float | Red component. |
-> Float | Green component. |
-> Float | Blue component. |
-> Float | Alpha component. |
-> ColorMassiv |
Make a custom color. All components are clamped to the range [0..1].
makeColorMassivI :: Int -> Int -> Int -> Int -> ColorMassiv Source #
Make a custom color. All components are clamped to the range [0..255].
makeRawColorMassiv :: Float -> Float -> Float -> Float -> ColorMassiv Source #
Make a custom color.
Using this function over makeColor
avoids clamping the components,
which saves time. However, if the components are out of range then
this will result in integer overflow at rendering time, and the actual
picture you get will be implementation dependent.
You'll only need to use this function when using the gloss-raster
package that builds a new color for every pixel. If you're just working
with the Picture data type then it there is no need for raw colors.
makeRawColorMassivI :: Int -> Int -> Int -> Int -> ColorMassiv Source #
Make a custom color, taking pre-clamped components.
rgbaOfColorMassiv :: ColorMassiv -> (Float, Float, Float, Float) Source #
Take the RGBA components of a color.