Чтение изображения с JuicyPixels

This commit is contained in:
2024-11-17 20:48:05 +03:00
parent d9076f7dfa
commit abb078e1b6
3 changed files with 17 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
module Main (main) where
import Codec.Picture
import Lib
caesarShift :: Int
@@ -18,4 +19,12 @@ main = do
let encryptedTextFromBits = bitsToText encryptedTextBits
putStrLn $ take 30 encryptedTextFromBits
let decryptedText = decryptCaesar alphabet caesarShift encryptedTextFromBits
putStrLn $ take 30 decryptedText
putStrLn $ take 30 decryptedText
readImageResult <- readImage "resources/david.bmp"
case readImageResult of
Left err -> putStrLn $ "Ошибка при чтении изображения: " ++ err
Right dynImg -> do
let img = convertRGB8 dynImg
putStrLn $ "Ширина: " ++ show (imageWidth img)
putStrLn $ "Высота: " ++ show (imageHeight img)

View File

@@ -34,7 +34,8 @@ library
src
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
base >=4.7 && <5
JuicyPixels
, base >=4.7 && <5
default-language: Haskell2010
executable lab3-exe
@@ -47,7 +48,8 @@ executable lab3-exe
app
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
JuicyPixels
, base >=4.7 && <5
, lab3
default-language: Haskell2010
@@ -62,6 +64,7 @@ test-suite lab3-test
test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
JuicyPixels
, base >=4.7 && <5
, lab3
default-language: Haskell2010

View File

@@ -21,6 +21,7 @@ description: Please see the README on GitHub at <https://github.com/gith
dependencies:
- base >= 4.7 && < 5
- JuicyPixels
ghc-options:
- -Wall