collage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package collage makes a pic collage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crop

func Crop(img image.Image, r Rectangle) (image.Image, error)

func GetImage

func GetImage(source fs.FS, imageName string) (image.Image, error)

func Make

func Make(req *Request, source fs.FS, output io.Writer) error

Types

type Dimension

type Dimension struct {
	Width  uint `json:"width"`
	Height uint `json:"height"`
}

type HasSubImage

type HasSubImage interface {
	SubImage(r image.Rectangle) image.Image
}

type Photo

type Photo struct {
	ImageName string    `json:"image"`
	Crop      Rectangle `json:"crop"`
	Frame     Rectangle `json:"frame"`
}

type Point

type Point struct {
	X uint `json:"x"`
	Y uint `json:"y"`
}

type Rectangle

type Rectangle struct {
	Start Point `json:"start"`
	End   Point `json:"end"`
}

func FrameTranslate

func FrameTranslate(resolution Dimension, frameSize Dimension, frame Rectangle) Rectangle

func (Rectangle) ToImgRect

func (r Rectangle) ToImgRect() image.Rectangle

type Request

type Request struct {
	BackgroundImage string    `json:"background_image"`
	Aspect          Dimension `json:"aspect"`
	Dimension       Dimension `json:"dimension"`
	Photos          []Photo   `json:"photos"`
}

Jump to

Keyboard shortcuts

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