Documentation
¶
Index ¶
- func SaveFile(p Painting)
- type Configuration
- type Format
- type Painting
- type Resolution
- type WebImage
- func (w *WebImage) Cleanup()
- func (w WebImage) File() string
- func (w *WebImage) Generate() *gg.Context
- func (w WebImage) GetFormat() Format
- func (w WebImage) GetImage() image.Image
- func (w WebImage) GetQuality() int
- func (w *WebImage) Image() string
- func (w WebImage) PixelDimensions() (width, height int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct {
Workspace string // directory to write images to - tries /dev/shm and /tmp before defaulting to working directory
Format Format
Resolution Resolution
DPI int // no native support but can be used to calculate desired size of gg.Context
Quality int // ignored by PNG
Iterations int // number of iterations (random polygon generation step)
WriteFile bool // used to prepare/generate without writing to disk to store in memory until needed
// contains filtered or unexported fields
}
func NewJPGConfiguration ¶
func NewJPGConfiguration(workspace ...string) Configuration
func NewPNGConfiguration ¶
func NewPNGConfiguration(workspace ...string) Configuration
type Resolution ¶
type Resolution int
const ( DEFAULT Resolution = iota // 720p HIGHER // 1080p HIGHEST // 4k LOWER // 360p LOWEST // 240p FAVICON // 32x32 APPLE // 120x120 // print-specific dimensions PRINT4x6 PRINT5x7 PRINT8x10 PRINTWALLET POSTER11x14 POSTER12x18 POSTER16x20 POSTER20x30 POSTER24x36 BANNER2x6 BANNER2x8 PHOTOGIFT CARD4x8 CARD5x7 CARDFOLDED5x7 POSTCARD425x6 POSTCARD5x7 PHOTOBOOK BRAGBOOK NOTEBOOK NOTEPAD STICKERS CANVAS8x10 CANVAS11x14 CANVAS12x12 CANVAS16x20 CANVAS20x24 CANVAS20x30 )
type WebImage ¶
type WebImage struct {
Configuration
// contains filtered or unexported fields
}
func NewRandomJPG ¶
func NewRandomPNG ¶
func (WebImage) GetQuality ¶
func (WebImage) PixelDimensions ¶
Click to show internal directories.
Click to hide internal directories.
