bitmap

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package bitmap creates bitmap images.

Package bitmap creates bitmap images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeBmp

func EncodeBmp(pixelData []float64, w, h int, filepath string)

EncodeBmp encodes a bitmap.

Types

type Bitmap

type Bitmap struct {
	Width, Height int
	Pixels        []float64
}

Bitmap represents a bitmap image.

func NewBitmap

func NewBitmap(w, h int) *Bitmap

NewBitmap creates a new Bitmap.

func (*Bitmap) Clear

func (c *Bitmap) Clear(r, g, b float64)

Clear clears the bitmap.

func (*Bitmap) GetPixel

func (c *Bitmap) GetPixel(x, y int) (float64, float64, float64)

GetPixel returns the rgb values of the pixel at the given coords.

func (*Bitmap) SaveImage

func (c *Bitmap) SaveImage(filename string)

SaveImage saves the bitmap to a file.

func (*Bitmap) SetPixel

func (c *Bitmap) SetPixel(x, y int, r, g, b float64)

SetPixel sets the rgb values of the pixel at the given coords.

func (*Bitmap) SetPixelGray

func (c *Bitmap) SetPixelGray(x, y int, val float64)

SetPixelGray sets the the pixel at the given coords to the gray value given.

Jump to

Keyboard shortcuts

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