Documentation ¶
Index ¶
- Constants
- Variables
- func NewRawFrame() []byte
- func ParseRawFrame(raw []byte, out *cptvframe.Frame, edgePixels int) error
- func ParseTelemetry(raw []byte, t *cptvframe.Telemetry) error
- type BadFrameErr
- type Celsius
- type FFCMode
- type FFCShutterMode
- type Lepton3
- func (d *Lepton3) Close()
- func (l *Lepton3) FPS() int
- func (d *Lepton3) GetCustomerPartNum() (string, error)
- func (d *Lepton3) GetFFCModeControl() (*FFCMode, error)
- func (d *Lepton3) GetModel() (string, error)
- func (d *Lepton3) GetPartNum() (string, error)
- func (d *Lepton3) GetSerial() (uint64, error)
- func (d *Lepton3) GetSoftwareVersion() (LeptonSoftwareRevision, error)
- func (d *Lepton3) GetTLinearEnabled() (bool, error)
- func (d *Lepton3) IsRadioMetricLeptonModel() bool
- func (d *Lepton3) NextFrame(outFrame []byte) error
- func (d *Lepton3) Open() error
- func (l *Lepton3) ResX() int
- func (l *Lepton3) ResY() int
- func (d *Lepton3) RunFFC() error
- func (d *Lepton3) SetAutoFFC(auto bool) error
- func (d *Lepton3) SetFFCModeControl(mode *FFCMode) error
- func (d *Lepton3) SetLogFunc(log func(string))
- func (d *Lepton3) SetRadiometry(enable bool) error
- func (d *Lepton3) Snapshot() ([]byte, error)
- type LeptonSoftwareRevision
Constants ¶
const ( FrameCols = 160 FrameRows = 120 FramesHz = 9 BytesPerFrame = packetsPerFrame * vospiDataSize Brand = "flir" Model = "lepton3" Model35 = "lepton3.5" )
const ( FFCShutterModeManual = cci.FFCShutterModeManual FFCShutterModeAuto = cci.FFCShutterModeAuto FFCShutterModeExternal = cci.FFCShutterModeExternal )
const ( ShutterTempLockoutStateInactive = cci.ShutterTempLockoutStateInactive ShutterTempLockoutStateHigh = cci.ShutterTempLockoutStateHigh ShutterTempLockoutStateLow = cci.ShutterTempLockoutStateLow )
const ( FFCNever = "never" FFCImminent = "imminent" FFCRunning = "running" FFCComplete = "complete" )
These are the valid values for the Telemetry.FFCState field.
Variables ¶
var Big16 big16
Big16 translates big endian 16bits words but everything larger is in little endian.
It implements binary.ByteOrder.
Functions ¶
func NewRawFrame ¶
func NewRawFrame() []byte
NewRawFrame returns a correctly sized byte slice for holding a single Lepton 3 frame.
func ParseRawFrame ¶
ParseRawFrame converts a byte slice containing a raw Lepton 3 frame into a cptvframe.Frame. The result is writing into the Frame provided.
Types ¶
type BadFrameErr ¶
type BadFrameErr struct {
Cause error
}
func (*BadFrameErr) Error ¶
func (e *BadFrameErr) Error() string
type Celsius ¶
func CelsiusFromFloat ¶
CelsiusFromFloat creates a new Celsius from a floating point value. This is used for temperature fields in FFCMode.
type FFCShutterMode ¶
type FFCShutterMode = cci.FFCShutterMode
type Lepton3 ¶
type Lepton3 struct {
// contains filtered or unexported fields
}
Lepton3 manages a connection to an FLIR Lepton 3 camera. It is not goroutine safe.
func (*Lepton3) Close ¶
func (d *Lepton3) Close()
Close stops streaming of packets from the camera and closes the SPI device connection. It must only be called if streaming was started with Open().
func (*Lepton3) GetCustomerPartNum ¶
The OEM customer part number, which may or may not actually be useful
func (*Lepton3) GetFFCModeControl ¶
GetFFCModeControl returns the parameters and state relating to FFC.
func (*Lepton3) GetPartNum ¶
The OEM part number, which is distinct between lepton versions. Lepton 3: 500-0726-01 Lepton 3.5: 500-0771-01 See https://www.flir.es/globalassets/imported-assets/document/lepton-3-3.5-datasheet.pdf
func (*Lepton3) GetSoftwareVersion ¶
func (d *Lepton3) GetSoftwareVersion() (LeptonSoftwareRevision, error)
The software and dsp revisions, which we can use to try and determine what version of the lepton module we have.
func (*Lepton3) GetTLinearEnabled ¶
Whether or not TLinear is enabled. It is enabled by default on radiometric lepton modules (2.5, 3.5), and trying to see if it is enabled on a lepton 3.0 gives an error, enabling us to determine reliably if we have a radiometry enabled lepton module.
func (*Lepton3) IsRadioMetricLeptonModel ¶
func (*Lepton3) NextFrame ¶
NextFrame returns the next frame from the camera into the raw frame slice.
The output slice is provided (rather than being created by NextFrame) to minimise memory allocations.
NextFrame should only be called after a successful call to Open(). Although there is some internal buffering of camera packets, NextFrame must be called frequently enough to ensure frames are not lost.
func (*Lepton3) Open ¶
Open initialises the SPI connection and starts streaming packets from the camera.
func (*Lepton3) SetAutoFFC ¶
func (*Lepton3) SetFFCModeControl ¶
SetFFCModeControl sets the parameters and state relating to FFC. To avoid strange behaviour, it is important to call this with a FFCMode based on a recent return from GetFFCModeControl.
Lepton 3 camera defaults:
&FFCMode{ FFCShutterMode: FFCShutterModeAuto ShutterTempLockoutState: ShutterTempLockoutStateInactive VideoFreezeDuringFFC: true FFCDesired <dynamic state, no default> ElapsedTimeSinceLastFFC: <dynamic state, no default> DesiredFFCPeriod: 5 * time.Minute ExplicitCommandToOpen: true DesiredFFCTempDelta: CelsiusFromFloat(3.0) ImminentDelay: 52 }
func (*Lepton3) SetLogFunc ¶
func (*Lepton3) SetRadiometry ¶
SetRadiometry enables or disables radiometry mode. If enabled, the camera will attempt to automatically compensate for ambient temperature changes.