Заготовка для генератора картинки
This commit is contained in:
@@ -4,9 +4,14 @@ import Codec.Picture
|
||||
import qualified Data.Vector.Unboxed as VU
|
||||
import Lib
|
||||
|
||||
|
||||
caesarShift :: Int
|
||||
caesarShift = 66
|
||||
|
||||
bitsPerByte :: Int
|
||||
bitsPerByte = 1
|
||||
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
inputText <- readFile "resources/biography.txt"
|
||||
@@ -29,5 +34,8 @@ main = do
|
||||
let img = convertRGB8 dynImg
|
||||
let width = imageWidth img
|
||||
let height = imageHeight img
|
||||
let resultImage = generateImage (encodePixel 1 img encryptedTextBits) width height
|
||||
let totalBits = width * height * 3 * bitsPerByte
|
||||
let bitsPadded = encryptedTextBits VU.++ VU.replicate (totalBits - VU.length encryptedTextBits) 0
|
||||
|
||||
let resultImage = generateImage (encodePixel bitsPerByte img bitsPadded) width height
|
||||
saveBmpImage "tmp/david.bmp" (ImageRGB8 resultImage)
|
||||
|
||||
Reference in New Issue
Block a user