Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodingShader ¶
func EncodingShader() *ebiten.Shader
func JFAShader ¶
func JFAShader(opts *GenerateOptions) *ebiten.Shader
Types ¶
type DistanceType ¶
type DistanceType byte
const ( DistanceExterior DistanceType = iota DistanceInterior )
type GenerateOptions ¶
type GenerateOptions struct { // PlainValueOptions defines a list of constraints of minimum // value thresholds (in 0-1 range) to consider a pixel's color as a "plain" value // (as opposed to empty). // For example ColorMaskGreyScale with value: 0.1 means that // the pixel's greyscale value must be over 0.1 to contribute to a plain value. // Multiple options in the list act as an "AND" operation. // By default, it is considered that a pixel is a "plain" value if its // alpha channel > 0. PlainValueThresholds map[ColorMask]float64 // DistanceType defines whether the resulting distance encoding should be a: // - Exterior distance to compute the exterior minimal distance to the shape. // - Interior distance to compute the interior minimal distance to the shape's edges // By default, the exterior distance is encoded. DistanceType DistanceType // EdgesPlain defines whether or not to consider the image's boundaries (or // edges of the image) as plain value for distance calculation. // By default, it is false and edges do not contribute to plain values. EdgesPlain bool // Encoding specifies the way to encode the final distance image. // By default, the distance will be encoded as greyscale with alpha = 255. Encoding Encoding // EncodingScale specifies a value to mutliply the resulting color by. // By default, the scale is 1 (it can exceed 1). EncodingScale float64 // Steps defines the number of iterations to perform, a higher value means // an higher output quality. // Default is 255 steps. Steps int // JumpDistance defines the initial jump distance in the JFA. // Default is 8. JumpDistance int }
Click to show internal directories.
Click to hide internal directories.