Documentation ¶
Overview ¶
Mint is a program for minting NFTs on the Chia Blockchain.
Index ¶
- func CenterOffset(center image.Point, bounds image.Rectangle) image.Point
- func GrowImage(orig image.Image, bounds image.Rectangle) image.Image
- func ScaleRectangle(sx, sy float64, orig image.Rectangle) image.Rectangle
- type Asset
- type Attribute
- type AttributeWeightInterval
- type AttributeWeightIntervals
- type Configuration
- type Generator
- type Minter
- type Piece
- type Region
- type Scale
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CenterOffset ¶
CenterOffset gets the offset required to center a rectangle, bounds, on a point, center
Types ¶
type Asset ¶
type Asset struct { Kind string // @TODO: decide how this should be typed; Should this be many? Path string Image image.Image // @TODO: Consider embedding. Parent *Region Regions []*Region }
Asset is a type of image asset which has an asset type, Kind, a filepath, Path, an image, Image and a slice of available overlay regions, Regions.
func (*Asset) Composite ¶
Composite climbs the current composition tree branch and composites down from the leaves. Returns image.Image, nil, when successful; nil, nil, at leaf; and nil/image.Image, error when there was a failure. @TODO: Find things to error about...
type AttributeWeightInterval ¶
type AttributeWeightIntervals ¶
type AttributeWeightIntervals []*AttributeWeightInterval
func (AttributeWeightIntervals) Attribute ¶
func (a AttributeWeightIntervals) Attribute(f float64) Attribute
Attribute returns the first attribute for which f is less than its computed distribution threshold. It assumes itself to be sorted.
type Configuration ¶
type Configuration struct {
Assets []*Assets
}
Configuration contains configuration data on assets to be used for generating Pieces.
type Generator ¶
type Generator interface {
Generate() (nft.Collection, error)
}
type Piece ¶
type Piece struct { Id uint // @TODO: add attributes and a way to set them. Perhaps, a func type. *Asset }
Piece represents a piece of artwork, with a *Region slice, Regions, for defining the composition tree, and an image.Image onto which it is to be composited, Canvas.
func NewPiece ¶
NewPiece creates a new piece from a base image.Image, canvas, or creates new image from bounds.
type Region ¶
Region defines an overlay region, with center-point coordinates, Coords, a slice of applicable kinds, Kinds, and an asset to overlay, Asset.
func (*Region) Coordinates ¶
Coordinates is a getter function for region coordinates. Defaults to center.