Documentation ¶
Index ¶
- type CoordinateCollection
- func (c *CoordinateCollection) Coordinates() *[]*MappedCoordinate
- func (c *CoordinateCollection) MaximumTransformedX() float64
- func (c *CoordinateCollection) MaximumTransformedY() float64
- func (c *CoordinateCollection) MinimumTransformedX() float64
- func (c *CoordinateCollection) MinimumTransformedY() float64
- type CoordinateCollectionBuilderOptions
- func (c *CoordinateCollectionBuilderOptions) Build() *CoordinateCollection
- func (c *CoordinateCollectionBuilderOptions) WithComplexNumbers(complexNumbers *[]complex128) *CoordinateCollectionBuilderOptions
- func (c *CoordinateCollectionBuilderOptions) WithCoordinates(coordinates *[]*MappedCoordinate) *CoordinateCollectionBuilderOptions
- type CoordinateThreshold
- type CoordinateThresholdBuilderOptions
- func (e *CoordinateThresholdBuilderOptions) Build() CoordinateThreshold
- func (e *CoordinateThresholdBuilderOptions) WithMaximumX(xMax float64) *CoordinateThresholdBuilderOptions
- func (e *CoordinateThresholdBuilderOptions) WithMaximumY(yMax float64) *CoordinateThresholdBuilderOptions
- func (e *CoordinateThresholdBuilderOptions) WithMinimumX(xMin float64) *CoordinateThresholdBuilderOptions
- func (e *CoordinateThresholdBuilderOptions) WithMinimumY(yMin float64) *CoordinateThresholdBuilderOptions
- type Eyedropper
- type EyedropperBuilderOptions
- func (e *EyedropperBuilderOptions) Build() *RectangularEyedropper
- func (e *EyedropperBuilderOptions) WithBottomSide(yMax int) *EyedropperBuilderOptions
- func (e *EyedropperBuilderOptions) WithImage(sourceImage image.Image) *EyedropperBuilderOptions
- func (e *EyedropperBuilderOptions) WithLeftSide(xMin int) *EyedropperBuilderOptions
- func (e *EyedropperBuilderOptions) WithRightSide(xMax int) *EyedropperBuilderOptions
- func (e *EyedropperBuilderOptions) WithTopSide(yMin int) *EyedropperBuilderOptions
- type MappedCoordinate
- func NewMappedCoordinateUsingInputImageCoordinates(inputImageX, inputImageY int) *MappedCoordinate
- func NewMappedCoordinateUsingOutputImageCoordinates(outputImageX, outputImageY int) *MappedCoordinate
- func NewMappedCoordinateUsingTransformedCoordinates(transformedX, transformedY float64) *MappedCoordinate
- func (m *MappedCoordinate) CanBeCompared() bool
- func (m *MappedCoordinate) HasMappedCoordinate() bool
- func (m *MappedCoordinate) InputImageX() int
- func (m *MappedCoordinate) InputImageY() int
- func (m *MappedCoordinate) MappedCoordinate() (float64, float64)
- func (m *MappedCoordinate) MarkAsSatisfyingFilter()
- func (m *MappedCoordinate) OutputImageX() int
- func (m *MappedCoordinate) OutputImageY() int
- func (m *MappedCoordinate) PatternViewportX() float64
- func (m *MappedCoordinate) PatternViewportY() float64
- func (m *MappedCoordinate) SatisfiesFilter() bool
- func (m *MappedCoordinate) StoreMappedCoordinate(x, y float64)
- func (m *MappedCoordinate) TransformedX() float64
- func (m *MappedCoordinate) TransformedY() float64
- func (m *MappedCoordinate) UpdatePatternViewportCoordinates(x, y float64)
- func (m *MappedCoordinate) UpdateTransformedCoordinates(x, y float64)
- type NullCoordinateThreshold
- type RectangularCoordinateThreshold
- func (c *RectangularCoordinateThreshold) FilterAndMarkMappedCoordinateCollection(collection *CoordinateCollection)
- func (c *RectangularCoordinateThreshold) MaximumX() float64
- func (c *RectangularCoordinateThreshold) MaximumY() float64
- func (c *RectangularCoordinateThreshold) MinimumX() float64
- func (c *RectangularCoordinateThreshold) MinimumY() float64
- type RectangularEyedropper
- func (e *RectangularEyedropper) BottomSide() int
- func (e *RectangularEyedropper) ConvertCoordinatesToColors(collection *CoordinateCollection) *[]color.Color
- func (e *RectangularEyedropper) Image() image.Image
- func (e *RectangularEyedropper) LeftSide() int
- func (e *RectangularEyedropper) RightSide() int
- func (e *RectangularEyedropper) TopSide() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoordinateCollection ¶
type CoordinateCollection struct {
// contains filtered or unexported fields
}
CoordinateCollection holds an array of coordinates as they turn into symmetry patterns.
func (*CoordinateCollection) Coordinates ¶
func (c *CoordinateCollection) Coordinates() *[]*MappedCoordinate
Coordinates returns the collection of coordinates.
func (*CoordinateCollection) MaximumTransformedX ¶
func (c *CoordinateCollection) MaximumTransformedX() float64
MaximumTransformedX returns the greatest TransformedX coordinate in the collection.
func (*CoordinateCollection) MaximumTransformedY ¶
func (c *CoordinateCollection) MaximumTransformedY() float64
MaximumTransformedY returns the greatest TransformedY coordinate in the collection.
func (*CoordinateCollection) MinimumTransformedX ¶
func (c *CoordinateCollection) MinimumTransformedX() float64
MinimumTransformedX returns the lowest TransformedX coordinate in the collection.
func (*CoordinateCollection) MinimumTransformedY ¶
func (c *CoordinateCollection) MinimumTransformedY() float64
MinimumTransformedY returns the lowest TransformedY coordinate in the collection.
type CoordinateCollectionBuilderOptions ¶
type CoordinateCollectionBuilderOptions struct {
// contains filtered or unexported fields
}
CoordinateCollectionBuilderOptions records options used to build a CoordinateCollection.
func CoordinateCollectionBuilder ¶
func CoordinateCollectionBuilder() *CoordinateCollectionBuilderOptions
CoordinateCollectionBuilder creates a CoordinateCollectionBuilderOptions with default values.
Can be chained with other class functions. Call Build() to create the final object.
func (*CoordinateCollectionBuilderOptions) Build ¶
func (c *CoordinateCollectionBuilderOptions) Build() *CoordinateCollection
Build uses the builder options to create a power.
func (*CoordinateCollectionBuilderOptions) WithComplexNumbers ¶
func (c *CoordinateCollectionBuilderOptions) WithComplexNumbers(complexNumbers *[]complex128) *CoordinateCollectionBuilderOptions
WithComplexNumbers sets the coordinates stored in the collection using complex numbers.
The real portion is used as the transformedX coordinate. The imaginary portion is used as the transformedY coordinate.
func (*CoordinateCollectionBuilderOptions) WithCoordinates ¶
func (c *CoordinateCollectionBuilderOptions) WithCoordinates(coordinates *[]*MappedCoordinate) *CoordinateCollectionBuilderOptions
WithCoordinates sets the coordinates stored in the collection.
type CoordinateThreshold ¶
type CoordinateThreshold interface {
FilterAndMarkMappedCoordinateCollection(collection *CoordinateCollection)
}
CoordinateThreshold looks at a CoordinateCollection and determines which coordinates will be kept.
type CoordinateThresholdBuilderOptions ¶
type CoordinateThresholdBuilderOptions struct {
// contains filtered or unexported fields
}
CoordinateThresholdBuilderOptions contains options used to make a RectangularCoordinateThreshold.
func CoordinateFilterBuilder ¶
func CoordinateFilterBuilder() *CoordinateThresholdBuilderOptions
CoordinateFilterBuilder creates a CoordinateThresholdBuilderOptions with default values.
Can be chained with other class functions. Call Build() to create the final object.
func (*CoordinateThresholdBuilderOptions) Build ¶
func (e *CoordinateThresholdBuilderOptions) Build() CoordinateThreshold
Build uses the builder options to create a power.
func (*CoordinateThresholdBuilderOptions) WithMaximumX ¶
func (e *CoordinateThresholdBuilderOptions) WithMaximumX(xMax float64) *CoordinateThresholdBuilderOptions
WithMaximumX sets the maximum transformedX value for the filter.
func (*CoordinateThresholdBuilderOptions) WithMaximumY ¶
func (e *CoordinateThresholdBuilderOptions) WithMaximumY(yMax float64) *CoordinateThresholdBuilderOptions
WithMaximumY sets the maximum transformedY value for the filter.
func (*CoordinateThresholdBuilderOptions) WithMinimumX ¶
func (e *CoordinateThresholdBuilderOptions) WithMinimumX(xMin float64) *CoordinateThresholdBuilderOptions
WithMinimumX sets the minimum transformedX value for the filter.
func (*CoordinateThresholdBuilderOptions) WithMinimumY ¶
func (e *CoordinateThresholdBuilderOptions) WithMinimumY(yMin float64) *CoordinateThresholdBuilderOptions
WithMinimumY sets the minimum transformedY value for the filter.
type Eyedropper ¶
type Eyedropper interface {
ConvertCoordinatesToColors(collection *CoordinateCollection) *[]color.Color
}
Eyedropper uses a set of coordinates to choose colors from a source image.
type EyedropperBuilderOptions ¶
type EyedropperBuilderOptions struct {
// contains filtered or unexported fields
}
EyedropperBuilderOptions stores the options used to build an eyedropper.
func EyedropperBuilder ¶
func EyedropperBuilder() *EyedropperBuilderOptions
EyedropperBuilder creates a EyedropperBuilderOptions with default values.
Can be chained with other class functions. Call Build() to create the final object.
func (*EyedropperBuilderOptions) Build ¶
func (e *EyedropperBuilderOptions) Build() *RectangularEyedropper
Build uses the builder options to create a power.
func (*EyedropperBuilderOptions) WithBottomSide ¶
func (e *EyedropperBuilderOptions) WithBottomSide(yMax int) *EyedropperBuilderOptions
WithBottomSide sets the bottom boundary.
func (*EyedropperBuilderOptions) WithImage ¶
func (e *EyedropperBuilderOptions) WithImage(sourceImage image.Image) *EyedropperBuilderOptions
WithImage sets the source image.
func (*EyedropperBuilderOptions) WithLeftSide ¶
func (e *EyedropperBuilderOptions) WithLeftSide(xMin int) *EyedropperBuilderOptions
WithLeftSide sets the left boundary.
func (*EyedropperBuilderOptions) WithRightSide ¶
func (e *EyedropperBuilderOptions) WithRightSide(xMax int) *EyedropperBuilderOptions
WithRightSide sets the right boundary.
func (*EyedropperBuilderOptions) WithTopSide ¶
func (e *EyedropperBuilderOptions) WithTopSide(yMin int) *EyedropperBuilderOptions
WithTopSide sets the top boundary.
type MappedCoordinate ¶
type MappedCoordinate struct {
// contains filtered or unexported fields
}
MappedCoordinate stores the journey of an individual coordinate.
func NewMappedCoordinateUsingInputImageCoordinates ¶
func NewMappedCoordinateUsingInputImageCoordinates(inputImageX, inputImageY int) *MappedCoordinate
NewMappedCoordinateUsingInputImageCoordinates returns a new mapped coordinate at the given inputImageX and inputImageY location.
func NewMappedCoordinateUsingOutputImageCoordinates ¶
func NewMappedCoordinateUsingOutputImageCoordinates(outputImageX, outputImageY int) *MappedCoordinate
NewMappedCoordinateUsingOutputImageCoordinates returns a new mapped coordinate at the given outputImageX and outputImageY location.
func NewMappedCoordinateUsingTransformedCoordinates ¶
func NewMappedCoordinateUsingTransformedCoordinates(transformedX, transformedY float64) *MappedCoordinate
NewMappedCoordinateUsingTransformedCoordinates returns a new mapped coordinate at the given transformedX and transformedY location.
func (*MappedCoordinate) CanBeCompared ¶
func (m *MappedCoordinate) CanBeCompared() bool
CanBeCompared returns true if either transformedX and transformedY coordinate can be compared.
This means neither are Infinity nor NaN.
func (*MappedCoordinate) HasMappedCoordinate ¶
func (m *MappedCoordinate) HasMappedCoordinate() bool
HasMappedCoordinate returns true if this coordinate stored another mapped coordinate
func (*MappedCoordinate) InputImageX ¶
func (m *MappedCoordinate) InputImageX() int
InputImageX returns the InputImageX coordinate.
func (*MappedCoordinate) InputImageY ¶
func (m *MappedCoordinate) InputImageY() int
InputImageY returns the InputImageY coordinate.
func (*MappedCoordinate) MappedCoordinate ¶
func (m *MappedCoordinate) MappedCoordinate() (float64, float64)
MappedCoordinate returns the stored mapped coordinates.
func (*MappedCoordinate) MarkAsSatisfyingFilter ¶
func (m *MappedCoordinate) MarkAsSatisfyingFilter()
MarkAsSatisfyingFilter marks this coordinate as satisfying the filter.
func (*MappedCoordinate) OutputImageX ¶
func (m *MappedCoordinate) OutputImageX() int
OutputImageX returns the OutputImageX coordinate.
func (*MappedCoordinate) OutputImageY ¶
func (m *MappedCoordinate) OutputImageY() int
OutputImageY returns the OutputImageY coordinate.
func (*MappedCoordinate) PatternViewportX ¶
func (m *MappedCoordinate) PatternViewportX() float64
PatternViewportX returns the PatternViewportX coordinate.
func (*MappedCoordinate) PatternViewportY ¶
func (m *MappedCoordinate) PatternViewportY() float64
PatternViewportY returns the PatternViewportY coordinate.
func (*MappedCoordinate) SatisfiesFilter ¶
func (m *MappedCoordinate) SatisfiesFilter() bool
SatisfiesFilter returns the filtered status.
func (*MappedCoordinate) StoreMappedCoordinate ¶
func (m *MappedCoordinate) StoreMappedCoordinate(x, y float64)
StoreMappedCoordinate sets the coordinate's mapped coordinates.
func (*MappedCoordinate) TransformedX ¶
func (m *MappedCoordinate) TransformedX() float64
TransformedX returns the TransformedX coordinate.
func (*MappedCoordinate) TransformedY ¶
func (m *MappedCoordinate) TransformedY() float64
TransformedY returns the TransformedY coordinate.
func (*MappedCoordinate) UpdatePatternViewportCoordinates ¶
func (m *MappedCoordinate) UpdatePatternViewportCoordinates(x, y float64)
UpdatePatternViewportCoordinates will update patternViewportX and patternViewportY coordinates.
func (*MappedCoordinate) UpdateTransformedCoordinates ¶
func (m *MappedCoordinate) UpdateTransformedCoordinates(x, y float64)
UpdateTransformedCoordinates will update transformedX and transformedY coordinates.
type NullCoordinateThreshold ¶
type NullCoordinateThreshold struct{}
NullCoordinateThreshold is a default object where all coordinates with rational coordinates satisfy the filter.
func (*NullCoordinateThreshold) FilterAndMarkMappedCoordinateCollection ¶
func (c *NullCoordinateThreshold) FilterAndMarkMappedCoordinateCollection(collection *CoordinateCollection)
FilterAndMarkMappedCoordinateCollection marks comparable coordinates as satisfying the filter.
type RectangularCoordinateThreshold ¶
type RectangularCoordinateThreshold struct {
// contains filtered or unexported fields
}
RectangularCoordinateThreshold defines a rectangular range in which coordinates will be kept.
func (*RectangularCoordinateThreshold) FilterAndMarkMappedCoordinateCollection ¶
func (c *RectangularCoordinateThreshold) FilterAndMarkMappedCoordinateCollection(collection *CoordinateCollection)
FilterAndMarkMappedCoordinateCollection checks all coordinates against the filter.
Then it marks each coordinate if it satisfied the filter.
func (*RectangularCoordinateThreshold) MaximumX ¶
func (c *RectangularCoordinateThreshold) MaximumX() float64
MaximumX returns the maximum transformedX value for the filter.
func (*RectangularCoordinateThreshold) MaximumY ¶
func (c *RectangularCoordinateThreshold) MaximumY() float64
MaximumY returns the maximum transformedY value for the filter.
func (*RectangularCoordinateThreshold) MinimumX ¶
func (c *RectangularCoordinateThreshold) MinimumX() float64
MinimumX returns the minimum transformedX value for the filter.
func (*RectangularCoordinateThreshold) MinimumY ¶
func (c *RectangularCoordinateThreshold) MinimumY() float64
MinimumY returns the minimum transformedY value for the filter.
type RectangularEyedropper ¶
type RectangularEyedropper struct {
// contains filtered or unexported fields
}
RectangularEyedropper will sample transformed coordinates against a rectangular portion of the source image.
func (*RectangularEyedropper) BottomSide ¶
func (e *RectangularEyedropper) BottomSide() int
BottomSide returns the bottom side of the boundary.
func (*RectangularEyedropper) ConvertCoordinatesToColors ¶
func (e *RectangularEyedropper) ConvertCoordinatesToColors(collection *CoordinateCollection) *[]color.Color
ConvertCoordinatesToColors uses the collection of coordinates, maps it to the eyedropper range,
and samples the color in the source image at that location. if the coordinate is mapped outside the source image, it will turn transparent.
func (*RectangularEyedropper) Image ¶
func (e *RectangularEyedropper) Image() image.Image
Image returns the source image
func (*RectangularEyedropper) LeftSide ¶
func (e *RectangularEyedropper) LeftSide() int
LeftSide returns the left side of the boundary.
func (*RectangularEyedropper) RightSide ¶
func (e *RectangularEyedropper) RightSide() int
RightSide returns the right side of the boundary.
func (*RectangularEyedropper) TopSide ¶
func (e *RectangularEyedropper) TopSide() int
TopSide returns the top side of the boundary.