image3d

package
v0.0.0-...-00121b1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image3D

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

Image stores the dimensions, data format and it's pixel data. It can be used to manipulate single pixels and is used to upload it's data to a texture.

func Make

func Make(width, height, slices, channels int) (Image3D, error)

Make constructs an image of the specified length x width x height and with all pixels set to the specified rgba value.

func MakeFromData

func MakeFromData(width, height, slices int, data []uint8) (Image3D, error)

MakeFromData constructs an image of the specified width, height, slices and the specified data.

func MakeFromPath

func MakeFromPath(paths []string) (Image3D, error)

MakeImageFromPath constructs the image data from the specified paths. If there is no image at the specified path an error is returned instead. The dimensions of all images must match.

func (*Image3D) FlipX

func (image *Image3D) FlipX()

FlipX flips all slices horizontally.

func (*Image3D) FlipY

func (image *Image3D) FlipY()

FlipY flips all slices vertically.

func (*Image3D) GetA

func (image *Image3D) GetA(x, y, z int) uint8

GetA returns the alpha value of the pixel at (x,y) in slice z.

func (*Image3D) GetB

func (image *Image3D) GetB(x, y, z int) uint8

GetB returns the blue value of the pixel at (x,y) in slice z.

func (*Image3D) GetChannels

func (image *Image3D) GetChannels() int

GetChannels return the number of the channels of the image.

func (*Image3D) GetData

func (image *Image3D) GetData() []uint8

GetData returns a copy of the images data

func (*Image3D) GetDataPointer

func (image *Image3D) GetDataPointer() unsafe.Pointer

GetDataPointer returns an pointer to the beginning of the image data.

func (*Image3D) GetG

func (image *Image3D) GetG(x, y, z int) uint8

GetG returns the green value of the pixel at (x,y) in slice z.

func (*Image3D) GetHeight

func (image *Image3D) GetHeight() int

GetHeight returns the height of the image.

func (*Image3D) GetPixelType

func (image *Image3D) GetPixelType() uint32

GetPixelType gets the data type of the pixel data.

func (*Image3D) GetR

func (image *Image3D) GetR(x, y, z int) uint8

GetR returns the red value of the pixel at (x,y) in slice z.

func (*Image3D) GetRGB

func (image *Image3D) GetRGB(x, y, z int) (uint8, uint8, uint8)

GetRGB returns the RGB values of the pixel at (x,y) in slice z.

func (*Image3D) GetRGBA

func (image *Image3D) GetRGBA(x, y, z int) (uint8, uint8, uint8, uint8)

GetRGBA returns the RGBA value of the pixel at (x,y) in slice z.

func (*Image3D) GetSlices

func (image *Image3D) GetSlices() int

GetSlices returns the number of slices of the image.

func (*Image3D) GetWidth

func (image *Image3D) GetWidth() int

GetWidth returns the width of the image.

func (*Image3D) SaveToPath

func (image *Image3D) SaveToPath(path string) error

SaveToPath saves all slices as png images to the specified path. All images will be enumerated starting with 0. The file names will look like the following: dir/filename<NUMBER>.png

func (*Image3D) SetA

func (image *Image3D) SetA(x, y, z int, a uint8)

SetA sets the alpha value of the pixel at (x,y) in slice z.

func (*Image3D) SetB

func (image *Image3D) SetB(x, y, z int, b uint8)

SetB sets the blue value of the pixel at (x,y) in slice z.

func (*Image3D) SetG

func (image *Image3D) SetG(x, y, z int, g uint8)

SetG sets the green value of the pixel at (x,y) in slice z.

func (*Image3D) SetR

func (image *Image3D) SetR(x, y, z int, r uint8)

SetR sets the red value of the pixel at (x,y) in slice z.

func (*Image3D) SetRGB

func (image *Image3D) SetRGB(x, y, z int, r, g, b uint8)

SetRGB sets the RGB values of the pixel at (x,y) in slice z.

func (*Image3D) SetRGBA

func (image *Image3D) SetRGBA(x, y, z int, r, g, b, a uint8)

SetRGBA sets the RGBA values of the pixel at (x,y) in slice z.

func (Image3D) String

func (image Image3D) String() string

String pretty prints information about the image.

Jump to

Keyboard shortcuts

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