![]() |
KSquare Utilities
|
#include <base>
Inheritance diagram for KKLSC::ScannerFile:Public Types | |
| enum | Format { Format::sfSimple, Format::sf2BitEncoded, Format::sf3BitEncoded, Format::sf4BitEncoded, Format::sfZlib3BitEncoded, Format::sfUnKnown } |
| enum | IOMode { ioRead, ioWrite } |
| typedef ScannerFile * | ScannerFilePtr |
Public Member Functions | |
| ScannerFile (const KKStr &_fileName, RunLog &_log) | |
| ScannerFile (const KKStr &_fileName, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log) | |
| virtual | ~ScannerFile () |
| void | AddHeaderField (const KKStr &_fieldName, const KKStr &_fieldValue) |
| void | AddHeaderFields (const ScannerHeaderFieldsPtr _headerFields) |
| void | AddStartPoint (kkint32 _scanLineNum) |
| Adds a Start-Point to the 'StartStopPoints' list. More... | |
| void | AddStopPoint (kkint32 _scanLineNum) |
| Adds a Stop-Point to the 'StartStopPoints' list. More... | |
| void | BuildFrameOffsets (const volatile bool &cancelFlag) |
| Will update the 'frameOffsets' table by scanning the file from the last known entry until the end of file. More... | |
| bool | BuildFrameOffsetsRunning () const |
| kkint64 | ByteOffsetScanLineZero () const |
| virtual void | Close () |
| bool | Eof () const |
| virtual Format | FileFormat () const |
| KKStr | FileFormatStr () const |
| const KKStr & | FileName () const |
| kkint64 | FileSizeInBytes () const |
| bool | FlatFieldEnabled () const |
| kkuint32 | FlowMeterCounter () const |
| kkuint32 | FlowMeterCounterScanLine () const |
| virtual void | Flush () |
| uchar * | FrameBuffer () const |
| kkint64 | FrameBufferFileOffsetLast () const |
| kkint64 | FrameBufferFileOffsetNext () const |
| kkint32 | FrameHeight () const |
| bool | FrameOffsetsLoaded () const |
| 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 frame. More... | |
| virtual void | GetNextLine (uchar *lineBuff, kkuint32 lineBuffSize, kkuint32 &lineSize, kkuint32 colCount[], kkuint32 &pixelsInRow) |
| const KKStr & | GetValue (const KKStr &fieldName) |
| float | GetValueFloat (const KKStr &fieldName) |
| ScannerHeaderFieldsPtr | HeaderFields () const |
| void | InitiateWritting () |
| kkint32 | LargestKnowmFrameNum () const |
| kkint32 | LargestKnownScanLine () const |
| kkint32 | LastScanLine () const |
| void | LoadIndexFile (bool &successful) |
| Call this method to Load the FrameOffsets and StartStop points from the index file. More... | |
| virtual kkint32 | MemoryConsumedEstimated () const |
| kkint32 | NextScanLine () const |
| bool | Opened () const |
| kkuint32 | PixelsPerScanLine () const |
| VectorFloatPtr | RecordRateByTimeIntervals (int intervalSecs) |
| Returns an array indication the record rate in bytes/sec for specified time-intervals. More... | |
| void | Reset () |
| float | ScanRate () const |
| virtual void | ScanRate (float _scanRate) |
| void | SkipNextLine () |
| void | SkipToScanLine (kkint32 scanLine) |
| Repositions the file such that the next call to 'GetNextLine' returns the 'scanLine' scan-line. More... | |
| void | StartStopPointDelete (kkint32 _scanLineNum) |
| StartStopPointPtr | StartStopPointNearestEntry (kkint32 _scanLineNum) |
| StartStopPointPtr | StartStopPointPrevEntry (kkint32 _scanLineNum) |
| const StartStopPointList & | StartStopPoints () const |
| StartStopPointPtr | StartStopPointSuccEntry (kkint32 _scanLineNum) |
| virtual void | WriteInstrumentDataWord (uchar idNum, kkuint32 scanLineNum, WordFormat32Bits dataWord) |
| Writes a 32 bit number into the Scanner File Stream at current location. More... | |
| virtual void | WriteScanLine (const uchar *buffer, kkuint32 bufferLen) |
| virtual void | WriteTextBlock (const uchar *txtBlock, kkuint32 txtBlockLen)=0 |
Static Public Member Functions | |
| static const uchar * | ConpensationTable (Format format) |
| static ScannerFilePtr | CreateScannerFile (KKStr _fileName, RunLog &_log) |
| static ScannerFilePtr | CreateScannerFileForOutput (const KKStr &_fileName, Format _format, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log) |
| static ScannerFilePtr | CreateScannerFileForOutput (const KKStr &_fileName, const KKStr &_formatStr, kkuint32 _pixelsPerScanLine, kkuint32 _frameHeight, RunLog &_log) |
| 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. More... | |
| static Format | GuessFormatOfFile (const KKStr &_fileName, RunLog &_log) |
| static Format | ScannerFileFormatFromStr (const KKStr &fileFormatStr) |
| static const KKStr & | ScannerFileFormatToStr (Format fileFormat) |
Protected Member Functions | |
| void | AddStartStopEntryToIndexFile (kkint32 scanLineNum, StartStopPoint::StartStopType type, bool deleteEntry) |
| void | AllocateFrameBuffer () |
| void | CreateGoalie () |
| void | DetermineFrameOffsetForFrame (kkuint32 frameNum) |
| Updates the byte offset for specified entry in 'frameOffsets' that is currently flagged with "-1". More... | |
| void | ExtractHeaderField (const KKStr &fieldName, const KKStr &fieldValue) |
| kkint32 | FSeek (kkint64 filePos) |
| kkint64 | GetFrameOffset (kkuint32 frameNum) |
| void | Open (const KKStr &_fileName) |
| virtual kkuint32 | ReadBufferFrame ()=0 |
| Read in one Scanner File Frame return number of actual scan-lines read. More... | |
| void | ReadHeader () |
| void | ReportInstrumentDataWord (uchar idNum, kkuint32 scanLineNum, WordFormat32Bits dataWord) |
| void | ReportTextMsg (const char *textBuff, kkint32 numTextBytes) |
| Text messages that are embedded in a scanner file can be reported here. More... | |
| void | SaveIndexFile (std::vector< kkint64 > &frameOffsets) |
| void | SkipBytesForward (kkuint32 numBytes) |
| virtual kkint64 | SkipToNextFrame ()=0 |
| Skip to start of next frame returning back byte offset of that frame. More... | |
| void | UpdateFrameOffset (kkuint32 frameNum, kkuint32 scanLineNum, kkint64 byteOffset) |
| virtual void | WriteBufferFrame ()=0 |
| Write the contents of 'frameBuffer' to he end of the scanner file. More... | |
| void | WriteHeader () |
| This method is called before any scanner data is added to the file. It will write the header information for the file. More... | |
Static Protected Member Functions | |
| static void | ReadHeaderOneLine (FILE *f, bool &endOfText, KKStr &line) |
Static Protected Attributes | |
| static const KKStr | fileFormatOptions [] |
class to be used for all the different Scanner File Formats.
Definition at line 45 of file ScannerFile.h.
Definition at line 48 of file ScannerFile.h.
|
strong |
| Enumerator | |
|---|---|
| sfSimple | |
| sf2BitEncoded | |
| sf3BitEncoded | |
| sf4BitEncoded | |
| sfZlib3BitEncoded | |
| sfUnKnown | |
Definition at line 50 of file ScannerFile.h.
| Enumerator | |
|---|---|
| ioRead | |
| ioWrite | |
Definition at line 59 of file ScannerFile.h.
Constructor for opening file for reading
Definition at line 40 of file ScannerFile.cpp.
References AllocateFrameBuffer(), byteOffsetScanLineZero, CreateGoalie(), eof, file, fileName, fileSizeInBytes, flatFieldEnabled, flowMeterCounter, flowMeterCounterScanLine, frameBuffer, frameBufferFileOffsetLast, frameBufferFileOffsetNext, frameBufferLastReadEof, frameBufferLen, frameBufferNextLine, frameBufferNumScanLines, frameBufferSize, frameHeight, frameNumCurLoaded, frameOffsetsBuildRunning, frameOffsetsLoaded, KKLSC::ScannerFileEntry::FullName(), KKLSC::ScannerFileEntry::GetOrCreateScannerFileEntry(), goalie, headerDataWritten, headerFields, indexFile, indexFileName, ioMode, ioRead, KKB::KKStr::KKStr(), largestKnownScanLine, lastScanLine, log, nextScanLine, Open(), opened, KKB::osFTELL(), KKB::osGetRootName(), KKLSC::ScannerFileEntry::PixelsPerScanLine(), pixelsPerScanLine, ReadHeader(), ScannerFile(), scannerFileEntry, KKLSC::ScannerFileEntry::ScanRate(), scanRate, and UpdateFrameOffset().
Referenced by ScannerFile(), KKLSC::ScannerFile2BitEncoded::ScannerFile2BitEncoded(), KKLSC::ScannerFile3BitEncoded::ScannerFile3BitEncoded(), KKLSC::ScannerFile4BitEncoded::ScannerFile4BitEncoded(), and KKLSC::ScannerFileZLib3BitEncoded::ScannerFileZLib3BitEncoded().
| ScannerFile::ScannerFile | ( | const KKStr & | _fileName, |
| kkuint32 | _pixelsPerScanLine, | ||
| kkuint32 | _frameHeight, | ||
| RunLog & | _log | ||
| ) |
Constructor for opening file for Writing
Definition at line 104 of file ScannerFile.cpp.
References AllocateFrameBuffer(), byteOffsetScanLineZero, eof, file, fileName, fileSizeInBytes, flatFieldEnabled, flowMeterCounter, flowMeterCounterScanLine, frameBuffer, frameBufferFileOffsetLast, frameBufferFileOffsetNext, frameBufferLastReadEof, frameBufferLen, frameBufferNextLine, frameBufferNumScanLines, frameBufferSize, frameHeight, frameNumCurLoaded, frameOffsetsBuildRunning, frameOffsetsLoaded, KKLSC::ScannerFileEntry::FullName(), KKLSC::ScannerFileEntry::GetOrCreateScannerFileEntry(), goalie, headerDataWritten, headerFields, indexFile, indexFileName, ioMode, ioWrite, KKB::KKStr::KKStr(), largestKnownScanLine, lastScanLine, log, nextScanLine, Open(), opened, KKB::osFTELL(), KKB::osGetRootName(), KKLSC::ScannerFileEntry::PixelsPerScanLine(), pixelsPerScanLine, ScannerFile(), scannerFileEntry, and scanRate.
Referenced by ScannerFile(), KKLSC::ScannerFile2BitEncoded::ScannerFile2BitEncoded(), KKLSC::ScannerFile3BitEncoded::ScannerFile3BitEncoded(), KKLSC::ScannerFile4BitEncoded::ScannerFile4BitEncoded(), and KKLSC::ScannerFileZLib3BitEncoded::ScannerFileZLib3BitEncoded().
|
virtual |
Definition at line 163 of file ScannerFile.cpp.
References Close(), KKB::GoalKeeper::Destroy(), frameBuffer, goalie, headerFields, and opened.
Definition at line 1082 of file ScannerFile.cpp.
References KKLSC::ScannerHeaderFields::Add(), ExtractHeaderField(), headerFields, and KKLSC::ScannerHeaderFields::ScannerHeaderFields().
Referenced by InitiateWritting().
| void ScannerFile::AddHeaderFields | ( | const ScannerHeaderFieldsPtr | _headerFields | ) |
Definition at line 1094 of file ScannerFile.cpp.
References KKLSC::ScannerHeaderFields::EndBlock(), and KKLSC::ScannerHeaderFields::StartBlock().
| void ScannerFile::AddStartPoint | ( | kkint32 | _scanLineNum | ) |
Adds a Start-Point to the 'StartStopPoints' list.
Definition at line 355 of file ScannerFile.cpp.
References AddStartStopEntryToIndexFile(), and KKLSC::StartStopPoint::StartPoint.
|
protected |
Definition at line 314 of file ScannerFile.cpp.
References CreateGoalie(), KKB::KKStr::Empty(), KKB::GoalKeeper::EndBlock(), goalie, indexFile, indexFileName, KKB::osSleepMiliSecs(), and KKB::GoalKeeper::StartBlock().
Referenced by AddStartPoint(), AddStopPoint(), and StartStopPointDelete().
| void ScannerFile::AddStopPoint | ( | kkint32 | _scanLineNum | ) |
Adds a Stop-Point to the 'StartStopPoints' list.
Definition at line 363 of file ScannerFile.cpp.
References AddStartStopEntryToIndexFile(), and KKLSC::StartStopPoint::StopPoint.
|
protected |
Definition at line 195 of file ScannerFile.cpp.
References frameBuffer, frameBufferLen, frameBufferSize, frameHeight, and pixelsPerScanLine.
Referenced by ScannerFile().
| void ScannerFile::BuildFrameOffsets | ( | const volatile bool & | cancelFlag | ) |
Will update the 'frameOffsets' table by scanning the file from the last known entry until the end of file.
It would be best to call this method using a separate thread. The method will utilize synchronization code to prevent interference with the other access methods such as 'GetNextLine', 'FrameRead', etc. The idea is that it will not interfere with file positioning.
| [in] | cancelFlag | This Boolean variable will be monitored by the method; if it turns true it will terminate and return immediately. |
Definition at line 1195 of file ScannerFile.cpp.
References CreateGoalie(), KKB::GoalKeeper::EndBlock(), file, frameHeight, frameOffsetsBuildRunning, frameOffsetsLoaded, FSeek(), goalie, largestKnownScanLine, LoadIndexFile(), KKB::GoalKeeper::NumBlockedThreads(), KKB::osFTELL(), KKB::osSleepMiliSecs(), SkipToNextFrame(), and KKB::GoalKeeper::StartBlock().
|
inline |
Definition at line 89 of file ScannerFile.h.
References frameOffsetsBuildRunning.
|
inline |
Byte offset of 1st scan line after header field.
Definition at line 90 of file ScannerFile.h.
References byteOffsetScanLineZero.
|
virtual |
Definition at line 205 of file ScannerFile.cpp.
References file, frameBufferNextLine, indexFile, ioMode, ioWrite, opened, and WriteBufferFrame().
Referenced by ~ScannerFile().
Definition at line 816 of file ScannerFile.cpp.
References KKLSC::ScannerFileSimple::CompensationTable(), KKLSC::ScannerFile2BitEncoded::CompensationTable(), KKLSC::ScannerFile3BitEncoded::CompensationTable(), KKLSC::ScannerFile4BitEncoded::CompensationTable(), sf2BitEncoded, sf3BitEncoded, sf4BitEncoded, sfSimple, sfUnKnown, and sfZlib3BitEncoded.
|
protected |
Definition at line 304 of file ScannerFile.cpp.
References KKB::GoalKeeper::Create(), fileName, goalie, KKB::operator+(), and KKB::osGetRootName().
Referenced by AddStartStopEntryToIndexFile(), BuildFrameOffsets(), DetermineFrameOffsetForFrame(), ScannerFile(), and UpdateFrameOffset().
|
static |
Definition at line 787 of file ScannerFile.cpp.
References GuessFormatOfFile(), and sfUnKnown.
Referenced by GetScannerFileParameters().
|
static |
Definition at line 848 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), KKB::osFileExists(), and sfUnKnown.
Referenced by CreateScannerFileForOutput().
|
static |
Definition at line 906 of file ScannerFile.cpp.
References CreateScannerFileForOutput(), ScannerFileFormatFromStr(), and sfUnKnown.
|
protected |
Updates the byte offset for specified entry in 'frameOffsets' that is currently flagged with "-1".
This is meant to update entries in 'frameOffsets' that were flagged with '-1'. It will not work for frameNum == 0; this is okay since frameNum == 0 is updated when the scanner file is first opened. It is also assumed that the entry in frameOfsets just before 'frameNum' is already properly updated.
Definition at line 1178 of file ScannerFile.cpp.
References CreateGoalie(), KKB::GoalKeeper::EndBlock(), goalie, and KKB::GoalKeeper::StartBlock().
|
inline |
|
protected |
Definition at line 1058 of file ScannerFile.cpp.
References KKB::KKStr::EqualIgnoreCase(), flatFieldEnabled, frameHeight, pixelsPerScanLine, scanRate, KKB::KKStr::ToBool(), KKB::KKStr::ToFloat(), KKB::KKStr::ToInt(), and KKB::KKStr::ToInt32().
Referenced by AddHeaderField(), and ReadHeader().
|
inlinevirtual |
Reimplemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, KKLSC::ScannerFileZLib3BitEncoded, and KKLSC::ScannerFileSimple.
Definition at line 78 of file ScannerFile.h.
References sfUnKnown.
Referenced by FileFormatStr(), and GetScannerFileParameters().
| KKStr ScannerFile::FileFormatStr | ( | ) | const |
Definition at line 953 of file ScannerFile.cpp.
References FileFormat(), and ScannerFileFormatToStr().
Referenced by WriteHeader().
|
inline |
Definition at line 92 of file ScannerFile.h.
References fileName.
Referenced by KKLSC::ScannerFileEntry::GetOrCreateScannerFileEntry().
|
inline |
When opening a existing file represents size of file in Bytes.
Definition at line 93 of file ScannerFile.h.
References fileSizeInBytes.
|
inline |
|
inline |
|
inline |
Definition at line 96 of file ScannerFile.h.
References flowMeterCounterScanLine.
|
virtual |
|
inline |
|
inline |
Definition at line 100 of file ScannerFile.h.
References frameBufferFileOffsetLast.
|
inline |
Definition at line 101 of file ScannerFile.h.
References frameBufferFileOffsetNext.
|
inline |
Definition at line 97 of file ScannerFile.h.
References frameHeight.
Referenced by GetScannerFileParameters().
|
inline |
| void ScannerFile::FrameRead | ( | kkuint32 | frameNum, |
| bool & | found | ||
| ) |
Read into frame buffer 'frameNum' and reposition so that next scan-line will be the 1st line in the frame.
The purpose of this method is to allow you to get whole frames at a time. Use the access method 'FrameBuffer' to get a pointer to the contents of the frame retrieved. The next call to 'GetNextLine' will return the first scan line in frame 'frameNum'.
Definition at line 500 of file ScannerFile.cpp.
References KKB::GoalKeeper::EndBlock(), frameBufferFileOffsetNext, frameBufferNextLine, frameBufferNumScanLines, frameHeight, frameNumCurLoaded, goalie, largestKnownScanLine, lastScanLine, nextScanLine, ReadBufferFrame(), KKB::GoalKeeper::StartBlock(), and UpdateFrameOffset().
Referenced by SkipToScanLine().
Definition at line 487 of file ScannerFile.cpp.
References KKB::GoalKeeper::EndBlock(), goalie, and KKB::GoalKeeper::StartBlock().
|
virtual |
Definition at line 542 of file ScannerFile.cpp.
References KKB::GoalKeeper::EndBlock(), eof, frameBuffer, frameBufferFileOffsetNext, frameBufferLastReadEof, frameBufferNextLine, frameBufferNumScanLines, frameHeight, frameNumCurLoaded, goalie, largestKnownScanLine, lastScanLine, nextScanLine, pixelsPerScanLine, ReadBufferFrame(), KKB::GoalKeeper::StartBlock(), and UpdateFrameOffset().
|
static |
Retrieves statistics for a specified Scanner File.
Will read the header information for the specified scanner file to retrieve parameters.
| [in] | _scannerFileName | Name of scanner file that you want to retrieve parameters for. |
| [out] | _headerFields | Copy of header fields from Scanner File; caller will own them and be responsible for deleting them; if != NULL upon call previous instance will be deleted. |
| [out] | _scannerFileFormat | Format of scanner file; ex: sf3BitEncoded. |
| [out] | _frameHeight | Frame height of source camera. |
| [out] | _frameWidth | Width in pixels of scanner file. |
| [out] | _scanRate | Scan lines/sec that imagery was acquired at. |
| [out] | _successful | Indicates if successful in retrieving parameters. |
| [in,out] | _log | Log file. |
Definition at line 754 of file ScannerFile.cpp.
References CreateScannerFile(), FileFormat(), FrameHeight(), HeaderFields(), PixelsPerScanLine(), KKLSC::ScannerHeaderFields::ScannerHeaderFields(), and ScanRate().
Definition at line 1107 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::EmptyStr(), KKLSC::ScannerHeaderFields::GetValue(), and headerFields.
| float ScannerFile::GetValueFloat | ( | const KKStr & | fieldName | ) |
Definition at line 1116 of file ScannerFile.cpp.
References KKLSC::ScannerHeaderFields::GetValueFloat(), and headerFields.
|
static |
Definition at line 729 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::EqualIgnoreCase(), KKB::KKStr::ExtractToken2(), KKB::KKStr::KKStr(), KKB::osFOPEN(), ReadHeaderOneLine(), ScannerFileFormatFromStr(), sfUnKnown, and KKB::KKStr::Str().
Referenced by CreateScannerFile().
|
inline |
Definition at line 102 of file ScannerFile.h.
References headerFields.
Referenced by GetScannerFileParameters().
| void ScannerFile::InitiateWritting | ( | ) |
Definition at line 976 of file ScannerFile.cpp.
References AddHeaderField(), byteOffsetScanLineZero, file, frameBufferFileOffsetLast, frameBufferFileOffsetNext, frameHeight, lastScanLine, nextScanLine, KKB::osFTELL(), pixelsPerScanLine, scanRate, KKB::StrFormatDouble(), KKB::StrFormatInt(), UpdateFrameOffset(), and WriteHeader().
|
inline |
Definition at line 103 of file ScannerFile.h.
|
inline |
|
inline |
Last Scan-line read or written.
Definition at line 105 of file ScannerFile.h.
References lastScanLine.
| void ScannerFile::LoadIndexFile | ( | bool & | successful | ) |
Call this method to Load the FrameOffsets and StartStop points from the index file.
This method is also called from 'BuildFrameOffsets',
Definition at line 1323 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), eof, KKB::KKStr::EqualIgnoreCase(), KKB::KKStr::ExtractToken2(), KKB::KKStr::ExtractTokenInt(), KKB::KKStr::ExtractTokenUint(), KKB::KKStr::ExtractTokenUint64(), fileName, indexFile, indexFileName, KKLSC::StartStopPoint::Invalid, largestKnownScanLine, KKB::KKStr::operator+(), KKB::KKStr::operator=(), KKB::osFOPEN(), KKB::osReadRestOfLine(), KKB::osRemoveExtension(), KKLSC::StartStopPoint::StartStopPoint(), KKB::KKStr::Str(), KKLSC::StartStopPoint::Type(), and UpdateFrameOffset().
Referenced by BuildFrameOffsets().
|
virtual |
Definition at line 177 of file ScannerFile.cpp.
References file, frameBuffer, frameBufferSize, headerFields, indexFile, KKLSC::ScannerHeaderFields::MemoryConsumedEstimated(), KKLSC::ScannerFileEntry::MemoryConsumedEstimated(), and scannerFileEntry.
|
inline |
|
protected |
Definition at line 265 of file ScannerFile.cpp.
References eof, file, fileName, fileSizeInBytes, indexFileName, ioMode, ioRead, opened, KKB::KKStr::operator+(), KKB::KKStr::operator=(), KKB::osFOPEN(), KKB::osGetFileSize(), KKB::osRemoveExtension(), and KKB::KKStr::Str().
Referenced by ScannerFile().
|
inline |
|
inline |
Definition at line 108 of file ScannerFile.h.
References pixelsPerScanLine.
Referenced by KKLSC::ScannerFileEntry::GetOrCreateScannerFileEntry(), and GetScannerFileParameters().
|
protectedpure virtual |
Read in one Scanner File Frame return number of actual scan-lines read.
Unless end of file is reached this method will read in 'framHeight' scan-lines.
Implemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, and KKLSC::ScannerFileSimple.
Referenced by FrameRead(), GetNextLine(), and SkipNextLine().
|
protected |
Definition at line 1037 of file ScannerFile.cpp.
References KKLSC::ScannerHeaderFields::Add(), KKB::KKStr::Concat(), ExtractHeaderField(), KKB::KKStr::ExtractToken2(), file, headerFields, KKB::KKStr::KKStr(), ReadHeaderOneLine(), and KKLSC::ScannerHeaderFields::ScannerHeaderFields().
Referenced by Reset(), and ScannerFile().
|
staticprotected |
Definition at line 1015 of file ScannerFile.cpp.
References KKB::KKStr::Append(), and KKB::KKStr::operator=().
Referenced by GuessFormatOfFile(), and ReadHeader().
| VectorFloatPtr ScannerFile::RecordRateByTimeIntervals | ( | int | intervalSecs | ) |
Returns an array indication the record rate in bytes/sec for specified time-intervals.
Each element in the returned array will give the average number of bytes recorded for the time the corresponding time interval. Array element 0 starts at the beginning of the Scanner file and covers the number of scan lines required to account for 'intervalSecs' seconds.
Definition at line 402 of file ScannerFile.cpp.
References frameHeight, and scanRate.
|
protected |
Definition at line 1152 of file ScannerFile.cpp.
References flowMeterCounter, flowMeterCounterScanLine, and KKB::WordFormat32Bits::unsigned32BitInt.
Referenced by ReportTextMsg().
|
protected |
Text messages that are embedded in a scanner file can be reported here.
If a derived class/format of 'ScannerFile' contains Text messages, that class would call this method with the embedded text message. Possible uses of this would be instrumentation data such as that produced by CTD.
Definition at line 1126 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::ExtractToken2(), KKB::KKStr::ExtractTokenInt(), KKB::KKStr::ExtractTokenUint(), KKB::KKStr::KKStr(), ReportInstrumentDataWord(), KKB::KKStr::StartsWith(), and KKB::WordFormat32Bits::WordFormat32Bits().
| void ScannerFile::Reset | ( | ) |
Definition at line 246 of file ScannerFile.cpp.
References eof, file, frameBufferFileOffsetLast, frameBufferFileOffsetNext, frameBufferLastReadEof, lastScanLine, nextScanLine, opened, KKB::osFTELL(), and ReadHeader().
|
protected |
Definition at line 1292 of file ScannerFile.cpp.
References fileName, indexFileName, KKB::KKStr::operator+(), KKB::KKStr::operator=(), and KKB::osRemoveExtension().
|
static |
Definition at line 961 of file ScannerFile.cpp.
References KKB::KKStr::EqualIgnoreCase(), fileFormatOptions, and sfUnKnown.
Referenced by CreateScannerFileForOutput(), and GuessFormatOfFile().
Definition at line 943 of file ScannerFile.cpp.
References fileFormatOptions, and sfUnKnown.
Referenced by FileFormatStr().
|
inline |
Definition at line 109 of file ScannerFile.h.
References scanRate.
Referenced by KKLSC::ScannerFileEntry::GetOrCreateScannerFileEntry(), and GetScannerFileParameters().
|
virtual |
Reimplemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, and KKLSC::ScannerFileZLib3BitEncoded.
Definition at line 238 of file ScannerFile.cpp.
References scanRate.
|
protected |
Definition at line 1398 of file ScannerFile.cpp.
| void ScannerFile::SkipNextLine | ( | ) |
Definition at line 615 of file ScannerFile.cpp.
References KKB::GoalKeeper::EndBlock(), eof, frameBufferFileOffsetNext, frameBufferLastReadEof, frameBufferNextLine, frameBufferNumScanLines, frameHeight, frameNumCurLoaded, goalie, largestKnownScanLine, lastScanLine, nextScanLine, ReadBufferFrame(), KKB::GoalKeeper::StartBlock(), and UpdateFrameOffset().
|
protectedpure virtual |
Skip to start of next frame returning back byte offset of that frame.
This will be called by the 'UpdateFrameOffset' and 'DetermineFrameOffsetForFrame' methods used to build the 'frameOffsets' table. It is important that the implementation of this method NOT update the frameBuffer fields; such as 'frameBuffer', 'frameBufferNextLine', etc .....
Implemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, and KKLSC::ScannerFileSimple.
Referenced by BuildFrameOffsets().
| void ScannerFile::SkipToScanLine | ( | kkint32 | scanLine | ) |
Repositions the file such that the next call to 'GetNextLine' returns the 'scanLine' scan-line.
This method depends on the table'frameOffsets'; it will compute the frame number from the scan line and use the appropriate entry in 'frameOffsets' to start reading from the beginning of the frame that contains 'scanLine'. If you select a 'scanLine' that is beyond the known number of scan lines in the scanner file (see largestKnownScanLine) the eof flag will be set to 'true'.
| [in] | scanLine | Scan line to skip to so that the next call to 'GetNextLine' retrieves it. |
Definition at line 682 of file ScannerFile.cpp.
References eof, frameBufferNextLine, frameBufferNumScanLines, frameHeight, frameNumCurLoaded, FrameRead(), lastScanLine, and nextScanLine.
| void ScannerFile::StartStopPointDelete | ( | kkint32 | _scanLineNum | ) |
Definition at line 371 of file ScannerFile.cpp.
References AddStartStopEntryToIndexFile(), and KKLSC::StartStopPoint::StopPoint.
| StartStopPointPtr ScannerFile::StartStopPointNearestEntry | ( | kkint32 | _scanLineNum | ) |
Definition at line 380 of file ScannerFile.cpp.
| StartStopPointPtr ScannerFile::StartStopPointPrevEntry | ( | kkint32 | _scanLineNum | ) |
Definition at line 387 of file ScannerFile.cpp.
|
inline |
Definition at line 134 of file ScannerFile.h.
| StartStopPointPtr ScannerFile::StartStopPointSuccEntry | ( | kkint32 | _scanLineNum | ) |
Definition at line 394 of file ScannerFile.cpp.
|
protected |
Definition at line 456 of file ScannerFile.cpp.
References CreateGoalie(), KKB::GoalKeeper::EndBlock(), goalie, and KKB::GoalKeeper::StartBlock().
Referenced by FrameRead(), GetNextLine(), InitiateWritting(), LoadIndexFile(), ScannerFile(), SkipNextLine(), and WriteScanLine().
|
protectedpure virtual |
Write the contents of 'frameBuffer' to he end of the scanner file.
Will write the entire contents of 'frameBuffer' to the end of the scanner file.
Implemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, and KKLSC::ScannerFileSimple.
Referenced by Close(), and WriteScanLine().
|
protected |
This method is called before any scanner data is added to the file. It will write the header information for the file.
Definition at line 993 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), FileFormatStr(), headerDataWritten, KKB::KKStr::KKStr(), and KKB::KKStr::operator=().
Referenced by InitiateWritting().
|
virtual |
Writes a 32 bit number into the Scanner File Stream at current location.
Adds Instrument data to the underlying Scanner files as text.
| [in] | idNum | nNumber that identifies Instrument data, ex: 0 is reserved for Flow Meter Count. |
| [in] | scanLineNum | Scan-line that 'dataWord' occurred at. |
| [in] | dataWord | 32 bit number being written. |
Definition at line 715 of file ScannerFile.cpp.
References KKB::KKStr::Concat(), KKB::KKStr::KKStr(), KKB::KKStr::Len(), KKB::KKStr::Str(), KKB::WordFormat32Bits::unsigned32BitInt, and WriteTextBlock().
Definition at line 657 of file ScannerFile.cpp.
References frameBufferFileOffsetNext, frameBufferNextLine, frameHeight, frameNumCurLoaded, lastScanLine, nextScanLine, pixelsPerScanLine, UpdateFrameOffset(), and WriteBufferFrame().
|
pure virtual |
Implemented in KKLSC::ScannerFile4BitEncoded, KKLSC::ScannerFile3BitEncoded, KKLSC::ScannerFile2BitEncoded, and KKLSC::ScannerFileZLib3BitEncoded.
Referenced by WriteInstrumentDataWord().
|
protected |
Byte offset of 1st scan line after the header fields.
Definition at line 392 of file ScannerFile.h.
Referenced by ByteOffsetScanLineZero(), InitiateWritting(), and ScannerFile().
|
protected |
Definition at line 393 of file ScannerFile.h.
Referenced by Eof(), GetNextLine(), LoadIndexFile(), Open(), Reset(), ScannerFile(), SkipNextLine(), and SkipToScanLine().
|
protected |
Definition at line 394 of file ScannerFile.h.
Referenced by BuildFrameOffsets(), Close(), Flush(), InitiateWritting(), MemoryConsumedEstimated(), Open(), KKLSC::ScannerFileSimple::ReadBufferFrame(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), ReadHeader(), Reset(), ScannerFile(), KKLSC::ScannerFileSimple::SkipToNextFrame(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), KKLSC::ScannerFileZLib3BitEncoded::WriteTextBlock(), KKLSC::ScannerFile2BitEncoded::WriteTextBlock(), KKLSC::ScannerFile3BitEncoded::WriteTextBlock(), and KKLSC::ScannerFile4BitEncoded::WriteTextBlock().
|
staticprotected |
Definition at line 363 of file ScannerFile.h.
Referenced by ScannerFileFormatFromStr(), and ScannerFileFormatToStr().
|
protected |
Definition at line 395 of file ScannerFile.h.
Referenced by CreateGoalie(), FileName(), LoadIndexFile(), Open(), SaveIndexFile(), and ScannerFile().
|
protected |
Definition at line 396 of file ScannerFile.h.
Referenced by FileSizeInBytes(), Open(), ScannerFile(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), KKLSC::ScannerFileZLib3BitEncoded::WriteTextBlock(), KKLSC::ScannerFile2BitEncoded::WriteTextBlock(), KKLSC::ScannerFile3BitEncoded::WriteTextBlock(), and KKLSC::ScannerFile4BitEncoded::WriteTextBlock().
|
protected |
Indicates if Flat-Field-Correction was enabled when file recorded.
Definition at line 397 of file ScannerFile.h.
Referenced by ExtractHeaderField(), FlatFieldEnabled(), and ScannerFile().
|
protected |
Updated while reading Scanner Files; whenever InstrumentID == 0 is read this field will be updated along with 'flowMeterCounterScanLineNum'.
Definition at line 412 of file ScannerFile.h.
Referenced by FlowMeterCounter(), ReportInstrumentDataWord(), and ScannerFile().
|
protected |
Represents the scan line that 'flowMeterCounter' was last updated for while reading a Scanner File.
Definition at line 416 of file ScannerFile.h.
Referenced by FlowMeterCounterScanLine(), ReportInstrumentDataWord(), and ScannerFile().
|
protected |
Raw scanner data will be stored here; for both reading and writing on scanner * file frame data. The frame of the scanner file is not the same as a frame from * the camera. *
Definition at line 422 of file ScannerFile.h.
Referenced by AllocateFrameBuffer(), FrameBuffer(), GetNextLine(), MemoryConsumedEstimated(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), ScannerFile(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), and ~ScannerFile().
|
protected |
The byte-offset that the last frameBuffer read or written to starts at.
Definition at line 427 of file ScannerFile.h.
Referenced by FrameBufferFileOffsetLast(), InitiateWritting(), KKLSC::ScannerFileSimple::ReadBufferFrame(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), Reset(), ScannerFile(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), and KKLSC::ScannerFile4BitEncoded::WriteBufferFrame().
|
protected |
The byte-offset of the next frameBuffer to be read or written
Definition at line 429 of file ScannerFile.h.
Referenced by FrameBufferFileOffsetNext(), FrameRead(), GetNextLine(), InitiateWritting(), KKLSC::ScannerFileSimple::ReadBufferFrame(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), Reset(), ScannerFile(), SkipNextLine(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), and WriteScanLine().
|
protected |
Indicates that the last call to 'ReadBufferFrame' encountered * feof (file) which means the next call to 'ReadBufferFrame' should return eof. *
Definition at line 431 of file ScannerFile.h.
Referenced by GetNextLine(), Reset(), ScannerFile(), and SkipNextLine().
|
protected |
Represents the number of bytes being used in 'frameBuffer'; when data is being * read from a Scanner file you would start reading from this point in the buffer and * while data is be written it will be added to 'frameBuffer' and this variable will * be incremented to reflect the new amount occupied. *
Definition at line 435 of file ScannerFile.h.
Referenced by AllocateFrameBuffer(), KKLSC::ScannerFileSimple::ReadBufferFrame(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), and ScannerFile().
|
protected |
Next scan-line in 'frameBuffer' to either read or write; used to compute the * byte offset into the buffer. *
Definition at line 441 of file ScannerFile.h.
Referenced by Close(), FrameRead(), GetNextLine(), KKLSC::ScannerFileSimple::ReadBufferFrame(), KKLSC::ScannerFile2BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile3BitEncoded::ReadBufferFrame(), KKLSC::ScannerFile4BitEncoded::ReadBufferFrame(), ScannerFile(), SkipNextLine(), SkipToScanLine(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), and WriteScanLine().
|
protected |
The Number of scan-lines that the last call to 'ReadBufferFrame' read.
Definition at line 445 of file ScannerFile.h.
Referenced by FrameRead(), GetNextLine(), ScannerFile(), SkipNextLine(), and SkipToScanLine().
|
protected |
The number of bytes that were allocated to 'frameBuffer'; 'frameBufferLen' * should never exceed this value. *
Definition at line 447 of file ScannerFile.h.
Referenced by AllocateFrameBuffer(), MemoryConsumedEstimated(), ScannerFile(), KKLSC::ScannerFileSimple::SkipToNextFrame(), and KKLSC::ScannerFileSimple::WriteBufferFrame().
|
protected |
Represents the number of scam lines per frame; as stored in the Scanner File.
Definition at line 398 of file ScannerFile.h.
Referenced by AllocateFrameBuffer(), BuildFrameOffsets(), ExtractHeaderField(), FrameHeight(), FrameRead(), GetNextLine(), InitiateWritting(), RecordRateByTimeIntervals(), ScannerFile(), SkipNextLine(), SkipToScanLine(), and WriteScanLine().
|
protected |
Indicates the frame that is currently loaded in 'frameBuffer'.
Definition at line 451 of file ScannerFile.h.
Referenced by FrameRead(), GetNextLine(), ScannerFile(), SkipNextLine(), SkipToScanLine(), and WriteScanLine().
|
protected |
Will maintain a list of byte offsets; each entry will be the byte offset for * its corresponding frame *
Definition at line 454 of file ScannerFile.h.
|
protected |
Definition at line 457 of file ScannerFile.h.
Referenced by BuildFrameOffsets(), BuildFrameOffsetsRunning(), and ScannerFile().
|
protected |
Indicates if the entire scannerFile has been scanned and all entries in * frameOffsets are updated. Can only be set to 'true' upon successful completion * of 'BuildFrameOffsets'. *
Definition at line 459 of file ScannerFile.h.
Referenced by BuildFrameOffsets(), FrameOffsetsLoaded(), and ScannerFile().
|
protected |
Used to control access to the buildFrameIndex table.
Definition at line 464 of file ScannerFile.h.
Referenced by AddStartStopEntryToIndexFile(), BuildFrameOffsets(), CreateGoalie(), DetermineFrameOffsetForFrame(), FrameRead(), GetFrameOffset(), GetNextLine(), ScannerFile(), SkipNextLine(), UpdateFrameOffset(), and ~ScannerFile().
|
protected |
Sets to true after all Header data has been written.
Definition at line 399 of file ScannerFile.h.
Referenced by ScannerFile(), and WriteHeader().
|
protected |
Definition at line 400 of file ScannerFile.h.
Referenced by AddHeaderField(), GetValue(), GetValueFloat(), HeaderFields(), MemoryConsumedEstimated(), ReadHeader(), ScannerFile(), and ~ScannerFile().
|
protected |
When writing a Scanner file will also write out a ByteOffset index file to aid future access to this file.
Definition at line 466 of file ScannerFile.h.
Referenced by AddStartStopEntryToIndexFile(), Close(), LoadIndexFile(), MemoryConsumedEstimated(), and ScannerFile().
|
protected |
Definition at line 469 of file ScannerFile.h.
Referenced by AddStartStopEntryToIndexFile(), LoadIndexFile(), Open(), SaveIndexFile(), and ScannerFile().
|
protected |
Definition at line 401 of file ScannerFile.h.
Referenced by Close(), Open(), and ScannerFile().
|
protected |
Definition at line 402 of file ScannerFile.h.
Referenced by BuildFrameOffsets(), FrameRead(), GetNextLine(), LargestKnownScanLine(), LoadIndexFile(), ScannerFile(), and SkipNextLine().
|
protected |
The last scan-line read.
Definition at line 403 of file ScannerFile.h.
Referenced by FrameRead(), GetNextLine(), InitiateWritting(), LastScanLine(), Reset(), ScannerFile(), SkipNextLine(), SkipToScanLine(), and WriteScanLine().
|
protected |
Definition at line 404 of file ScannerFile.h.
Referenced by ScannerFile().
|
protected |
The next scan-line that will be returned by 'GetNextLine'.
Definition at line 405 of file ScannerFile.h.
Referenced by FrameRead(), GetNextLine(), InitiateWritting(), NextScanLine(), Reset(), ScannerFile(), SkipNextLine(), SkipToScanLine(), and WriteScanLine().
|
protected |
Definition at line 406 of file ScannerFile.h.
Referenced by Close(), Open(), Opened(), Reset(), ScannerFile(), and ~ScannerFile().
|
protected |
Definition at line 407 of file ScannerFile.h.
Referenced by AllocateFrameBuffer(), ExtractHeaderField(), GetNextLine(), InitiateWritting(), PixelsPerScanLine(), KKLSC::ScannerFileSimple::ReadBufferFrame(), ScannerFile(), KKLSC::ScannerFile2BitEncoded::SkipToNextFrame(), KKLSC::ScannerFile3BitEncoded::SkipToNextFrame(), KKLSC::ScannerFile4BitEncoded::SkipToNextFrame(), KKLSC::ScannerFileSimple::WriteBufferFrame(), KKLSC::ScannerFile2BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile3BitEncoded::WriteBufferFrame(), KKLSC::ScannerFile4BitEncoded::WriteBufferFrame(), and WriteScanLine().
|
protected |
Definition at line 471 of file ScannerFile.h.
Referenced by MemoryConsumedEstimated(), and ScannerFile().
|
protected |
Scan-Lines Per Second.
Definition at line 408 of file ScannerFile.h.
Referenced by ExtractHeaderField(), InitiateWritting(), RecordRateByTimeIntervals(), ScannerFile(), and ScanRate().
|
protected |
Points where he user does or does-not want to process(Count) are tacked in this data structure. Each entry is flagged as a Start or Stop point. These entries are saved in the IndexFile along with the frame offsets table.
Definition at line 474 of file ScannerFile.h.