-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I like to have a function that returns a human readable name for the pixel format like so:
pixelFormatName :: Juicy.DynamicImage -> String
pixelFormatName pic =
case pic of
Juicy.ImageY8 _ -> "Greyscale 8-bit"
Juicy.ImageY16 _ -> "Greyscale 16-bit"
Juicy.ImageY32 _ -> "Greyscale 32-bit"
Juicy.ImageYF _ -> "Greyscale Floating Point"
Juicy.ImageYA8 _ -> "Luminance + Alpha 8-bit"
Juicy.ImageYA16 _ -> "Luminance + Alpha 16-bit"
Juicy.ImageRGB8 _ -> "RGB 8-bit"
Juicy.ImageRGB16 _ -> "RGB 16-bit"
Juicy.ImageRGBA8 _ -> "RGBA 8-bit"
Juicy.ImageRGBA16 _ -> "RGBA 16-bit"
Juicy.ImageYCbCr8 _ -> "YCbCr 8-bit"
Juicy.ImageCMYK8 _ -> "CMYK 8-bit"
Juicy.ImageCMYK16 _ -> "CMYK 16-bit"
Juicy.ImageRGBF _ -> "RGB Floating Point"
undefinedImage :: Juicy.Image a
undefinedImage = error "no image"
I want to use this to tell people that I encountered a format that I do not support. I propose to add also undefinedImage in order to tell a format that I support. I can write this function on my own but I have to adapt it to every future extension of the DynamicImage enumeration that I do not support.
Metadata
Metadata
Assignees
Labels
No labels