mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Create tool for converting images to compatible console logo files
The tool processes an image and converts it to a logo.Image struct which can be assigned to a logo-capable console.
This commit is contained in:
44
src/gopheros/device/video/console/logo/logo.go
Normal file
44
src/gopheros/device/video/console/logo/logo.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// Package logo contains logos that can be used with a framebuffer console.
|
||||
package logo
|
||||
|
||||
import "image/color"
|
||||
|
||||
// ConsoleLogo defines the logo used by framebuffer consoles. If set to nil
|
||||
// then no logo will be displayed.
|
||||
var ConsoleLogo *Image
|
||||
|
||||
// Alignment defines the supported horizontal alignments for a console logo.
|
||||
type Alignment uint8
|
||||
|
||||
const (
|
||||
// AlignLeft aligns the logo to the left side of the console.
|
||||
AlignLeft Alignment = iota
|
||||
|
||||
// AlignCenter aligns the logo to the center of the console.
|
||||
AlignCenter
|
||||
|
||||
// AlignRight aligns the logo to the right side of the console.
|
||||
AlignRight
|
||||
)
|
||||
|
||||
// Image describes an 8bpp image with
|
||||
type Image struct {
|
||||
// The width and height of the logo in pixels.
|
||||
Width uint32
|
||||
Height uint32
|
||||
|
||||
// Align specifies the horizontal alignment for the logo.
|
||||
Align Alignment
|
||||
|
||||
// TransparentIndex defines a color index that will be treated as
|
||||
// transparent when drawing the logo.
|
||||
TransparentIndex uint8
|
||||
|
||||
// The palette for the logo. The console remaps the palette
|
||||
// entries to the end of its own palette.
|
||||
Palette []color.RGBA
|
||||
|
||||
// The logo data comprises of Width*Height bytes where each byte
|
||||
// represents an index in the logo palette.
|
||||
Data []uint8
|
||||
}
|
||||
Reference in New Issue
Block a user