primitiveutil

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Input      string    `short:"i" description:"input image path" required:"true"`
	Outputs    FlagArray `short:"o" description:"output image path" required:"true"`
	Background string    `short:"b" description:"background color in hex"`
	Number     int       `short:"n" default:"1" description:"number of primitives"`
	Alpha      int       `short:"a" default:"128" description:"alpha value"`
	InputSize  int       `short:"r" default:"256" description:"resize large input images to this size"`
	OutputSize int       `short:"s" default:"1024" description:"output image size"`
	Mode       int       `` /* 219-byte string literal not displayed */
	Workers    int       `short:"j" default:"0" description:"number of parallel workers (default uses all cores)"`
	Nth        int       `long:"nth" default:"1" description:"save every Nth frame (put \"%d\" in path)"`
	Repeat     int       `long:"rep" default:"0" description:"dd N extra shapes per iteration with reduced search"`
	Verbose    []bool    `short:"v" description:"verbose"`
	Configs    ShapeConfigs
}

Config use with `-i`, `-o`, and `-n`.

func (*Config) Create

func (cfg *Config) Create(filenames ...string) ([]error, error)

func (*Config) Inflate

func (cfg *Config) Inflate()

func (*Config) SetDefaults

func (cfg *Config) SetDefaults()

type FlagArray

type FlagArray []string

func (*FlagArray) Set

func (i *FlagArray) Set(value string) error

func (*FlagArray) String

func (i *FlagArray) String() string

type Mode

type Mode int
const (
	ModeCombo Mode = iota
	ModeTriangle
	ModeRectangle
	ModeEllipose
	ModeCircle
	ModeRotatedRectangle
	ModeBeziers
	ModeRotatedEllipse
	ModePolygon
)

type ShapeConfig

type ShapeConfig struct {
	Count  int
	Mode   int
	Alpha  int
	Repeat int
}

type ShapeConfigs

type ShapeConfigs []ShapeConfig

func (*ShapeConfigs) Set

func (i *ShapeConfigs) Set(value string, mode, alpha, repeat int) error

func (*ShapeConfigs) String

func (i *ShapeConfigs) String() string

Directories

Path Synopsis
cmd
cli2 command

Jump to

Keyboard shortcuts

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