fixed conflict
This commit is contained in:
commit
798d642d66
7 changed files with 75 additions and 80 deletions
43
#stack.yaml#
Normal file
43
#stack.yaml#
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# 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
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.stack-work/*
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
module Main where
|
||||
|
||||
import Lib
|
||||
import Graphics.Image
|
||||
|
||||
main :: IO ()
|
||||
main = someFunc
|
||||
main = do
|
||||
image <- readImageRGB VU "sierra.jpg"
|
||||
displayImage image
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
-- This file has been generated from package.yaml by hpack version 0.28.2.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: 8096688bf99aec489ca869a3375d3474da0528acd8ea5ebdf3092cc33518dcbc
|
||||
|
||||
name: image-triangles
|
||||
version: 0.1.0.0
|
||||
description: Please see the README on GitHub at <https://github.com/jackoe/image-triangles#readme>
|
||||
homepage: https://github.com/jackoe/image-triangles#readme
|
||||
bug-reports: https://github.com/jackoe/image-triangles/issues
|
||||
author: Jack Wines
|
||||
maintainer: jack@winesj.com
|
||||
copyright: 2018 Jack Wines
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
build-type: Simple
|
||||
cabal-version: >= 1.10
|
||||
extra-source-files:
|
||||
ChangeLog.md
|
||||
README.md
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/jackoe/image-triangles
|
||||
|
||||
library
|
||||
exposed-modules:
|
||||
Lib
|
||||
Render
|
||||
other-modules:
|
||||
Paths_image_triangles
|
||||
hs-source-dirs:
|
||||
src
|
||||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, diagrams
|
||||
, diagrams-lib
|
||||
, diagrams-svg
|
||||
, hip
|
||||
default-language: Haskell2010
|
||||
|
||||
executable image-triangles-exe
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Paths_image_triangles
|
||||
hs-source-dirs:
|
||||
app
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, diagrams
|
||||
, diagrams-lib
|
||||
, diagrams-svg
|
||||
, hip
|
||||
, image-triangles
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite image-triangles-test
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Spec.hs
|
||||
other-modules:
|
||||
Paths_image_triangles
|
||||
hs-source-dirs:
|
||||
test
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, diagrams
|
||||
, diagrams-lib
|
||||
, diagrams-svg
|
||||
, hip
|
||||
, image-triangles
|
||||
default-language: Haskell2010
|
||||
|
|
@ -25,6 +25,7 @@ dependencies:
|
|||
- diagrams
|
||||
- diagrams-lib
|
||||
- diagrams-svg
|
||||
- random
|
||||
|
||||
library:
|
||||
source-dirs: src
|
||||
|
|
|
|||
BIN
sierra.jpg
Normal file
BIN
sierra.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 494 KiB |
31
src/Lib.hs
31
src/Lib.hs
|
|
@ -1,6 +1,27 @@
|
|||
module Lib
|
||||
( someFunc
|
||||
) where
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
|
||||
someFunc :: IO ()
|
||||
someFunc = putStrLn "someFunc"
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue