picedit 0.2.2.0 → 0.2.3.0
raw patch · 2 files changed
+5/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- picedit.cabal +1/−1
- src/Data/Picture.hs +4/−4
picedit.cabal view
@@ -1,5 +1,5 @@ name: picedit-version: 0.2.2.0+version: 0.2.3.0 synopsis: simple image manipulation functions description: Simple set of functions for image manipulation: contrast, brightnesss, rotation, etc. homepage: https://github.com/mdibaiee/picedit#readme
src/Data/Picture.hs view
@@ -177,12 +177,12 @@ resize (sWidth, sHeight) (r, g, b, a) = (f r, f g, f b, f a) where initial = vector [0..fromIntegral sWidth * fromIntegral sHeight - 1]- (width, height) = (rows r, cols r)+ (width, height) = (cols r, rows r) factor = 2 ^ 16 (xRatio, yRatio) = (width * factor `div` sWidth + 1, height * factor `div` sHeight + 1)- f m = tr $ reshape sWidth $ V.map replace initial+ f m = reshape sWidth $ V.map replace initial where- v = flatten (tr m)+ v = flatten m replace index = let (x, y) = (floor index `mod` sWidth, floor index `div` sWidth) (px, py) = (x * xRatio `div` factor, y * yRatio `div` factor)@@ -193,7 +193,7 @@ scale 1 p = p scale s (r, g, b, a) = resize (floor $ s * width, floor $ s * height) (r, g, b, a) where- (width, height) = (fromIntegral $ rows r, fromIntegral $ cols r)+ (width, height) = (fromIntegral $ cols r, fromIntegral $ rows r) bound (l, u) x = max l $ min u x