aravis

package module
v0.0.0-...-64cda30 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

README

go-aravis

Go wrapper around libaravis 0.8+

If you need libaravis 0.6 go to the original package at https://github.com/thinkski/go-aravis

Quickstart

How to get the number of connected devices:

import aravis
import log

func main() {
    aravis.UpdateDeviceList()

    n, err := aravis.GetNumDevices()
    if err != nil {
        log.Fatal(err)
    }

    log.Println("Devices:", n)
}

Troubleshooting

GigE Vision cameras often use large packet sizes, well in excess of the typical MTU (maximum transmit unit) of most network interface cards, to save on packet overhead. Be sure to first set the MTU of the network interface(s) with GigE Vision cameras to 9000 bytes. For instance, if the network interface is enp2s0:

ip link set enp2s0 mtu 9000

Documentation

Index

Constants

View Source
const (
	BUFFER_STATUS_UNKNOWN         = C.ARV_BUFFER_STATUS_UNKNOWN
	BUFFER_STATUS_SUCCESS         = C.ARV_BUFFER_STATUS_SUCCESS
	BUFFER_STATUS_CLEARED         = C.ARV_BUFFER_STATUS_CLEARED
	BUFFER_STATUS_TIMEOUT         = C.ARV_BUFFER_STATUS_TIMEOUT
	BUFFER_STATUS_MISSING_PACKETS = C.ARV_BUFFER_STATUS_MISSING_PACKETS
	BUFFER_STATUS_WRONG_PACKET_ID = C.ARV_BUFFER_STATUS_WRONG_PACKET_ID
	BUFFER_STATUS_SIZE_MISMATCH   = C.ARV_BUFFER_STATUS_SIZE_MISMATCH
	BUFFER_STATUS_FILLING         = C.ARV_BUFFER_STATUS_FILLING
	BUFFER_STATUS_ABORTED         = C.ARV_BUFFER_STATUS_ABORTED
)
View Source
const (
	ACQUISITION_MODE_CONTINUOUS   = C.ARV_ACQUISITION_MODE_CONTINUOUS
	ACQUISITION_MODE_SINGLE_FRAME = C.ARV_ACQUISITION_MODE_SINGLE_FRAME
)
View Source
const (
	AUTO_OFF        = C.ARV_AUTO_OFF
	AUTO_ONCE       = C.ARV_AUTO_ONCE
	AUTO_CONTINUOUS = C.ARV_AUTO_CONTINUOUS
)
View Source
const (
	DEVICE_ERROR_WRONG_FEATURE     = C.ARV_DEVICE_ERROR_WRONG_FEATURE
	DEVICE_ERROR_FEATURE_NOT_FOUND = C.ARV_DEVICE_ERROR_FEATURE_NOT_FOUND
	DEVICE_ERROR_NOT_CONNECTED     = C.ARV_DEVICE_ERROR_NOT_CONNECTED
	DEVICE_ERROR_PROTOCOL_ERROR    = C.ARV_DEVICE_ERROR_PROTOCOL_ERROR
	DEVICE_ERROR_TRANSFER_ERROR    = C.ARV_DEVICE_ERROR_TRANSFER_ERROR
	DEVICE_ERROR_TIMEOUT           = C.ARV_DEVICE_ERROR_TIMEOUT
	DEVICE_ERROR_NOT_FOUND         = C.ARV_DEVICE_ERROR_NOT_FOUND
	DEVICE_ERROR_INVALID_PARAMETER = C.ARV_DEVICE_ERROR_INVALID_PARAMETER
	DEVICE_ERROR_GENICAM_NOT_FOUND = C.ARV_DEVICE_ERROR_GENICAM_NOT_FOUND
	DEVICE_ERROR_NO_STREAM_CHANNEL = C.ARV_DEVICE_ERROR_NO_STREAM_CHANNEL
	DEVICE_ERROR_NOT_CONTROLLER    = C.ARV_DEVICE_ERROR_NOT_CONTROLLER
	DEVICE_ERROR_UNKNOWN           = C.ARV_DEVICE_ERROR_UNKNOWN
)

Variables

This section is empty.

Functions

func DisableInterface

func DisableInterface(id string)

func EnableInterface

func EnableInterface(id string)

func GetDeviceId

func GetDeviceId(index uint) (string, error)

func GetInterfaceId

func GetInterfaceId(index uint) (string, error)

func GetNumDevices

func GetNumDevices() (uint, error)

func GetNumInferface

func GetNumInferface() (uint, error)

func InterfaceGetDeviceAddress

func InterfaceGetDeviceAddress()

func InterfaceGetDeviceId

func InterfaceGetDeviceId()

func InterfaceGetDevicePhysicalId

func InterfaceGetDevicePhysicalId()

func InterfaceGetNumDevices

func InterfaceGetNumDevices()

func InterfaceOpenDevice

func InterfaceOpenDevice()

func OpenDevice

func OpenDevice()

func Shutdown

func Shutdown()

func UpdateDeviceList

func UpdateDeviceList()

Types

type BayerRG

type BayerRG struct {
	// Pix holds the image's pixels, in bayer order. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

func NewBayerRG

func NewBayerRG(r image.Rectangle) *BayerRG

func (*BayerRG) At

func (p *BayerRG) At(x, y int) color.Color

At returns an RGBA pixel with simple nearest-neighbor debayering

func (*BayerRG) Bounds

func (p *BayerRG) Bounds() image.Rectangle

func (*BayerRG) ColorModel

func (p *BayerRG) ColorModel() color.Model

type Buffer

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

func NewBuffer

func NewBuffer(size uint) (Buffer, error)

func (*Buffer) GetData

func (b *Buffer) GetData() ([]byte, error)

func (*Buffer) GetStatus

func (b *Buffer) GetStatus() (int, error)

func (*Buffer) IsNil

func (b *Buffer) IsNil() bool

type Camera

type Camera struct {
	ThreadPriority ThreadPriorityType
	// contains filtered or unexported fields
}

func NewCamera

func NewCamera(name string) (Camera, error)

func (*Camera) AbortAcquisition

func (c *Camera) AbortAcquisition() error

func (*Camera) ClearTriggers

func (c *Camera) ClearTriggers() error

func (*Camera) Close

func (c *Camera) Close()

func (*Camera) CreateStream

func (c *Camera) CreateStream() (Stream, error)

func (*Camera) GVGetCurrentStreamChannel

func (c *Camera) GVGetCurrentStreamChannel() (int, error)

func (*Camera) GVGetNumStreamChannels

func (c *Camera) GVGetNumStreamChannels() (int, error)

func (*Camera) GVGetPacketDelay

func (c *Camera) GVGetPacketDelay() (int64, error)

func (*Camera) GVGetPacketSize

func (c *Camera) GVGetPacketSize() (int, error)

func (*Camera) GVSelectStreamChannels

func (c *Camera) GVSelectStreamChannels(id int) error

func (*Camera) GVSetPacketDelay

func (c *Camera) GVSetPacketDelay(delay int64) error

func (*Camera) GVSetPacketSize

func (c *Camera) GVSetPacketSize(size int) error

func (*Camera) GetAvailablePixelFormats

func (c *Camera) GetAvailablePixelFormats()

func (*Camera) GetAvailablePixelFormatsAsDisplayNames

func (c *Camera) GetAvailablePixelFormatsAsDisplayNames()

func (*Camera) GetAvailablePixelFormatsAsStrings

func (c *Camera) GetAvailablePixelFormatsAsStrings()

func (*Camera) GetBinning

func (c *Camera) GetBinning() (int, int, error)

func (*Camera) GetChunkMode

func (c *Camera) GetChunkMode() (bool, error)

func (*Camera) GetDevice

func (c *Camera) GetDevice() (Device, error)

func (*Camera) GetDeviceId

func (c *Camera) GetDeviceId() (string, error)

func (*Camera) GetExposureTime

func (c *Camera) GetExposureTime() (float64, error)

func (*Camera) GetExposureTimeAuto

func (c *Camera) GetExposureTimeAuto()

func (*Camera) GetExposureTimeBounds

func (c *Camera) GetExposureTimeBounds()

func (*Camera) GetFrameRate

func (c *Camera) GetFrameRate() (float64, error)

func (*Camera) GetFrameRateBounds

func (c *Camera) GetFrameRateBounds() (float64, float64, error)

func (*Camera) GetGain

func (c *Camera) GetGain() (float64, error)

func (*Camera) GetGainBounds

func (c *Camera) GetGainBounds() (float64, float64, error)

func (*Camera) GetHeight

func (c *Camera) GetHeight() (int, error)

func (*Camera) GetHeightBounds

func (c *Camera) GetHeightBounds() (int, int, error)

func (*Camera) GetLineRate

func (c *Camera) GetLineRate() (float64, error)

func (*Camera) GetModelName

func (c *Camera) GetModelName() (string, error)

func (*Camera) GetPayloadSize

func (c *Camera) GetPayloadSize() (uint, error)

func (*Camera) GetPixelFormat

func (c *Camera) GetPixelFormat()

func (*Camera) GetPixelFormatAsString

func (c *Camera) GetPixelFormatAsString()

func (*Camera) GetRegion

func (c *Camera) GetRegion() (int, int, int, int, error)

func (*Camera) GetSensorSize

func (c *Camera) GetSensorSize() (int, int, error)

func (*Camera) GetTriggerSource

func (c *Camera) GetTriggerSource() (string, error)

func (*Camera) GetVendorName

func (c *Camera) GetVendorName() (string, error)

func (*Camera) GetWidth

func (c *Camera) GetWidth() (int, error)

func (*Camera) GetWidthBounds

func (c *Camera) GetWidthBounds() (int, int, error)

func (*Camera) IsExposureAutoAvailable

func (c *Camera) IsExposureAutoAvailable() (bool, error)

func (*Camera) IsExposureTimeAvailable

func (c *Camera) IsExposureTimeAvailable() (bool, error)

func (*Camera) IsGVDevice

func (c *Camera) IsGVDevice() (bool, error)

func (*Camera) IsNil

func (c *Camera) IsNil() bool

func (*Camera) SetAcquisitionMode

func (c *Camera) SetAcquisitionMode(mode int) error

func (*Camera) SetBinning

func (c *Camera) SetBinning()

func (*Camera) SetControlLostHandler

func (c *Camera) SetControlLostHandler(hdl func()) error

func (*Camera) SetExposureTime

func (c *Camera) SetExposureTime(time float64) error

func (*Camera) SetExposureTimeAuto

func (c *Camera) SetExposureTimeAuto(mode int) error

func (*Camera) SetFrameRate

func (c *Camera) SetFrameRate(frameRate float64) error

func (*Camera) SetGain

func (c *Camera) SetGain(gain float64) error

func (*Camera) SetGainAuto

func (c *Camera) SetGainAuto()

func (*Camera) SetLineRate

func (c *Camera) SetLineRate(lineRate float64)

func (*Camera) SetPixelFormat

func (c *Camera) SetPixelFormat()

func (*Camera) SetPixelFormatFromString

func (c *Camera) SetPixelFormatFromString()

func (*Camera) SetRegion

func (c *Camera) SetRegion(x, y, width, height int) error

func (*Camera) SetTrigger

func (c *Camera) SetTrigger(source string) error

func (*Camera) SetTriggerSource

func (c *Camera) SetTriggerSource(source string) error

func (*Camera) SoftwareTrigger

func (c *Camera) SoftwareTrigger() error

func (*Camera) StartAcquisition

func (c *Camera) StartAcquisition() error

func (*Camera) StopAcquisition

func (c *Camera) StopAcquisition() error

type Device

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

func (*Device) ExecuteCommand

func (d *Device) ExecuteCommand(feature string) error

func (*Device) GetFloatFeatureValue

func (d *Device) GetFloatFeatureValue(feature string) (float64, error)

func (*Device) GetIntegerFeatureValue

func (d *Device) GetIntegerFeatureValue(feature string) (int64, error)

func (*Device) GetStringFeatureValue

func (d *Device) GetStringFeatureValue(feature string) (string, error)

func (*Device) IsNil

func (d *Device) IsNil() bool

func (*Device) LeaveControl

func (d *Device) LeaveControl() (bool, error)

func (*Device) SetFloatFeatureValue

func (d *Device) SetFloatFeatureValue(feature string, value float64)

func (*Device) SetIntegerFeatureValue

func (d *Device) SetIntegerFeatureValue(feature string, value int64)

func (*Device) SetNodeFeatureValue

func (d *Device) SetNodeFeatureValue(feature, value string)

func (*Device) SetStringFeatureValue

func (d *Device) SetStringFeatureValue(feature, value string)

func (*Device) TakeControl

func (d *Device) TakeControl() (bool, error)

type Stream

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

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) PopBuffer

func (s *Stream) PopBuffer() (Buffer, error)

func (*Stream) PushBuffer

func (s *Stream) PushBuffer(b Buffer)

func (*Stream) SetPropertyDouble

func (s *Stream) SetPropertyDouble(property string, value float32)

func (*Stream) SetPropertyLong

func (s *Stream) SetPropertyLong(property string, value int64)

func (*Stream) TimeoutPopBuffer

func (s *Stream) TimeoutPopBuffer(t time.Duration) (Buffer, error)

func (*Stream) TryPopBuffer

func (s *Stream) TryPopBuffer() (Buffer, error)

type ThreadPriorityType

type ThreadPriorityType int
const (
	ThreadPriorityNormal ThreadPriorityType = iota
	ThreadPriorityRealtime
	ThreadPriorityHigh
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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