image_generators

package
v0.0.0-...-2911f81 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateImage

func GenerateImage(in *pb.ImageRequest, generator ImageGenerator, seed int64) (*pb.ImageResponse, error)

Generates the image from the passed generator

func Init

func Init()

Initialises the constants given by env variables

Types

type Bounce

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

func (*Bounce) Draw

func (s *Bounce) Draw(ctx *gg.Context) (image.Image, error)

func (*Bounce) GetContextDimensions

func (s *Bounce) GetContextDimensions() (int, int)

func (*Bounce) GetFramesAmount

func (s *Bounce) GetFramesAmount() int

func (*Bounce) GetPostURL

func (s *Bounce) GetPostURL() string

func (Bounce) GetQueueCapacity

func (s Bounce) GetQueueCapacity() int

func (*Bounce) Init

func (s *Bounce) Init(seed int64) (ImageGenerator, error)

func (*Bounce) Update

func (s *Bounce) Update() error

type Fluid

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

func (*Fluid) Draw

func (s *Fluid) Draw(ctx *gg.Context) (image.Image, error)

func (*Fluid) GetContextDimensions

func (s *Fluid) GetContextDimensions() (int, int)

func (*Fluid) GetFramesAmount

func (s *Fluid) GetFramesAmount() int

func (*Fluid) GetPostURL

func (s *Fluid) GetPostURL() string

func (Fluid) GetQueueCapacity

func (s Fluid) GetQueueCapacity() int

func (*Fluid) Init

func (s *Fluid) Init(seed int64) (ImageGenerator, error)

func (*Fluid) Update

func (s *Fluid) Update() error

type ImageGenerator

type ImageGenerator interface {
	// Initialise the generator
	Init(int64) (ImageGenerator, error)

	// Gets called sequentially once per frame
	Update() error
	Draw(*gg.Context) (image.Image, error)

	// Getters for constants
	GetFramesAmount() int
	GetContextDimensions() (int, int) // Width x Height
	GetPostURL() string
	// How many jobs of this generator can run at once
	GetQueueCapacity() int
}

Jump to

Keyboard shortcuts

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