natsdraw

package module
v0.0.0-...-423d5d2 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

README

natsdraw

Build Status Go Report Card GoDoc License MIT

Installation

go get -u github.com/peterhellberg/natsdraw

License (MIT)

Copyright (c) 2017-2020 Peter Hellberg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyName = errors.New("empty name")

ErrEmptyName is returned if name is empty

View Source
var LoadTimeout = 500 * time.Millisecond

LoadTimeout is the timeout for loading the image

Functions

This section is empty.

Types

type Image

type Image struct {
	*image.RGBA
	// contains filtered or unexported fields
}

Image implements draw.Image over NATS

func New

func New(name string, r image.Rectangle, options ...Option) (*Image, error)

New creates a new *Image

func (*Image) Close

func (m *Image) Close()

Close the connection to NATS

func (*Image) Set

func (m *Image) Set(x, y int, c color.Color)

Set the pixel at x,y to color c

type Option

type Option func(*Image) error

Option is the functional option type for *Image

func Connect

func Connect(url string) Option

Connect to the given NATS URL

type Pixel

type Pixel struct {
	X int
	Y int
	C color.RGBA
}

Pixel contains the position and color

func NewPixel

func NewPixel(x, y int, c color.Color) *Pixel

NewPixel creates a new *Pixel

Jump to

Keyboard shortcuts

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