favicon

package
v0.0.0-...-bcfd3a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack

func Pack(files []string, output string)

Types

type BitmapFileHeader

type BitmapFileHeader struct {
	Signature [2]byte // The header field used to identify the BMP and DIB file is 0x42 0x4D in hexadecimal, same as BM in ASCII.
	FileSize  uint32  // The size of the BMP file in bytes

	Offset uint32 // The offset, i.e. starting address, of the byte where the bitmap image data (pixel array) can be found.
	// contains filtered or unexported fields
}

type DIBHeader

type DIBHeader struct {
	Size                 uint32 // the size of this header, in bytes (40)
	Width                uint32 // the bitmap width in pixels (signed integer)
	Height               uint32 // the bitmap height in pixels (signed integer)
	ColorPlanes          uint16 // the number of color planes (must be 1)
	BitsPerPixel         uint16 // the number of bits per pixel, which is the color depth of the image. Typical values are 1, 4, 8, 16, 24 and 32.
	Compression          uint32 // the compression method being used. See the next table for a list of possible values
	ImageSize            uint32 // the image size. This is the size of the raw bitmap data; a dummy 0 can be given for BI_RGB bitmaps.
	HorizontalResolution uint32 // the horizontal resolution of the image. (pixel per metre, signed integer)
	VerticalResolution   uint32 // the vertical resolution of the image. (pixel per metre, signed integer)
	ColorCount           uint32 // the number of colors in the color palette, or 0 to default to 2^n
	ImportantColorCount  uint32 // the number of important colors used, or 0 when every color is important; generally ignored
}

Windows BITMAPINFOHEADER - there are other possibilities, but this looks to be the most common possibility.

type Favicon

type Favicon struct {
	// contains filtered or unexported fields
}

func New

func New(file *os.File) (*Favicon, error)

func (Favicon) SaveAsBMPs

func (favicon Favicon) SaveAsBMPs(nameRoot string) error

func (Favicon) SaveAsPNGs

func (favicon Favicon) SaveAsPNGs(nameRoot string) error

type IconDir

type IconDir struct {
	Type       uint16 // Specifies image type: 1 for icon (.ICO) image, 2 for cursor (.CUR) image. Other values are invalid.
	ImageCount uint16 // Specifies number of images in the file.
	// contains filtered or unexported fields
}

type IconDirEntry

type IconDirEntry struct {
	Width      byte // Specifies image width in pixels. Can be any number between 0 and 255. Value 0 means image width is 256 pixels.
	Height     byte // Specifies image height in pixels. Can be any number between 0 and 255. Value 0 means image height is 256 pixels.
	ColorCount byte // Specifies number of colors in the color palette. Should be 0 if the image does not use a color palette.

	ColorPlanes  uint16 // Specifies color planes. Should be 0 or 1.
	BitsPerPixel uint16 // Specifies bits per pixel.
	Size         uint32 // Specifies the size of the image's data in bytes.
	Offset       uint32 // Specifies the offset of BMP or PNG data from the beginning of the ICO file
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL