Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnitMetre = &LengthUnit{Rat: *big.NewRat(1, 1)} UnitCentimetre = &LengthUnit{Rat: metersIn1Centimeter} UnitInch = &LengthUnit{Rat: metersIn1Inch} UnitPixelsPerMetre = &PixelDensityUnit{Rat: *big.NewRat(1, 1)} UnitPixelsPerCentimetre = &PixelDensityUnit{Rat: metersIn1Centimeter} UnitPixelsPerInch = &PixelDensityUnit{Rat: metersIn1Inch} )
Functions ¶
This section is empty.
Types ¶
type Flip ¶
type Flip string
func (Flip) Heteroriented ¶
Heteroriented will be true if the card need to pivot about a diagonal axis for the front and back to remain upright. the negation of this method is always whether the card is homoriented or not.
type LatLong ¶
func (LatLong) MarshalJSON ¶
func (LatLong) MarshalYAML ¶
func (*LatLong) UnmarshalJSON ¶
func (*LatLong) UnmarshalYAML ¶
type Length ¶
type Length struct { Count *big.Rat Unit *LengthUnit }
func (Length) Convert ¶
func (l Length) Convert(u *LengthUnit) Length
func (Length) In ¶
func (l Length) In(u *LengthUnit) float64
func (Length) MarshalJSON ¶
func (*Length) UnmarshalJSON ¶
type LengthUnit ¶
type LengthUnit Unit
func (*LengthUnit) String ¶
func (l *LengthUnit) String() string
type LocalizedText ¶
type Metadata ¶
type Metadata struct { Location LatLong `json:"location,omitempty"` Flip Flip `json:"flip" yaml:"flip"` SentOn Date `json:"sentOn,omitempty" yaml:"sent_on"` Sender string `json:"sender,omitempty"` Recipient string `json:"recipient,omitempty"` Front Side `json:"front,omitempty"` Back Side `json:"back,omitempty"` FrontDimensions Size `json:"frontSize" yaml:",omitempty"` }
type PixelDensity ¶
type PixelDensity struct { Count *big.Rat Unit *PixelDensityUnit }
func (PixelDensity) Convert ¶
func (pd PixelDensity) Convert(u *PixelDensityUnit) PixelDensity
Convert returns a new pixel density struct in the given units, converting without loss of fidelity. Will panic if the unit is of the wrong type.
func (PixelDensity) String ¶
func (pd PixelDensity) String() string
type PixelDensityUnit ¶
type PixelDensityUnit Unit
func (*PixelDensityUnit) String ¶
func (pd *PixelDensityUnit) String() string
type Point ¶
Point represents a point on a postcard, stored as a percentage of the width (X) or height (Y) where 1.0 is the right, or bottom, of the postcard, and 0 is the left, or top.
type Polygon ¶
type Polygon []Point
func (Polygon) MarshalJSON ¶
func (Polygon) MarshalYAML ¶
func (*Polygon) UnmarshalJSON ¶
func (*Polygon) UnmarshalYAML ¶
type Resolution ¶
type Resolution struct { XResolution PixelDensity YResolution PixelDensity }
func (Resolution) Convert ¶
func (r Resolution) Convert(u *PixelDensityUnit) Resolution
func (Resolution) Size ¶
func (r Resolution) Size(w, h int) Size
func (Resolution) String ¶
func (r Resolution) String() string
type SecretPolygon ¶
type SecretType ¶
type SecretType struct {
Type string `yaml:"type"`
}
type Side ¶
type Side struct { Description LocalizedText `json:"description,omitempty"` Transcription LocalizedText `json:"transcription,omitempty"` Secrets []Polygon `json:"secrets,omitempty"` }
type Size ¶
func (Size) Convert ¶
func (s Size) Convert(u *LengthUnit) Size
func (Size) Resolution ¶
func (s Size) Resolution(w, h int) Resolution
Click to show internal directories.
Click to hide internal directories.