This commit is contained in:
Jack Wines 2018-12-17 00:01:35 -05:00
parent 999efb0bf4
commit bc7011f86a
2 changed files with 0 additions and 70 deletions

View file

@ -1,43 +0,0 @@
# packages:
# - some-directory
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
# - location:
# git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a
# subdirs:
# - auto-update
# - wai
packages:
- .
# Dependency packages to be pulled from upstream that are not in the resolver
# using the same syntax as the packages field.
# (e.g., acme-missiles-0.3)
extra-deps:
- hip-1.5.3.0
- Chart-1.9
- Chart-diagrams-1.9
- SVGFonts-1.6.0.3
# Override default flag values for local packages and extra-deps
# flags: {}
# Extra package databases containing global packages
# extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
#
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: ">=1.7"
#
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
#
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
#
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor

View file

@ -1,27 +0,0 @@
{-# LANGUAGE TupleSections #-}
module Lib
( getRandomPixel
) where
import Graphics.Image
import qualified System.Random
type Image_ = Image RPU RGB Double
getRandomPixel :: Image_ -> IO (Int, Int)
getRandomPixel image = do
-- TODO: something fancy with bifunctors
x <- getCoord . rows $ image
y <- getCoord . cols $ image
return (x, y)
where
getCoord :: Int -> IO Int
getCoord = System.Random.getStdRandom . System.Random.randomR . (1,)
-- makeGradGrayImage :: Image_
-- makeGradGrayImage = makeImageR RPU (200, 200) (\(i, j) -> PixelRGB $ fromIntegral (i*j)) / (200*200)
-- displayGradGrayImage :: IO ()
-- displayGradGrayImage = displayImage makeGradGrayImage