OWLIFT C Library for Linux: Writing and Reading File
OWLIFT C Library for Linux  1.9.3
Top Page
Functions
Writing and Reading File

Functions

OwStatus_t OwLib_FileWriteSetup (OwDev dev, const char *filePath)
 
OwStatus_t OwLib_FileWriteStart (OwDev dev)
 
OwStatus_t OwLib_FileWriteStop (OwDev dev)
 
OwStatus_t OwLib_FileWritePassiveSetup (OwDev dev, const char *filePath, int frameRateNumerator, int frameRateDenominator)
 
OwStatus_t OwLib_FileWritePassiveAdd (OwDev dev, BYTE *buf, UINT32 bufLen)
 
OwStatus_t OwLib_FileReadSetup (OwDev *devp, const char *filePath, OwLibCaptureProc capProc, OwLibNotifyProc endNotifyProc, void *userData)
 
void OwLib_FileReadPause (OwDev dev)
 
void OwLib_FileReadResume (OwDev dev)
 
OwStatus_t OwLib_FileReadSeek (OwDev dev, UINT64 timeOfs)
 
UINT64 OwLib_GetFileTimeLength (OwDev dev)
 
UINT64 OwLib_GetFileHeadTimeOffset (OwDev dev)
 
UINT64 OwLib_GetFileCurrentTimeOffset (OwDev dev)
 
UINT32 OwLib_GetFileFrames (OwDev dev)
 
UINT32 OwLib_GetFileCurrentFrameNumber (OwDev dev)
 
void OwLib_GetFileHeadDateTime (OwDev dev, OwDateTime *dateTimep)
 
void OwLib_GetFileCurrentDateTime (OwDev dev, OwDateTime *dateTimep)
 
double OwLib_GetFileReadSpeed (OwDev dev)
 
void OwLib_SetFileReadSpeed (OwDev dev, double speed)
 
BOOL OwLib_GetFileReadPaused (OwDev dev)
 
OwStatus_t OwLib_FileTimeBasedAGCSetup (OwDev dev, BOOL isLinearAGC, UINT32 sampleFrameNumIntvl, UINT64 fromTimeOfs, UINT64 toTimeOfs)
 
BOOL OwLib_GetTimeBasedAGC (OwDev dev)
 
void OwLib_SetTimeBasedAGC (OwDev dev, BOOL enabled)
 
OwStatus_t OwLib_SetAGCROIMask (OwDev dev, const BOOL *mask)
 
OwStatus_t OwLib_GetFileError (OwDev dev)
 
OwStatus_t OwLib_DumpFrame (OwDev dev, const char *filePath, WORD *buf, UINT32 bufLen, const LepTelemetryDataLineA *telemp, const OwDateTime *dateTimep, BOOL tempOrRaw)
 

Detailed Description

Function Documentation

◆ OwLib_DumpFrame()

OwStatus_t OwLib_DumpFrame ( OwDev  dev,
const char *  filePath,
WORD *  buf,
UINT32  bufLen,
const LepTelemetryDataLineA telemp,
const OwDateTime dateTimep,
BOOL  tempOrRaw 
)

Outputs temperature data or raw data as ascii format.

Parameters
dev[in] The device handle.
filePath[in] The file path to output. NULL means standard output.
buf[in] The temperature data or raw data. For a raw data, use a result of decoding by OwDecodeType.RAW_14.
bufLen[in] The size of 'buf'.
telemp[in] The telemetry data correponding to 'buf'.
dateTimep[in] The date time to output. NULL means a current date time,
tempOrRaw[in] TRUE : 'buf' is temperature data, FALSE : 'buf' is raw data.
Returns
The error code.

◆ OwLib_FileReadPause()

void OwLib_FileReadPause ( OwDev  dev)

Pauses the raw-playing.

Parameters
dev[in] The device handle.

◆ OwLib_FileReadResume()

void OwLib_FileReadResume ( OwDev  dev)

Resumes the raw-playing.

Parameters
dev[in] The device handle.

◆ OwLib_FileReadSeek()

OwStatus_t OwLib_FileReadSeek ( OwDev  dev,
UINT64  timeOfs 
)

Resumes the raw-playing.

Parameters
dev[in] The device handle.
timeOfs[in] The time offset from the head in milli seconds.
Returns
The error code.

◆ OwLib_FileReadSetup()

OwStatus_t OwLib_FileReadSetup ( OwDev devp,
const char *  filePath,
OwLibCaptureProc  capProc,
OwLibNotifyProc  endNotifyProc,
void *  userData 
)

Configures the raw-playing. To play a raw-recording file, get the device handle for playing by this function. The device handle this function returns uses a file as the data source instead of a real device. To start playing, call OwLib_CaptureStart() against the device handle this function returns.

Parameters
devp[out] The pointer that receives a device handle. Caller takes responsibility for releasing *devp. OwLib_Release() releases *devp.
filePath[in] The file path of a raw-recording file.
capProc[in] The callback function being called while playing. This function is called every time a frame is retrieved from the file. The user can take frames in the user-defined function of which type is OwLibCaptureProc.
endNotifyProc[in] The callback function being called at the end of file.
userData[in] The arbitrary value passed to 'capProc' and 'endNotifyProc'.
Returns
The error code.

◆ OwLib_FileTimeBasedAGCSetup()

OwStatus_t OwLib_FileTimeBasedAGCSetup ( OwDev  dev,
BOOL  isLinearAGC,
UINT32  sampleFrameNumIntvl,
UINT64  fromTimeOfs,
UINT64  toTimeOfs 
)

Extracts frames from the raw-recording file at the specified interval and setup Time-Based AGC minimum and maximum temperatures of all the frames. This function must be called before calling OwLib_CaptureStart().

Parameters
dev[in] The device handle.
isLinearAGC[in] The kind of decode type which will be passed to OwLib_Decode(). TRUE : Use Linear AGC, FALSE : Use Non-Linear AGC.
sampleFrameNumIntvl[in] The interval number of frames for extracting.
fromTimeOfs[in] The time offset to start calculating.
toTimeOfs[in] The time offset to stop calculating.
Returns
The error code.

◆ OwLib_FileWritePassiveAdd()

OwStatus_t OwLib_FileWritePassiveAdd ( OwDev  dev,
BYTE *  buf,
UINT32  bufLen 
)

Add a frame to the raw-recording file. Call this function when you called OwLib_FileWritePassiveSetup().

Parameters
dev[in] The device handle.
buf[in] The frame buffer. This is raw data of sensor output of which format is in big-endian.
bufLen[in] The size of the area where 'buf' points in bytes.
Returns
The error code.

◆ OwLib_FileWritePassiveSetup()

OwStatus_t OwLib_FileWritePassiveSetup ( OwDev  dev,
const char *  filePath,
int  frameRateNumerator,
int  frameRateDenominator 
)

Starts the raw-recording. This function is used when it is needed to change the timing to save frames. Use this with OwLib_FileWritePassiveAdd().

Parameters
dev[in] The device handle.
filePath[in] The file path of a raw-recording file.
frameRateNumerator[in] The numerator of the frame rate.
frameRateDenominator[in] The denominator of the frame rate.
Returns
The error code.

◆ OwLib_FileWriteSetup()

OwStatus_t OwLib_FileWriteSetup ( OwDev  dev,
const char *  filePath 
)

Configures the raw-recording.

Parameters
dev[in] The device handle.
filePath[in] The file path of a raw-recording file.
Returns
The error code.

◆ OwLib_FileWriteStart()

OwStatus_t OwLib_FileWriteStart ( OwDev  dev)

Starts the raw-recording.

Parameters
dev[in] The device handle.
Returns
The error code.

◆ OwLib_FileWriteStop()

OwStatus_t OwLib_FileWriteStop ( OwDev  dev)

Stops the raw-recording.

Parameters
dev[in] The device handle.
Returns
The error code.

◆ OwLib_GetFileCurrentDateTime()

void OwLib_GetFileCurrentDateTime ( OwDev  dev,
OwDateTime dateTimep 
)

Returns the time of the frame last read from the raw-recording file.

Parameters
dev[in] The device handle.
dateTimep[out] The pointer that receives the time.
Returns
The correspoinding value.

◆ OwLib_GetFileCurrentFrameNumber()

UINT32 OwLib_GetFileCurrentFrameNumber ( OwDev  dev)

Returns the frame number of the frame last read from the raw-recording file. The first frame number is 1.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileCurrentTimeOffset()

UINT64 OwLib_GetFileCurrentTimeOffset ( OwDev  dev)

Returns the time offset of the frame last read from the raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileError()

OwStatus_t OwLib_GetFileError ( OwDev  dev)

Returns the error occurred while recording or playing the raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileFrames()

UINT32 OwLib_GetFileFrames ( OwDev  dev)

Returns the number of frames of the raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileHeadDateTime()

void OwLib_GetFileHeadDateTime ( OwDev  dev,
OwDateTime dateTimep 
)

Returns the time of the first frame in the raw-recording file.

Parameters
dev[in] The device handle.
dateTimep[out] The pointer that receives the time.
Returns
The correspoinding value.

◆ OwLib_GetFileHeadTimeOffset()

UINT64 OwLib_GetFileHeadTimeOffset ( OwDev  dev)

Returns the time offset of the first frame in the raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileReadPaused()

BOOL OwLib_GetFileReadPaused ( OwDev  dev)

Returns whether or not playing raw-recording file is paused.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileReadSpeed()

double OwLib_GetFileReadSpeed ( OwDev  dev)

Returns the scaling factor for the playback speed of raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetFileTimeLength()

UINT64 OwLib_GetFileTimeLength ( OwDev  dev)

Returns the time length of the raw-recording file.

Parameters
dev[in] The device handle.
Returns
The correspoinding value.

◆ OwLib_GetTimeBasedAGC()

BOOL OwLib_GetTimeBasedAGC ( OwDev  dev)

Gets whether or not Time-Based AGC is enabled.

Parameters
dev[in] The device handle.
Returns
The corresponding value.

◆ OwLib_SetAGCROIMask()

OwStatus_t OwLib_SetAGCROIMask ( OwDev  dev,
const BOOL *  mask 
)

Sets ROI for Auto Gain Control. ROI is useful when colors look flat because there are pixels of high or low temperature at uninsteresting area.

Parameters
dev[in] The device handle.
mask[in] Two dimensional BOOL array that has elements of frame width x frame height. When the mask value that position corresponds to the pixel's position is TRUE, the pixel is calculation target. If all elements are FALSEs, an error code is returned.
Returns
The error code.

◆ OwLib_SetFileReadSpeed()

void OwLib_SetFileReadSpeed ( OwDev  dev,
double  speed 
)

Sets the scaling factor for the playback speed of raw-recording file.

Parameters
dev[in] The device handle.
speed[in] The correspoinding value that is greater than or equal to zero. Zero means maximum speed.

◆ OwLib_SetTimeBasedAGC()

void OwLib_SetTimeBasedAGC ( OwDev  dev,
BOOL  enabled 
)

Sets whether or not Time-Based AGC is enabled. OwLib_FileTimeBasedAGCSetup() must be called before setting TRUE.

Parameters
dev[in] The device handle.
enabled[in] The corresponding value.