Documentation
¶
Overview ¶
Package graphics provides image processing and graphics capabilities for Nxlang
Index ¶
- func CanvasGetHeight(args ...types.Object) types.Object
- func CanvasGetWidth(args ...types.Object) types.Object
- func ClearFunc(args ...types.Object) types.Object
- func CreateCanvasFunc(args ...types.Object) types.Object
- func DrawCircleFunc(args ...types.Object) types.Object
- func DrawLineFunc(args ...types.Object) types.Object
- func DrawPointFunc(args ...types.Object) types.Object
- func DrawRectangleFunc(args ...types.Object) types.Object
- func FillCircleFunc(args ...types.Object) types.Object
- func FillRectangleFunc(args ...types.Object) types.Object
- func GetPixelFunc(args ...types.Object) types.Object
- func LoadPNGFunc(args ...types.Object) types.Object
- func SavePNGFunc(args ...types.Object) types.Object
- type Canvas
- func (c *Canvas) Clear(r, g, b, a uint8)
- func (c *Canvas) DrawCircle(cx, cy, radius int, r, g, b, a uint8)
- func (c *Canvas) DrawLine(x0, y0, x1, y1 int, r, g, b, a uint8)
- func (c *Canvas) DrawPoint(x, y int, r, g, b, a uint8)
- func (c *Canvas) DrawRectangle(x, y, w, h int, r, g, b, a uint8)
- func (c *Canvas) Equals(other types.Object) bool
- func (c *Canvas) FillCircle(cx, cy, radius int, r, g, b, a uint8)
- func (c *Canvas) FillRectangle(x, y, w, h int, r, g, b, a uint8)
- func (c *Canvas) FromBytes(data []byte, width, height int) types.Object
- func (c *Canvas) GetPixel(x, y int) (uint8, uint8, uint8, uint8)
- func (c *Canvas) Height() int
- func (c *Canvas) LoadFromPNG(filename string) types.Object
- func (c *Canvas) SaveToPNG(filename string) types.Object
- func (c *Canvas) ToBytes() []byte
- func (c *Canvas) ToStr() string
- func (c *Canvas) TypeCode() uint8
- func (c *Canvas) TypeName() string
- func (c *Canvas) Width() int
- type Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanvasGetHeight ¶
CanvasGetHeight returns canvas height
func CanvasGetWidth ¶
CanvasGetWidth returns canvas width
func CreateCanvasFunc ¶
CreateCanvasFunc creates a new canvas
func DrawCircleFunc ¶
DrawCircleFunc draws a circle on canvas
func DrawLineFunc ¶
DrawLineFunc draws a line on canvas
func DrawPointFunc ¶
DrawPointFunc draws a point on canvas
func DrawRectangleFunc ¶
DrawRectangleFunc draws a rectangle on canvas
func FillCircleFunc ¶
FillCircleFunc fills a circle on canvas
func FillRectangleFunc ¶
FillRectangleFunc fills a rectangle on canvas
func GetPixelFunc ¶
GetPixelFunc gets pixel color from canvas
func LoadPNGFunc ¶
LoadPNGFunc loads a PNG image into a canvas
Types ¶
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas represents a drawing canvas for graphics operations
func (*Canvas) DrawCircle ¶
DrawCircle draws a circle outline using midpoint circle algorithm
func (*Canvas) DrawRectangle ¶
DrawRectangle draws a rectangle outline
func (*Canvas) FillCircle ¶
FillCircle draws a filled circle
func (*Canvas) FillRectangle ¶
FillRectangle draws a filled rectangle
func (*Canvas) LoadFromPNG ¶
LoadFromPNG loads an image from a PNG file
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represents a loaded image