Twinside / Juicy.Pixels

Haskell library to load & save pictures
BSD 3-Clause "New" or "Revised" License
238 stars 57 forks source link

Convert DynamicImage to Image a in Pixel class? #175

Open Zemyla opened 5 years ago

Zemyla commented 5 years ago

I think the Pixel class should have a pair of functions to convert to and from a DynamicImage:

class (Storable (PixelBaseComponent a), Num (PixelBaseComponent a), Eq a) => Pixel a where
  ...

  toDynamicImage :: Image a -> DynamicImage

  fromDynamicImage :: DynamicImage -> Maybe (Image a)