| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Pigy.Image
Description
Image blending using a genetics strategy.
Synopsis
- data Genotype
- newGenotype :: StatefulGen g IO => g -> IO Genotype
- toChromosome :: Genotype -> Chromosome
- fromChromosome :: Chromosome -> Maybe Genotype
- fromChromosome' :: Binary a => Chromosome -> Maybe a
- crossover :: MonadFail m => StatefulGen g m => g -> [Genotype] -> m Genotype
- toPngBytes :: Phenotype -> ByteString
- writeImage :: MonadIO m => FilePath -> Phenotype -> m ()
- toImage :: Phenotype -> Image PixelRGBA8
Documentation
A versioned genotype.
Constructors
| GenotypeV0 Genotype | Version 0. |
| GenotypeV1 Genotype | Version 1. |
Instances
| Eq Genotype Source # | |
| Ord Genotype Source # | |
| Show Genotype Source # | |
| Binary Genotype Source # | |
| Phenable Genotype Source # | |
Defined in Pigy.Image Methods toPhenotype :: Genotype -> Phenotype Source # | |
| Uniform Genotype Source # | |
Defined in Pigy.Image | |
| Upgradeable Genotype Genotype Source # | |
| Upgradeable Genotype Genotype Source # | |
Arguments
| :: StatefulGen g IO | |
| => g | The random-number generator. |
| -> IO Genotype | The action to create the genotype. |
Create a new genotype at random.
Arguments
| :: Genotype | The genotype. |
| -> Chromosome | The chromosome. |
Convert a genotype to a chromosome.
Arguments
| :: Chromosome | The chromosome. |
| -> Maybe Genotype | The genotype, if the chromosome was valid. |
Convert a chromosome to a genotype.
Arguments
| :: Binary a | |
| => Chromosome | The chromosome. |
| -> Maybe a | The serializable, if the chromosome was valid. |
Convert a chromosome to something serializable.
Arguments
| :: MonadFail m | |
| => StatefulGen g m | |
| => g | The random-number generator. |
| -> [Genotype] | The genotypes to be crossed. |
| -> m Genotype | The action to cross the genotypes. |
Perform crossover between genotypes.
Arguments
| :: Phenotype | The phenotype. |
| -> ByteString | The PNG image bytes. |
Convert a phenotype to a PNG image.
Arguments
| :: MonadIO m | |
| => FilePath | The path to the PNG file. |
| -> Phenotype | The phenotype. |
| -> m () | The action to write the PNG file. |
Write a phenotype to a PNG file.