imagecollage

package
v2.0.0-...-a0a7059 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STBRP_HEURISTIC_Skyline_default       = 0
	STBRP_HEURISTIC_Skyline_BL_sortHeight = 0
	STBRP_HEURISTIC_Skyline_BF_sortHeight = 1
)
View Source
const SIDE_LENGTH_WEIGHT = 20
View Source
const STBRP__INIT_skyline = 1
View Source
const STBRP__MAXVAL = 0x7fffffff
View Source
const WHITESPACE_WEIGHT = 1

weights: greater side length produces more square-like output

Variables

This section is empty.

Functions

func DrawRect

func DrawRect(x1, y1, x2, y2, thickness int, col color.Color, img *image.NRGBA)

func STBRPInitTarget

func STBRPInitTarget(context *STBRPContext, width, height int, nodes []*STBRPNode)

func STBRPPackRects

func STBRPPackRects(context *STBRPContext, rects []*STBRPRect) int

Types

type Collage

type Collage interface {
	AddImageFile(path string) error
	AddRect(name string, width, height int64) error
	Pack() (Layout, error)
	CreateImage(layout Layout, dirName string) (image.Image, error)
	CreateLayout(layout Layout) (*PictureFS.Layout, error)
	CreateJSON(layout Layout) ([]byte, error)
}

type Layout

type Layout struct {
	Width, Height int64
	Rects         []Rect
}

type Position

type Position struct {
	// contains filtered or unexported fields
}

type Rect

type Rect struct {
	Name          string
	X, Y          int64
	Width, Height int64
}

type STBRPContext

type STBRPContext struct {
	// contains filtered or unexported fields
}

type STBRPCoord

type STBRPCoord int

type STBRPNode

type STBRPNode struct {
	// contains filtered or unexported fields
}

type STBRPRect

type STBRPRect struct {
	// contains filtered or unexported fields

} // 16 bytes, nominally

func NewSTBRPRect

func NewSTBRPRect(w, h int) *STBRPRect

func (*STBRPRect) SetDimensions

func (rect *STBRPRect) SetDimensions(w, h int)

type SemibranCollage

type SemibranCollage struct {
	// contains filtered or unexported fields
}

func NewSemibranCollage

func NewSemibranCollage(
	basePath string,
	borderWidth, margin int64,
	marginLeft, marginTop, marginRight, marginBottom int64,
) *SemibranCollage

func (*SemibranCollage) AddImageFile

func (sc *SemibranCollage) AddImageFile(path string) error

func (*SemibranCollage) AddRect

func (sc *SemibranCollage) AddRect(name string, width, height int64) error

func (*SemibranCollage) CreateImage

func (sc *SemibranCollage) CreateImage(layout Layout, dirName string) (image.Image, error)

func (*SemibranCollage) CreateJSON

func (sc *SemibranCollage) CreateJSON(layout Layout) ([]byte, error)

func (*SemibranCollage) CreateLayout

func (sc *SemibranCollage) CreateLayout(layout Layout) (*PictureFS.Layout, error)

func (*SemibranCollage) Pack

func (sc *SemibranCollage) Pack() (Layout, error)

type Size

type Size struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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