multicam

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

README

go-multicam

Go language wrapper for the Euresys MultiCam SDK.

https://documentation.euresys.com/Products/MULTICAM/MULTICAM/Content/00_Home/home.htm

This package currently only works on Linux platforms.

How To Use

package main

import (
	"fmt"

	mc "github.com/northvolt/go-multicam"
)

func main() {
	if err := mc.OpenDriver(); err != nil {
		fmt.Println(err)
		return
	}
	defer mc.CloseDriver()

	fmt.Println("Driver was opened...")

	bc, err := mc.GetParamInt(mc.ConfigurationHandle, mc.BoardCountParam)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println("Number of boards detected:", bc)

	for i := 0; i < bc; i++ {
		brd := mc.BoardForIndex(i)
		bn, err := brd.GetParamStr(mc.BoardNameParam)
		if err != nil {
			fmt.Println(err)
			return
		}

		fmt.Println("Board", i, "name:", bn)
	}

	fmt.Println("Done.")
}

Installing

To use it you must obtain a copy of the Euresys MultiCam SDK for Linux from Euresys directly. See:

https://euresys.com/en/Support/Download-area

The Euresys drivers for the board that you want to use must be installed on the Linux host operating system.

Using with Docker

Download the latest Euresys SDK file, e.g. multicam-linux-x86_64-6.18.3.4935.tar.gz and put it into a directory named multicam-linux in this project. Note that this file will not be saved into the Github repo, you must download it yourself.

Once you have obtained the file, you can build the Docker image by running:

docker build -t multicam:latest .

If you are using a different version of the Multicam SDK, you can use the MULTICAM_RELEASE build argument like this::

docker build --build-arg MULTICAM_RELEASE=6.18.2.4781 -t multicam:latest .

Once you have built it, you can run it like this:

docker run --privileged multicam:latest

You should see output like this:

Driver was opened...
Boards detected: 2
FULL_XR_3489
FULL_XR_929
Done.

You can copy the compiled binary executables out of the container, and run them directly on host computers that are running Linux and have the correct Euresys drivers installed.

mkdir -p ./build
docker run -it -v $(pwd)/build:/hostbuild -t multicam:latest /bin/bash -c "cp /build/* /hostbuild/"

Updating generated files

You can update the files out of the container so that you can update based on changes to params or status codes.

docker run -it -v $(pwd):/hostsrc -t multicam:latest /bin/bash -c "cp /src/github.com/northvolt/go-multicam/*_string.go /hostsrc/"

Why it exists

Computer vision applications written in Go can easily take advantage of multi-core concurrency while also having access to packages such as GoCV (https://gocv.io). The go-multicam package now makes is possible for Go programs to connect to Euresys cameras and line scanners that are commonly used for industrial applications.

Documentation

Index

Constants

View Source
const (
	SignalEnableOn  int = C.MC_SignalEnable_ON
	SignalEnableOff int = C.MC_SignalEnable_OFF
)
View Source
const (
	SurfaceStateFree       int = C.MC_SurfaceState_FREE
	SurfaceStateFilling        = C.MC_SurfaceState_FILLING
	SurfaceStateFilled         = C.MC_SurfaceState_FILLED
	SurfaceStateProcessing     = C.MC_SurfaceState_PROCESSING
	SurfaceStateReserved       = C.MC_SurfaceState_RESERVED
)
View Source
const (
	ColorFormatY8      = C.MC_ColorFormat_Y8
	ColorFormatY10     = C.MC_ColorFormat_Y10
	ColorFormatY10P    = C.MC_ColorFormat_Y10P
	ColorFormatY12     = C.MC_ColorFormat_Y12
	ColorFormatY14     = C.MC_ColorFormat_Y14
	ColorFormatY16     = C.MC_ColorFormat_Y16
	ColorFormatBayer8  = C.MC_ColorFormat_BAYER8
	ColorFormatBayer10 = C.MC_ColorFormat_BAYER10
	ColorFormatBayer12 = C.MC_ColorFormat_BAYER12
	ColorFormatBayer14 = C.MC_ColorFormat_BAYER14
	ColorFormatBayer16 = C.MC_ColorFormat_BAYER16
)
View Source
const (
	AcquisitionModeSnapshot = C.MC_AcquisitionMode_SNAPSHOT
	AcquisitionModeHFR      = C.MC_AcquisitionMode_HFR
	AcquisitionModePage     = C.MC_AcquisitionMode_PAGE
	AcquisitionModeWeb      = C.MC_AcquisitionMode_WEB
	AcquisitionModeLongPage = C.MC_AcquisitionMode_LONGPAGE
	AcquisitionModeInvalid  = C.MC_AcquisitionMode_INVALID
	AcquisitionModeVideo    = C.MC_AcquisitionMode_VIDEO
)
View Source
const (
	MetadataContentNone       MetadataContentType = C.MC_MetadataContent_NONE
	MetadataContentOneField   MetadataContentType = C.MC_MetadataContent_ONE_FIELD
	MetadataContentTwoField   MetadataContentType = C.MC_MetadataContent_TWO_FIELD
	MetadataContentThreeField MetadataContentType = C.MC_MetadataContent_THREE_FIELD

	MetadataGPPCInputLineNone          = C.MC_MetadataGPPCInputLine_NONE
	MetadataGPPCInputLineIIN1          = C.MC_MetadataGPPCInputLine_IIN1
	MetadataGPPCLocationNone           = C.MC_MetadataGPPCLocation_NONE
	MetadataGPPCLocationInsteadLVALCNT = C.MC_MetadataGPPCLocation_INSTEAD_LVALCNT
	MetadataGPPCLocationInsteadQCNT    = C.MC_MetadataGPPCLocation_INSTEAD_QCNT
	MetadataGPPCResetLineNone          = C.MC_MetadataGPPCResetLine_NONE
	MetadataGPPCResetLineIIN4          = C.MC_MetadataGPPCResetLine_IIN4

	MetadataInsertionEnable  = C.MC_MetadataInsertion_ENABLE
	MetadataInsertionDisable = C.MC_MetadataInsertion_DISABLE

	MetadataLocationLeft        = C.MC_MetadataLocation_LEFT
	MetadataLocationSparse1     = C.MC_MetadataLocation_SPARSE_1
	MetadataLocationLeftBoarder = C.MC_MetadataLocation_LEFT_BOARDER
	MetadataLocationTap10       = C.MC_MetadataLocation_TAP10
	MetadataLocationLVALRISE    = C.MC_MetadataLocation_LVALRISE
)
View Source
const (
	LineRateModeCamera  = C.MC_LineRateMode_CAMERA
	LineRateModePeriod  = C.MC_LineRateMode_PERIOD
	LineRateModePulse   = C.MC_LineRateMode_PULSE
	LineRateModeConvert = C.MC_LineRateMode_CONVERT
)
View Source
const (
	ImageFlipXOff = C.MC_ImageFlipX_OFF
	ImageFlipXOn  = C.MC_ImageFlipX_ON
)
View Source
const GoMulticamVersion = "0.6.0"

GoMulticamVersion of this package, for display purposes. Change this variable on a new package release.

View Source
const IndeterminateLength = C.MC_INDETERMINATE
View Source
const (
	// LED is id of built-in LED
	LED = 25
)
View Source
const UninitializedBoard = 0
View Source
const UninitializedChannel = 0
View Source
const UninitializedSurface = 0

Variables

View Source
var (
	ErrCannotOpenDriver       = errors.New("cannot open driver")
	ErrCannotSetParam         = errors.New("cannot set param")
	ErrCannotGetParam         = errors.New("cannot get param")
	ErrInvalidChannel         = errors.New("invalid channel")
	ErrCannotCreateChannel    = errors.New("cannot create MultiCam channel")
	ErrCannotDeleteChannel    = errors.New("cannot delete MultiCam channel")
	ErrCannotRegisterCallback = errors.New("cannot register callback for MultiCam channel")
	ErrInvalidSurface         = errors.New("invalid surface")
	ErrCannotCreateSurface    = errors.New("cannot create MultiCam surface")
	ErrCannotDeleteSurface    = errors.New("cannot delete MultiCam surface")
	ErrInvalidBoard           = errors.New("invalid board")
	ErrCannotWaitSignal       = errors.New("cannot wait for signal")
	ErrTimeoutOpenDriver      = errors.New("could not init driver, try restarting PC")
)

Functions

func CloseDriver

func CloseDriver() error

CloseDriver closes the Multicam drivers. Call before exiting.

func GetParamInt

func GetParamInt(handle Handle, id ParamID) (int, error)

GetParamInt gets a parameter int value.

func GetParamPtr

func GetParamPtr(handle Handle, id ParamID) (unsafe.Pointer, error)

GetParamPtr gets a parameter Ptr value.

func GetParamStr

func GetParamStr(handle Handle, id ParamID) (string, error)

GetParamStr gets a parameter string value.

func GoCallbackHandler

func GoCallbackHandler(info *CallbackInfo)

func OpenDriver

func OpenDriver() error

OpenDriver starts up the Multicam drivers.

func SDKVersion

func SDKVersion() string

SDKVersion returns the current SDK version using an ENV variable, since not supported by Euresys directly. It can be set automatically within a Docker container built using ARG/ENV variables, as is done by the Dockerfile located in this package. If not set by the host or by container, it will return empty string.

func SetParamInst

func SetParamInst(handle Handle, id ParamID, val Handle) error

SetParamInst sets a parameter Inst (Handle) value.

func SetParamInt

func SetParamInt(handle Handle, id ParamID, val int) error

SetParamInt sets a parameter int value.

func SetParamPtr

func SetParamPtr(handle Handle, id ParamID, val unsafe.Pointer) error

SetParamPtr sets a parameter Ptr value.

func SetParamStr

func SetParamStr(handle Handle, id ParamID, val string) error

SetParamStr sets a parameter string value.

func Version

func Version() string

Version returns the current Golang package version.

Types

type Board

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

func BoardForHandle

func BoardForHandle(h Handle) *Board

BoardForHandle returns a Multicam Board for an existing Handle.

func BoardForIndex

func BoardForIndex(index int) *Board

BoardForIndex returns a Multicam Board for a specific DriverIndex.

func NewBoard

func NewBoard() *Board

NewBoard creates a new Multicam Board.

func (*Board) CreateChannel

func (b *Board) CreateChannel() (*Channel, error)

CreateChannel creates a new Channel for this Board.

func (*Board) Delete

func (b *Board) Delete() error

Delete deletes an existing MultiCam Board object. Just here for consistency, no need to actually "delete" a board.

func (*Board) GetParamInt

func (b *Board) GetParamInt(id ParamID) (int, error)

GetParamInt gets a parameter int value for this Board.

func (*Board) GetParamPtr

func (b *Board) GetParamPtr(id ParamID) (unsafe.Pointer, error)

GetParamPtr gets a parameter pointer value for this Board.

func (*Board) GetParamStr

func (b *Board) GetParamStr(id ParamID) (string, error)

GetParamStr gets a parameter string value for this Board.

func (*Board) SetParamInt

func (b *Board) SetParamInt(id ParamID, val int) error

SetParamInt sets a parameter int value for this Board.

func (*Board) SetParamPtr

func (b *Board) SetParamPtr(id ParamID, val unsafe.Pointer) error

SetParamPtr sets a parameter pointer value for this Board.

func (*Board) SetParamStr

func (b *Board) SetParamStr(id ParamID, val string) error

SetParamStr sets a parameter string value for this Board.

type CallbackInfo added in v0.2.0

type CallbackInfo C.MCCALLBACKINFO

type Channel

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

func NewChannel

func NewChannel() *Channel

NewChannel creates a new Multicam Channel.

func (*Channel) Create

func (c *Channel) Create() error

Create creates a new MultiCam Channel object.

func (*Channel) Delete

func (c *Channel) Delete() error

Delete deletes an existing MultiCam Channel object.

func (*Channel) GetParamInst

func (c *Channel) GetParamInst(id ParamID) (Handle, error)

GetParamInst gets a parameter instance value for this channel.

func (*Channel) GetParamInt

func (c *Channel) GetParamInt(id ParamID) (int, error)

GetParamInt gets a parameter int value for this channel.

func (*Channel) GetParamStr

func (c *Channel) GetParamStr(id ParamID) (string, error)

GetParamStr gets a parameter string value for this channel.

func (*Channel) RegisterCallback

func (c *Channel) RegisterCallback(handler func(*CallbackInfo)) error

RegisterCallback allows setting a callback handler function for this channel. TODO(re): allow setting context data

func (*Channel) SetParamInst

func (c *Channel) SetParamInst(id ParamID, val Handle) error

SetParamInst sets a parameter instance value for this channel.

func (*Channel) SetParamInt

func (c *Channel) SetParamInt(id ParamID, val int) error

SetParamInt sets a parameter int value for this channel.

func (*Channel) SetParamStr

func (c *Channel) SetParamStr(id ParamID, val string) error

SetParamStr sets a parameter string value for this channel.

func (*Channel) WaitSignal added in v0.2.0

func (c *Channel) WaitSignal(signal ParamID, timeout int) (*SignalInfo, error)

WaitSignal waits until a specific signal for this channel has occurred, or the timeout in ms is reached. On success, a pointer to the SignalInfo for this signal will be returned.

type ChannelStateID

type ChannelStateID uint32
const (
	ChannelStateActive ChannelStateID = C.MC_ChannelState_ACTIVE
	ChannelStateIdle   ChannelStateID = C.MC_ChannelState_IDLE
)

type Handle

type Handle uint32
const (
	ConfigurationHandle  Handle = C.MC_CONFIGURATION
	DefaultSurfaceHandle Handle = C.MC_DEFAULT_SURFACE_HANDLE
	DefaultBoardHandle   Handle = C.MC_BOARD
)

func GetParamInst

func GetParamInst(handle Handle, id ParamID) (Handle, error)

GetParamInst gets a parameter Inst (Handle) value.

type Metadata

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

func ParseMetadata

func ParseMetadata(content MetadataContentType, data []byte) (*Metadata, error)

ParseMetadata returns the metadata for a given image frame, for the expected metadata type.

func ParseMetadataFlipped added in v0.6.0

func ParseMetadataFlipped(content MetadataContentType, data []byte) (*Metadata, error)

ParseMetadataFlipped returns the metadata for a given image frame that has been flipped on the X axis, for the expected metadata type.

func (*Metadata) Count

func (m *Metadata) Count() uint32

func (*Metadata) DIN1

func (m *Metadata) DIN1() bool

func (*Metadata) DIN2

func (m *Metadata) DIN2() bool

func (*Metadata) IIN1

func (m *Metadata) IIN1() bool

func (*Metadata) IIN2

func (m *Metadata) IIN2() bool

func (*Metadata) IIN3

func (m *Metadata) IIN3() bool

func (*Metadata) IIN4

func (m *Metadata) IIN4() bool

func (*Metadata) Qcount

func (m *Metadata) Qcount() uint32

func (*Metadata) String

func (m *Metadata) String() string

type MetadataContentType added in v0.6.0

type MetadataContentType int

func (MetadataContentType) String added in v0.6.0

func (i MetadataContentType) String() string

type ParamID

type ParamID uint32
const (
	AcquisitionModeParam       ParamID = C.MC_AcquisitionMode
	BoardCountParam            ParamID = C.MC_BoardCount
	BoardNameParam             ParamID = C.MC_BoardName
	BoardNameChangeParam       ParamID = C.MC_NameBoard
	BoardIdentifierParam       ParamID = C.MC_BoardIdentifier
	BoardIndexParam            ParamID = C.MC_BoardIndex
	BoardPCIPositionParam      ParamID = C.MC_PciPosition
	BoardSerialNumberParam     ParamID = C.MC_SerialNumber
	BoardTypeParam             ParamID = C.MC_BoardType
	BufferPitchParam           ParamID = C.MC_BufferPitch
	BufferSizeParam            ParamID = C.MC_BufferSize
	CamFileParam               ParamID = C.MC_CamFile
	ChannelStateParam          ParamID = C.MC_ChannelState
	ClusterParam               ParamID = C.MC_Cluster
	ColorFormatParam           ParamID = C.MC_ColorFormat
	ConnectorParam             ParamID = C.MC_Connector
	DriverIndexParam           ParamID = C.MC_DriverIndex
	ElapsedPgParam             ParamID = C.MC_Elapsed_Pg
	EncoderPitchParam          ParamID = C.MC_EncoderPitch
	ErrorHandlingParam         ParamID = C.MC_ErrorHandling
	ErrorLogParam              ParamID = C.MC_ErrorLog
	EqualizationLevelParam     ParamID = C.MC_EqualizationLevel
	ForceTrigParam             ParamID = C.MC_ForceTrig
	ImageFlipXParam            ParamID = C.MC_ImageFlipX
	ImageSizeXParam            ParamID = C.MC_ImageSizeX
	ImageSizeYParam            ParamID = C.MC_ImageSizeY
	InputConfigParam           ParamID = C.MC_InputConfig
	InputStateParam            ParamID = C.MC_InputState
	LinePitchParam             ParamID = C.MC_LinePitch
	LineRateModeParam          ParamID = C.MC_LineRateMode
	MetadataContentParam       ParamID = C.MC_MetadataContent
	MetadataGPPCInputLineParam ParamID = C.MC_MetadataGPPCInputLine
	MetadataGPPCLocationParam  ParamID = C.MC_MetadataGPPCLocation
	MetadataGPPCResetLineParam ParamID = C.MC_MetadataGPPCResetLine
	MetadataInsertionParam     ParamID = C.MC_MetadataInsertion
	MetadataLocationParam      ParamID = C.MC_MetadataLocation
	MinBufferPitchParam        ParamID = C.MC_MinBufferPitch
	OutputConfigParam          ParamID = C.MC_OutputConfig
	OutputStateParam           ParamID = C.MC_OutputState
	PeriodUsParam              ParamID = C.MC_Period_us
	SerialNumberParam          ParamID = C.MC_SerialNumber
	SeqLengthFrParam           ParamID = C.MC_SeqLength_Fr
	SeqLengthPgParam           ParamID = C.MC_SeqLength_Pg
	SeqLengthLnParam           ParamID = C.MC_SeqLength_Ln
	SignalEnableParam          ParamID = C.MC_SignalEnable
	SurfaceAddrParam           ParamID = C.MC_SurfaceAddr
	SurfaceCountParam          ParamID = C.MC_SurfaceCount
	SurfaceIndexParam          ParamID = C.MC_SurfaceIndex
	SurfacePitchParam          ParamID = C.MC_SurfacePitch
	SurfaceSizeParam           ParamID = C.MC_SurfaceSize
	SurfaceStateParam          ParamID = C.MC_SurfaceState
)
const (
	AnySignal                   ParamID = C.MC_SIG_ANY
	StartAcquisitionSignal      ParamID = C.MC_SIG_START_ACQUISITION_SEQUENCE
	EndAcquisitionSignal        ParamID = C.MC_SIG_END_ACQUISITION_SEQUENCE
	AcquisitionFailureSignal    ParamID = C.MC_SIG_ACQUISITION_FAILURE
	ClusterUnavailableSignal    ParamID = C.MC_SIG_CLUSTER_UNAVAILABLE
	EndChannelActivitySignal    ParamID = C.MC_SIG_END_CHANNEL_ACTIVITY
	FrameTriggerViolationSignal ParamID = C.MC_SIG_FRAMETRIGGER_VIOLATION
	SurfaceProcessingSignal     ParamID = C.MC_SIG_SURFACE_PROCESSING
	SurfaceFilledSignal         ParamID = C.MC_SIG_SURFACE_FILLED
	StartExposureSignal         ParamID = C.MC_SIG_START_EXPOSURE
	EndExposureSignal           ParamID = C.MC_SIG_END_EXPOSURE
	UnrecoverableOverrunSignal  ParamID = C.MC_SIG_UNRECOVERABLE_OVERRUN
	ReleaseSignal               ParamID = C.MC_SIG_RELEASE
)

func (ParamID) String added in v0.4.0

func (i ParamID) String() string

type SignalInfo

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

SignalInfo is a wrapper around the info returned to a Channel WaitSignal() function.

func (*SignalInfo) Context added in v0.2.0

func (s *SignalInfo) Context()

PVOID Context;

func (*SignalInfo) Instance added in v0.2.0

func (s *SignalInfo) Instance() Handle

MCHANDLE Instance;

func (*SignalInfo) Signal added in v0.2.0

func (s *SignalInfo) Signal() ParamID

MCSIGNAL Signal;

func (*SignalInfo) SignalContext added in v0.2.0

func (s *SignalInfo) SignalContext() uint32

UINT32 SignalContext;

func (*SignalInfo) SignalInfo added in v0.2.0

func (s *SignalInfo) SignalInfo() Handle

UINT32 SignalInfo;

type StatusCode added in v0.4.0

type StatusCode int32
const (
	StatusOK                      StatusCode = C.MC_OK
	StatusNoBoardFound            StatusCode = C.MC_NO_BOARD_FOUND
	StatusBadParameter            StatusCode = C.MC_BAD_PARAMETER
	StatusIOError                 StatusCode = C.MC_IO_ERROR
	StatusInternalError           StatusCode = C.MC_INTERNAL_ERROR
	StatusNoMoreResources         StatusCode = C.MC_NO_MORE_RESOURCES
	StatusInUse                   StatusCode = C.MC_IN_USE
	StatusNotSupported            StatusCode = C.MC_NOT_SUPPORTED
	StatusDatabaseError           StatusCode = C.MC_DATABASE_ERROR
	StatusOutOfBound              StatusCode = C.MC_OUT_OF_BOUND
	StatusInstanceNotFound        StatusCode = C.MC_INSTANCE_NOT_FOUND
	StatusInvalidHandle           StatusCode = C.MC_INVALID_HANDLE
	StatusTimeout                 StatusCode = C.MC_TIMEOUT
	StatusInvalidValue            StatusCode = C.MC_INVALID_VALUE
	StatusRangeError              StatusCode = C.MC_RANGE_ERROR
	StatusBadHWConfig             StatusCode = C.MC_BAD_HW_CONFIG
	StatusNoEvent                 StatusCode = C.MC_NO_EVENT
	StatusLicenseNotGranted       StatusCode = C.MC_LICENSE_NOT_GRANTED
	StatusFatalError              StatusCode = C.MC_FATAL_ERROR
	StatusHWEventConflict         StatusCode = C.MC_HW_EVENT_CONFLICT
	StatusFileNotFound            StatusCode = C.MC_FILE_NOT_FOUND
	StatusOverflow                StatusCode = C.MC_OVERFLOW
	StatusInvalidParameterSetting StatusCode = C.MC_INVALID_PARAMETER_SETTING
	StatusParameterIllegalAccess  StatusCode = C.MC_PARAMETER_ILLEGAL_ACCESS
	StatusClusterBusy             StatusCode = C.MC_CLUSTER_BUSY
	StatusServiceError            StatusCode = C.MC_SERVICE_ERROR
	StatusInvalidSurface          StatusCode = C.MC_INVALID_SURFACE
)

func (StatusCode) String added in v0.4.0

func (i StatusCode) String() string

type Surface

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

func NewSurface

func NewSurface() *Surface

NewSurface creates a new Multicam Surface.

func SurfaceForHandle

func SurfaceForHandle(h Handle) *Surface

SurfaceForHandle returns a Multicam Surface for an existing Handle.

func (*Surface) Create

func (s *Surface) Create() error

Create creates a new MultiCam Surface object.

func (*Surface) Delete

func (s *Surface) Delete() error

Delete deletes an existing MultiCam surface object.

func (*Surface) GetParamInt

func (s *Surface) GetParamInt(id ParamID) (int, error)

GetParamInt gets a parameter int value for this surface.

func (*Surface) GetParamPtr

func (s *Surface) GetParamPtr(id ParamID) (unsafe.Pointer, error)

GetParamPtr gets a parameter pointer value for this surface.

func (*Surface) GetParamStr

func (s *Surface) GetParamStr(id ParamID) (string, error)

GetParamStr gets a parameter string value for this surface.

func (*Surface) Handle added in v0.2.0

func (s *Surface) Handle() Handle

Handle returns the Handle for this MultiCam surface object.

func (*Surface) Ptr

func (s *Surface) Ptr(x, y int) ([]byte, error)

Ptr returns a slice of bytes of the data in the underlying Surface. Pass in the expected x and y dimensions of the surface. Note that the memory for this slice is under the control of Multicam and so may go away quickly, so copy the data elsewhere if you want to persist it.

func (*Surface) SetParamInt

func (s *Surface) SetParamInt(id ParamID, val int) error

SetParamInt sets a parameter int value for this surface.

func (*Surface) SetParamPtr

func (s *Surface) SetParamPtr(id ParamID, val unsafe.Pointer) error

SetParamPtr sets a parameter pointer value for this surface.

func (*Surface) SetParamStr

func (s *Surface) SetParamStr(id ParamID, val string) error

SetParamStr sets a parameter string value for this surface.

func (*Surface) ToBytes

func (s *Surface) ToBytes(x, y int) ([]byte, error)

ToBytes returns a slice of bytes which is a copy of the Surface data. This slice is safe to use as it is a normal Go slice.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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