Documentation ¶
Overview ¶
Package icns provides read/write operations for the Apple ICNS file format. It currently only supports a subset of the specification, covering JPEG and PNG data types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compatibility ¶
type Compatibility uint
Compatibility represents compatibility with an OS version.
const ( // Allegro is 8.5 Allegro Compatibility = iota // Cheetah is 10.0 Cheetah // Leopard is 10.5 Leopard // Lion is 10.7 Lion // MountainLion is 10.8 MountainLion // Newest version Newest = MountainLion // Oldest version Oldest Compatibility = Allegro )
type ICNS ¶
type ICNS struct {
// contains filtered or unexported fields
}
ICNS encapsulates the Apple Icon Image format specification.
func (*ICNS) Add ¶
Add adds new image to the icon, assuming its resolution is acceptable. This also replaces previous images at that resolution.
func (*ICNS) ByResolution ¶
func (i *ICNS) ByResolution(r Resolution) (image.Image, error)
ByResolution extracts an image from the icon, at the provided resolution.
func (*ICNS) HighestResolution ¶
HighestResolution extracts the image from the icon that has the highest resolution.
type Option ¶
type Option func(*ICNS)
Option is the type for ICNS creation options.
func WithMaxCompatibility ¶
func WithMaxCompatibility(c Compatibility) Option
WithMaxCompatibility sets the maximum expected compatibility (defaults to Newest).
func WithMinCompatibility ¶
func WithMinCompatibility(c Compatibility) Option
WithMinCompatibility sets the minimum expected compatibility (defaults to Oldest).
type Resolution ¶
type Resolution = codec.Resolution
Resolution represents the supported resolutions in pixels.
const ( Pixel16 Resolution = 16 Pixel32 Resolution = 32 Pixel48 Resolution = 48 Pixel64 Resolution = 64 Pixel128 Resolution = 128 Pixel256 Resolution = 256 Pixel512 Resolution = 512 Pixel1024 Resolution = 1024 )
All supported resolutions