menuicon

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package menuicon turns the PNG images of menu items into the pixels a backend that draws them itself needs: premultiplied BGRA, as Windows' 32-bit DIB sections (PARGB) take them, scaled to the menu's size.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Over

func Over(src, dst uint32, opacity float64) uint32

Over returns a premultiplied pixel drawn over an opaque one, 0x00RRGGBB, at an opacity from 0 to 1.

Types

type Image

type Image struct {
	W, H int
	Px   []uint32
}

Image is a decoded image, its pixels premultiplied 0xAARRGGBB, row after row from the top.

func Decode

func Decode(data []byte) (*Image, error)

Decode decodes a PNG image.

func FromImage

func FromImage(src image.Image) *Image

FromImage copies an image's pixels.

func (*Image) Scale

func (img *Image) Scale(w, h int) *Image

Scale returns the image at w by h pixels, each pixel the average of the part of the image it covers, which keeps fine lines of a large image as a box filter does when it shrinks, and draws it in blocks when it grows.

func (*Image) Tint

func (img *Image) Tint(rgb uint32) *Image

Tint returns the image in one color, 0xRRGGBB, keeping its alpha: a template image in the color of the menu's text.

Jump to

Keyboard shortcuts

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