CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 10:11:34 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=9d4a970ad759ab4e4e9487aec3e6aa9e8cace928062f4d8cf422f1a435c46fe5a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22qAG9CL3zMKAaz4a3URQjVfZ0s0o7I6mI%22%3B%7D; HttpOnly; Path=/
cf-ray: 98de0db868eddfa6-BLR
new haskell - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import System.Environment (getArgs)
- import Codec.Picture
- import GHC.Float
- sqrFloat :: Float -> Float
- sqrFloat x = x * x
- colorDistance :: PixelRGBA8 -> PixelRGBA8 -> Float
- colorDistance (PixelRGBA8 r1 g1 b1 a1) (PixelRGBA8 r2 g2 b2 a2) = sqrtFloat(sqrFloat frd + sqrFloat fgd + sqrFloat fbd + sqrFloat fad)
- where
- frd = fromIntegral r2 - fromIntegral r1
- fgd = fromIntegral g2 - fromIntegral g1
- fbd = fromIntegral b2 - fromIntegral b1
- fad = fromIntegral a2 - fromIntegral a1
- -- Function to process each pixel
- processPixel :: PixelRGBA8 -> IO ()
- processPixel (PixelRGBA8 r g b a) = putStrLn $ "Red: " ++ show r ++ ", Green: " ++ show g ++ ", Blue: " ++ show b ++ ", Alpha: " ++ show a
- -- Function to traverse all pixels in the image
- traversePixels :: Image PixelRGBA8 -> IO ()
- traversePixels img = mapM_ (\(x, y) -> processPixel (pixelAt img x y)) [(x, y) | y <- [0 .. imageHeight img - 1], x <- [0 .. imageWidth img - 1]]
- main :: IO ()
- main = do
- args <- getArgs
- img <- readImage $ head args
- case img of
- Left err -> putStrLn $ "Error loading image: " ++ err
- Right dynImg -> case convertRGBA8 dynImg of
- img -> traversePixels img
Advertisement
Add Comment
Please, Sign In to add comment
-
π Instant BTC Profit Method β
Working E
JavaScript | 2 sec ago | 0.25 KB
-
β
Make $2500 in 20 minutesβ X
JavaScript | 11 sec ago | 0.25 KB
-
π΅ Make 3000$ in 20 minutes π΅
JavaScript | 18 sec ago | 0.24 KB
-
π Swapzone +37% glitch β 5
JavaScript | 19 sec ago | 0.25 KB
-
β
β Make huge profits on trading ββ T
JavaScript | 27 sec ago | 0.25 KB
-
π ChangeNOW Exploit
JavaScript | 27 sec ago | 0.24 KB
-
β
Marketplace Glitch β
Working NEVER SEEN BE...
JavaScript | 35 sec ago | 0.25 KB
-
π Swapzone +37% glitch
JavaScript | 36 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand