domain

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

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

Go to latest
Published: Feb 3, 2024 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 Card

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

CardContent is a struct for generating card image @TODO CARDの数が多すぎる場合はPoolを検討する

func NewCard

func NewCard(f []FormattedText, n string) Card

NewCard returns new card

func (Card) FormattedTexts

func (c Card) FormattedTexts() []FormattedText

FormattedTexts returns formatted texts

func (Card) Name

func (c Card) Name() string

Name returns name

type CardAdapter

type CardAdapter interface {
	// Cards returns all cards by map name to FormattedText and styles
	Fetch(style, card []byte) ([]Card, error)
}

type ExportImageAdapter

type ExportImageAdapter interface {
	// Save saves images to file
	Save([]Image) error
}

type FormattedText

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

FormattedText is a struct for text and style This value is used for generating Card

func NewFormattedText

func NewFormattedText(sentence string, style *Style) FormattedText

func (*FormattedText) Point26_6

func (s *FormattedText) Point26_6() fixed.Point26_6

func (FormattedText) Style

func (ft FormattedText) Style() Style

func (FormattedText) Text

func (ft FormattedText) Text() string

type Image

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

func NewImage

func NewImage(i *image.RGBA, s common.Size, n string) Image

NewImage returns new image

func (Image) Image

func (i Image) Image() *image.RGBA

Image returns image @todo deepcopy?

func (Image) Name

func (i Image) Name() string

Name returns name

func (Image) Size

func (i Image) Size() common.Size

Size returns size

type ImageAdapter

type ImageAdapter interface {
	// GenerateCardImages generates card images from card contents
	GenerateCardImages([]Card) ([]Image, error)
	// GeneratePrintImages generates card image for print from card contents
	GeneratePrintImages([]Image) ([]Image, error)
}

type Style

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

Style is a struct for text style definition can define position, fontsize and color

func NewStyle

func NewStyle(name string, position image.Point, fontsize float64, rgba color.RGBA) Style

func (Style) FontSize

func (s Style) FontSize() float64

func (Style) RGBA

func (s Style) RGBA() color.RGBA

type StyleAdapter

type StyleAdapter interface {
	// Styles returns all styles
	StylesMap() (map[string]Style, error)
}

Jump to

Keyboard shortcuts

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