Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownEncoding is an error that is thrown when the image is with unsupported encoding ErrUnknownEncoding = errors.New("Unknown image encoding provided") // ErrEmptyImage is an error thrown when the provided image is empty ErrEmptyImage = errors.New("Provided empty image") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
SortOrder SortOrder
TextureHeight int
TextureWidth int
Merge bool
Crop bool
Square bool
Rotate bool
Border int
Extrude int
AutoGrow bool
Autosize bool
CropThreshold int
AutoSizeThreshold int
MinTextureSizeX int
MinTextureSizeY int
Heuristic Heuristic
}
Config is the packer configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default config for the packer
type InputImage ¶
type InputImage struct {
Name string
// contains filtered or unexported fields
}
InputImage is the image wrapper that defines the position of the
func (*InputImage) Bounds ¶
func (i *InputImage) Bounds() image.Rectangle
Bounds get the bounds for the provided image
func (*InputImage) PackedPosition ¶
func (i *InputImage) PackedPosition() image.Point
PackedPosition gets the position of the image within the packed image
func (*InputImage) TextureID ¶
func (i *InputImage) TextureID() int
TextureID gets the target image (output) texture id
type OutputImage ¶
OutputImage is the packed image, result from the Packer Pack
type Packer ¶
type Packer struct {
Ltr bool
MinFillRate int
Rotate Rotation
OutputImages []*OutputImage
// contains filtered or unexported fields
}
Packer is the image 2d bin packer
func (*Packer) AddImageBytes ¶
func (p *Packer) AddImageBytes(data []byte) (*InputImage, error)
AddImageBytes add the image in the form of raw bytes
func (*Packer) AddImageReader ¶
func (p *Packer) AddImageReader(r io.Reader) (*InputImage, error)
AddImageReader adds the image from the reader
Click to show internal directories.
Click to hide internal directories.