fake

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package fake implements a fake camera which always returns the same image with a user specified resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCamera added in v0.2.36

func NewCamera(
	ctx context.Context,
	_ resource.Dependencies,
	conf resource.Config,
	logger logging.Logger,
) (camera.Camera, error)

NewCamera returns a new fake camera.

Types

type Camera

type Camera struct {
	resource.Named
	resource.AlwaysRebuild
	Model    *transform.PinholeCameraModel
	Width    int
	Height   int
	Animated bool
	// contains filtered or unexported fields
}

Camera is a fake camera that always returns the same image.

func (*Camera) Close added in v0.2.36

func (c *Camera) Close(ctx context.Context) error

Close does nothing.

func (*Camera) NextPointCloud

func (c *Camera) NextPointCloud(ctx context.Context) (pointcloud.PointCloud, error)

NextPointCloud always returns a pointcloud of a yellow to blue gradient, with the depth determined by the intensity of blue.

func (*Camera) Read

func (c *Camera) Read(ctx context.Context) (image.Image, func(), error)

Read always returns the same image of a yellow to blue gradient.

type Config added in v0.2.36

type Config struct {
	Width    int  `json:"width,omitempty"`
	Height   int  `json:"height,omitempty"`
	Animated bool `json:"animated,omitempty"`
}

Config are the attributes of the fake camera config.

func (*Config) Validate added in v0.2.36

func (conf *Config) Validate(path string) ([]string, error)

Validate checks that the config attributes are valid for a fake camera.

Jump to

Keyboard shortcuts

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