imageoutput

package
v0.0.0-...-78d9b97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

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

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

Build uses the builder options to create a power.

func (*CoordinateThresholdBuilderOptions) WithMaximumX

WithMaximumX sets the maximum transformedX value for the filter.

func (*CoordinateThresholdBuilderOptions) WithMaximumY

WithMaximumY sets the maximum transformedY value for the filter.

func (*CoordinateThresholdBuilderOptions) WithMinimumX

WithMinimumX sets the minimum transformedX value for the filter.

func (*CoordinateThresholdBuilderOptions) WithMinimumY

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

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

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

MaximumX returns the maximum transformedX value for the filter.

func (*RectangularCoordinateThreshold) MaximumY

MaximumY returns the maximum transformedY value for the filter.

func (*RectangularCoordinateThreshold) MinimumX

MinimumX returns the minimum transformedX value for the filter.

func (*RectangularCoordinateThreshold) MinimumY

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.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL