Documentation
¶
Index ¶
- func ComputeAverageColor(img image.Image) color.RGBA
- func Download(urls []ImageURL, downloadDir string, maxConcurrency int) ([]string, error)
- func SavePng(img image.Image, outfile string) error
- func Scale(srcImg image.Image, r image.Rectangle) image.Image
- func ScaleToFile(srcPath, dstPath string, r image.Rectangle) error
- func Serve(addr, uploadRootDir string, imageSource *InstagramClient)
- func SplitPath(path string) []string
- func ToRows(rowLen int, imageURLs []ImageURL) [][]ImageURL
- type ImageURL
- type InstagramClient
- type InstagramData
- type InstagramImage
- type InstagramImageSet
- type InstagramPagination
- type InstagramResponse
- type Mosaic
- type Page
- type Project
- func (p *Project) GeneratedMosaicFile() string
- func (p *Project) ImageUrlsFile() string
- func (p *Project) LoadStatus() error
- func (p *Project) ReceiveUpload(r io.Reader) error
- func (p *Project) SetAndSaveStatus(status Status) error
- func (p *Project) Thumbnails() ([]string, error)
- func (p *Project) ThumbnailsDir() string
- func (p *Project) ToFile(urls []ImageURL) error
- func (p *Project) UploadedImageDir() string
- func (p *Project) UploadedImageFile() string
- type Status
- type Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Downloads the images to the download directory, using goroutines for concurrency. NB: to avoid overwhelming image servers, best to keep maxConcurrency <= 10. This also prevents "dial tcp: no such host" errors on OSX due to file descriptors maxing out.
func Serve ¶
func Serve(addr, uploadRootDir string, imageSource *InstagramClient)
Types ¶
type InstagramClient ¶
type InstagramClient struct {
ClientID string
}
simple client for the Instagram Search API
type InstagramData ¶
type InstagramData struct {
Tags []string `json:"tags"`
ImageSet InstagramImageSet `json:"images"`
}
type InstagramImage ¶
type InstagramImageSet ¶
type InstagramImageSet struct {
LowRes InstagramImage `json:"low_resolution"`
Thumb InstagramImage `json:"thumbnail"`
StandardRes InstagramImage `json:"standard_resolution"`
}
type InstagramPagination ¶
type InstagramResponse ¶
type InstagramResponse struct {
Pagination InstagramPagination `json:"pagination"`
Data []InstagramData `json:"data"`
}
func ParseInstagramJSON ¶
func ParseInstagramJSON(jsonBytes []byte) (InstagramResponse, error)
type Project ¶
Project represents a mosaic project- the uploaded file, selected tile images, and resulting mosaic image
func NewProject ¶
func ReadProject ¶
func (*Project) GeneratedMosaicFile ¶
func (*Project) ImageUrlsFile ¶
func (*Project) LoadStatus ¶
func (*Project) SetAndSaveStatus ¶
func (*Project) Thumbnails ¶
func (*Project) ThumbnailsDir ¶
func (*Project) UploadedImageDir ¶
func (*Project) UploadedImageFile ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
commands
|
|
|
app
command
App is a web server that allows users to upload images and turn them into mosaics.
|
App is a web server that allows users to upload images and turn them into mosaics. |
|
instafetch
command
Fetches tagged images from Instagram
|
Fetches tagged images from Instagram |
|
mosaic
command
|
Click to show internal directories.
Click to hide internal directories.
