1 #if !defined(_SCANNERFILE_) 27 #define MAXLINELEN 4096
36 #if !defined(_SCANNERFILEENTRY_) 82 virtual void Close ();
84 virtual void Flush ();
148 const KKStr& _fieldValue
259 const KKStr& _formatStr,
291 Format& _scannerFileFormat,
305 const KKStr& fieldValue
static ScannerFilePtr CreateScannerFileForOutput(const KKStr &_fileName, const KKStr &_formatStr, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log)
uchar * FrameBuffer() const
kkint32 LastScanLine() const
kkint64 frameBufferFileOffsetLast
kkint32 NextScanLine() const
virtual void WriteTextBlock(const uchar *txtBlock, kkuint32 txtBlockLen)=0
kkuint32 FlowMeterCounterScanLine() const
kkint64 frameBufferFileOffsetNext
const KKStr & FileName() const
void SaveIndexFile(std::vector< kkint64 > &frameOffsets)
StartStopPointPtr StartStopPointPrevEntry(kkint32 _scanLineNum)
void LoadIndexFile(bool &successful)
Call this method to Load the FrameOffsets and StartStop points from the index file.
static const KKStr & ScannerFileFormatToStr(Format fileFormat)
ScannerFile * ScannerFilePtr
kkint32 LargestKnownScanLine() const
ScannerHeaderFields * ScannerHeaderFieldsPtr
virtual void WriteInstrumentDataWord(uchar idNum, kkuint32 scanLineNum, WordFormat32Bits dataWord)
Writes a 32 bit number into the Scanner File Stream at current location.
void Open(const KKStr &_fileName)
void WriteHeader()
This method is called before any scanner data is added to the file. It will write the header informat...
void AddStartPoint(kkint32 _scanLineNum)
Adds a Start-Point to the 'StartStopPoints' list.
void ReportInstrumentDataWord(uchar idNum, kkuint32 scanLineNum, WordFormat32Bits dataWord)
VectorFloatPtr RecordRateByTimeIntervals(int intervalSecs)
Returns an array indication the record rate in bytes/sec for specified time-intervals.
void SkipBytesForward(kkuint32 numBytes)
void AddStopPoint(kkint32 _scanLineNum)
Adds a Stop-Point to the 'StartStopPoints' list.
void ReportTextMsg(const char *textBuff, kkint32 numTextBytes)
Text messages that are embedded in a scanner file can be reported here.
kkuint32 frameBufferNumScanLines
virtual kkuint32 ReadBufferFrame()=0
Read in one Scanner File Frame return number of actual scan-lines read.
void FrameRead(kkuint32 frameNum, bool &found)
Read into frame buffer 'frameNum' and reposition so that next scan-line will be the 1st line in the f...
void AddHeaderFields(const ScannerHeaderFieldsPtr _headerFields)
StartStopPointPtr StartStopPointSuccEntry(kkint32 _scanLineNum)
bool BuildFrameOffsetsRunning() const
unsigned __int32 kkuint32
bool FrameOffsetsLoaded() const
const KKStr & GetValue(const KKStr &fieldName)
StartStopPointList startStopPoints
kkuint32 flowMeterCounterScanLine
void ExtractHeaderField(const KKStr &fieldName, const KKStr &fieldValue)
Class that keeps track of parameter details of a single scanner file.
ScannerHeaderFieldsPtr headerFields
void AddStartStopEntryToIndexFile(kkint32 scanLineNum, StartStopPoint::StartStopType type, bool deleteEntry)
void DetermineFrameOffsetForFrame(kkuint32 frameNum)
Updates the byte offset for specified entry in 'frameOffsets' that is currently flagged with "-1"...
static ScannerFilePtr CreateScannerFile(KKStr _fileName, RunLog &_log)
void AllocateFrameBuffer()
std::ofstream * indexFile
kkint64 FileSizeInBytes() const
kkuint32 FlowMeterCounter() const
static const KKStr fileFormatOptions[]
bool frameBufferLastReadEof
KKStr FileFormatStr() const
unsigned char uchar
Unsigned character.
static Format ScannerFileFormatFromStr(const KKStr &fileFormatStr)
virtual Format FileFormat() const
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
void UpdateFrameOffset(kkuint32 frameNum, kkuint32 scanLineNum, kkint64 byteOffset)
Contains Classes that are specific to Cameras physical characteristics.
virtual void WriteScanLine(const uchar *buffer, kkuint32 bufferLen)
kkint64 GetFrameOffset(kkuint32 frameNum)
ScannerHeaderFieldsPtr HeaderFields() const
kkint64 ByteOffsetScanLineZero() const
virtual void WriteBufferFrame()=0
Write the contents of 'frameBuffer' to he end of the scanner file.
kkint64 FrameBufferFileOffsetNext() const
void StartStopPointDelete(kkint32 _scanLineNum)
bool frameOffsetsBuildRunning
bool FlatFieldEnabled() const
kkint32 LargestKnowmFrameNum() const
const StartStopPointList & StartStopPoints() const
void BuildFrameOffsets(const volatile bool &cancelFlag)
Will update the 'frameOffsets' table by scanning the file from the last known entry until the end of ...
float GetValueFloat(const KKStr &fieldName)
kkuint32 frameNumCurLoaded
static const uchar * ConpensationTable(Format format)
std::vector< kkint64 > frameOffsets
kkuint32 frameBufferNextLine
kkint32 FSeek(kkint64 filePos)
static void ReadHeaderOneLine(FILE *f, bool &endOfText, KKStr &line)
virtual void GetNextLine(uchar *lineBuff, kkuint32 lineBuffSize, kkuint32 &lineSize, kkuint32 colCount[], kkuint32 &pixelsInRow)
kkuint32 pixelsPerScanLine
kkint64 FrameBufferFileOffsetLast() const
void AddHeaderField(const KKStr &_fieldName, const KKStr &_fieldValue)
Used for logging messages.
class ScannerFileEntry * ScannerFileEntryPtr
static void GetScannerFileParameters(const KKStr &_scannerFileName, ScannerHeaderFieldsPtr &_headerFields, Format &_scannerFileFormat, kkint32 &_frameHeight, kkint32 &_frameWidth, float &_scanRate, bool &_successful, RunLog &_log)
Retrieves statistics for a specified Scanner File.
virtual void ScanRate(float _scanRate)
virtual kkint64 SkipToNextFrame()=0
Skip to start of next frame returning back byte offset of that frame.
kkuint32 PixelsPerScanLine() const
kkint32 FrameHeight() const
void SkipToScanLine(kkint32 scanLine)
Repositions the file such that the next call to 'GetNextLine' returns the 'scanLine' scan-line...
ScannerFile(const KKStr &_fileName, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log)
kkint32 largestKnownScanLine
static ScannerFilePtr CreateScannerFileForOutput(const KKStr &_fileName, Format _format, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log)
kkint64 byteOffsetScanLineZero
Class that keeps track of parameter details of a single scanner file.
ScannerFile(const KKStr &_fileName, RunLog &_log)
StartStopPointPtr StartStopPointNearestEntry(kkint32 _scanLineNum)
static Format GuessFormatOfFile(const KKStr &_fileName, RunLog &_log)
ScannerFileEntryPtr scannerFileEntry
kkuint32 flowMeterCounter
virtual kkint32 MemoryConsumedEstimated() const
VectorFloat * VectorFloatPtr