Documentation ¶
Index ¶
- Constants
- Variables
- func CloseDriver() error
- func GetParamInt(handle Handle, id ParamID) (int, error)
- func GetParamPtr(handle Handle, id ParamID) (unsafe.Pointer, error)
- func GetParamStr(handle Handle, id ParamID) (string, error)
- func GoCallbackHandler(info *CallbackInfo)
- func OpenDriver() error
- func SDKVersion() string
- func SetParamInst(handle Handle, id ParamID, val Handle) error
- func SetParamInt(handle Handle, id ParamID, val int) error
- func SetParamPtr(handle Handle, id ParamID, val unsafe.Pointer) error
- func SetParamStr(handle Handle, id ParamID, val string) error
- func Version() string
- type Board
- func (b *Board) CreateChannel() (*Channel, error)
- func (b *Board) Delete() error
- func (b *Board) GetParamInt(id ParamID) (int, error)
- func (b *Board) GetParamPtr(id ParamID) (unsafe.Pointer, error)
- func (b *Board) GetParamStr(id ParamID) (string, error)
- func (b *Board) SetParamInt(id ParamID, val int) error
- func (b *Board) SetParamPtr(id ParamID, val unsafe.Pointer) error
- func (b *Board) SetParamStr(id ParamID, val string) error
- type CallbackInfo
- type Channel
- func (c *Channel) Create() error
- func (c *Channel) Delete() error
- func (c *Channel) GetParamInst(id ParamID) (Handle, error)
- func (c *Channel) GetParamInt(id ParamID) (int, error)
- func (c *Channel) GetParamStr(id ParamID) (string, error)
- func (c *Channel) RegisterCallback(handler func(*CallbackInfo)) error
- func (c *Channel) SetParamInst(id ParamID, val Handle) error
- func (c *Channel) SetParamInt(id ParamID, val int) error
- func (c *Channel) SetParamStr(id ParamID, val string) error
- func (c *Channel) WaitSignal(signal ParamID, timeout int) (*SignalInfo, error)
- type ChannelStateID
- type Handle
- type Metadata
- type MetadataContentType
- type ParamID
- type SignalInfo
- type StatusCode
- type Surface
- func (s *Surface) Create() error
- func (s *Surface) Delete() error
- func (s *Surface) GetParamInt(id ParamID) (int, error)
- func (s *Surface) GetParamPtr(id ParamID) (unsafe.Pointer, error)
- func (s *Surface) GetParamStr(id ParamID) (string, error)
- func (s *Surface) Handle() Handle
- func (s *Surface) Ptr(x, y int) ([]byte, error)
- func (s *Surface) SetParamInt(id ParamID, val int) error
- func (s *Surface) SetParamPtr(id ParamID, val unsafe.Pointer) error
- func (s *Surface) SetParamStr(id ParamID, val string) error
- func (s *Surface) ToBytes(x, y int) ([]byte, error)
Constants ¶
const ( SignalEnableOn int = C.MC_SignalEnable_ON SignalEnableOff int = C.MC_SignalEnable_OFF )
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 )
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 )
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 )
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 )
const ( LineRateModeCamera = C.MC_LineRateMode_CAMERA LineRateModePeriod = C.MC_LineRateMode_PERIOD LineRateModePulse = C.MC_LineRateMode_PULSE LineRateModeConvert = C.MC_LineRateMode_CONVERT )
const ( ImageFlipXOff = C.MC_ImageFlipX_OFF ImageFlipXOn = C.MC_ImageFlipX_ON )
const GoMulticamVersion = "0.6.0"
GoMulticamVersion of this package, for display purposes. Change this variable on a new package release.
const IndeterminateLength = C.MC_INDETERMINATE
const (
// LED is id of built-in LED
LED = 25
)
const UninitializedBoard = 0
const UninitializedChannel = 0
const UninitializedSurface = 0
Variables ¶
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 ¶
GetParamInt gets a parameter int value.
func GetParamPtr ¶
GetParamPtr gets a parameter Ptr value.
func GetParamStr ¶
GetParamStr gets a parameter string value.
func GoCallbackHandler ¶
func GoCallbackHandler(info *CallbackInfo)
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 ¶
SetParamInst sets a parameter Inst (Handle) value.
func SetParamInt ¶
SetParamInt sets a parameter int value.
func SetParamPtr ¶
SetParamPtr sets a parameter Ptr value.
func SetParamStr ¶
SetParamStr sets a parameter string value.
Types ¶
type Board ¶
type Board struct {
// contains filtered or unexported fields
}
func BoardForHandle ¶
BoardForHandle returns a Multicam Board for an existing Handle.
func BoardForIndex ¶
BoardForIndex returns a Multicam Board for a specific DriverIndex.
func (*Board) CreateChannel ¶
CreateChannel creates a new Channel for this Board.
func (*Board) Delete ¶
Delete deletes an existing MultiCam Board object. Just here for consistency, no need to actually "delete" a board.
func (*Board) GetParamInt ¶
GetParamInt gets a parameter int value for this Board.
func (*Board) GetParamPtr ¶
GetParamPtr gets a parameter pointer value for this Board.
func (*Board) GetParamStr ¶
GetParamStr gets a parameter string value for this Board.
func (*Board) SetParamInt ¶
SetParamInt sets a parameter int value for this Board.
func (*Board) SetParamPtr ¶
SetParamPtr sets a parameter pointer 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 (*Channel) GetParamInst ¶
GetParamInst gets a parameter instance value for this channel.
func (*Channel) GetParamInt ¶
GetParamInt gets a parameter int value for this channel.
func (*Channel) GetParamStr ¶
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 ¶
SetParamInst sets a parameter instance value for this channel.
func (*Channel) SetParamInt ¶
SetParamInt sets a parameter int value for this channel.
func (*Channel) SetParamStr ¶
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 )
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.
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 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 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 )
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) Instance ¶ added in v0.2.0
func (s *SignalInfo) Instance() Handle
MCHANDLE Instance;
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 SurfaceForHandle ¶
SurfaceForHandle returns a Multicam Surface for an existing Handle.
func (*Surface) GetParamInt ¶
GetParamInt gets a parameter int value for this surface.
func (*Surface) GetParamPtr ¶
GetParamPtr gets a parameter pointer value for this surface.
func (*Surface) GetParamStr ¶
GetParamStr gets a parameter string value for this surface.
func (*Surface) Handle ¶ added in v0.2.0
Handle returns the Handle for this MultiCam surface object.
func (*Surface) Ptr ¶
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 ¶
SetParamInt sets a parameter int value for this surface.
func (*Surface) SetParamPtr ¶
SetParamPtr sets a parameter pointer value for this surface.
func (*Surface) SetParamStr ¶
SetParamStr sets a parameter string value for this surface.