Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const Version = "0.3.5"
Variables ¶
View Source
var Ratios = [...]AspectRatio{ {0.5625, "tiktok", 9, 16, Portrait}, {0.75, "instax", 3, 4, Portrait}, {1.0, "square", 1, 1, Square}, {1.19, "movietone", 19, 16, Landscape}, {1.333, "four-thirds", 4, 3, Landscape}, {1.375, "academy", 4, 3, Landscape}, {1.50, "leica", 3, 2, Landscape}, {1.66, "super16", 5, 3, Landscape}, {1.77, "sixteen-nine", 16, 9, Landscape}, {1.85, "flat", 37, 20, Landscape}, {2.0, "univisium", 2, 1, Landscape}, {2.35, "cinemascope", 47, 20, Landscape}, {2.59, "cinerama", 70, 27, Landscape}, {3.0, "widelux", 3, 1, Landscape}, {4.0, "polyvision", 4, 1, Landscape}, {12.0, "circle-vision", 12, 1, Landscape}, }
Functions ¶
This section is empty.
Types ¶
type AspectRatio ¶
type AspectRatio struct { Ratio float64 Name string X int64 Y int64 Orientation Orientation }
func FromImage ¶
func FromImage(path string) (*AspectRatio, error)
Example ¶
package main import ( "blekksprut.net/aspeq" "fmt" ) func main() { ar, err := aspeq.FromImage("1.66.jpeg") if err != nil { panic(err) } fmt.Println(ar.Name) }
Output: super16
func Match ¶ added in v0.2.0
func Match(w int, h int) *AspectRatio
Example ¶
package main import ( "blekksprut.net/aspeq" "fmt" ) func main() { ar := aspeq.Match(1920, 1080) fmt.Println(ar.Name) }
Output: sixteen-nine
func (*AspectRatio) Xy ¶
func (ar *AspectRatio) Xy() string
Click to show internal directories.
Click to hide internal directories.