KSquare Utilities
KKLSC::ScannerFrame Class Reference

Used to buffer one Frame of Scanner Data for use by 'ScannerFileBuffered'. More...

#include <ScannerFrame.h>

Public Types

typedef ScannerFrameScannerFramePtr
 

Public Member Functions

 ScannerFrame (ScannerClockPtr _clock, kkint32 _scanLinesPerFrame, kkint32 _pixelsPerScanLine)
 Construct a frame with the dimensions (Height = _scanLinesPerFrame) and (Width = _pixelsPerScanLine). More...
 
 ~ScannerFrame ()
 
kkint32 FrameNum () const
 
void FrameNum (kkint32 _frameNum)
 
kkint32 ScanLineFirst () const
 
void ScanLineFirst (kkint32 _scanLineFirst)
 
kkint32 ScanLineLast () const
 
void ScanLineLast (kkint32 _scanLineLast)
 
uchar ** ScanLines ()
 
void ScanLines (uchar **_scanLines)
 
kkint32 Time () const
 
void Time (kkint32 _time)
 

Detailed Description

Used to buffer one Frame of Scanner Data for use by 'ScannerFileBuffered'.

Each access to 'ScanLines' will cause the 'time' variable to increment by one. This will allow the 'ScannerFleBufered' class know how old its Buffered frames are. With this knowledge it will be able to keep the more currently accessed frames in memory.

Definition at line 16 of file ScannerFrame.h.

Member Typedef Documentation

Constructor & Destructor Documentation

ScannerFrame::ScannerFrame ( ScannerClockPtr  _clock,
kkint32  _scanLinesPerFrame,
kkint32  _pixelsPerScanLine 
)

Construct a frame with the dimensions (Height = _scanLinesPerFrame) and (Width = _pixelsPerScanLine).

Parameters
[in]_clockA ScannerClock instance that is shared by all instances of 'ScannerFrame' that are used by the same instance of 'ScannerFleBuffered'.
[in]_scanLinesPerFrameHeight of the frame.
[in]_pixelsPerScanLineWidth of the frame.

Definition at line 15 of file ScannerFrame.cpp.

18  :
19 
20  clock (_clock),
21  frameNum (-1),
22  height (_scanLinesPerFrame),
23  scanLines (NULL),
24  scanLineFirst (-1),
25  scanLineLast (-1),
26  time (0),
27  width (_pixelsPerScanLine)
28 
29 {
30  clock = _clock;
31  scanLines = AllocateFrameArray ();
32 }
ScannerFrame::~ScannerFrame ( )

Definition at line 35 of file ScannerFrame.cpp.

36 {
37  if (scanLines)
38  {
39  for (kkint32 x = 0; x < height; ++x)
40  {
41  delete scanLines[x];
42  scanLines[x] = NULL;
43  }
44  }
45 
46  delete scanLines;
47  scanLines = NULL;
48 }
__int32 kkint32
Definition: KKBaseTypes.h:88

Member Function Documentation

kkint32 KKLSC::ScannerFrame::FrameNum ( ) const
inline

Definition at line 35 of file ScannerFrame.h.

35 {return frameNum;}
void KKLSC::ScannerFrame::FrameNum ( kkint32  _frameNum)
inline

Definition at line 42 of file ScannerFrame.h.

42 {frameNum = _frameNum;}
kkint32 KKLSC::ScannerFrame::ScanLineFirst ( ) const
inline

Definition at line 37 of file ScannerFrame.h.

37 {return scanLineFirst;}
void KKLSC::ScannerFrame::ScanLineFirst ( kkint32  _scanLineFirst)
inline

Definition at line 44 of file ScannerFrame.h.

44 {scanLineFirst = _scanLineFirst;}
kkint32 KKLSC::ScannerFrame::ScanLineLast ( ) const
inline

Definition at line 38 of file ScannerFrame.h.

38 {return scanLineLast;}
void KKLSC::ScannerFrame::ScanLineLast ( kkint32  _scanLineLast)
inline

Definition at line 45 of file ScannerFrame.h.

45 {scanLineLast = _scanLineLast;}
uchar ** ScannerFrame::ScanLines ( )

Will return scan-lines and increment 'time' by one.

Definition at line 62 of file ScannerFrame.cpp.

References KKLSC::ScannerClock::Time().

63 {
64  time = clock->Time ();
65  return scanLines;
66 }
kkint32 Time()
Returns the current value of &#39;time&#39; them increments by 1.
void ScannerFrame::ScanLines ( uchar **  _scanLines)

Definition at line 70 of file ScannerFrame.cpp.

References KKLSC::ScannerClock::Time().

71 {
72  time = clock->Time ();
73  scanLines = _scanLines;
74 }
kkint32 Time()
Returns the current value of &#39;time&#39; them increments by 1.
kkint32 KKLSC::ScannerFrame::Time ( ) const
inline

The higher 'time' the more recently this frame has been accessed.

Definition at line 39 of file ScannerFrame.h.

void KKLSC::ScannerFrame::Time ( kkint32  _time)
inline

Definition at line 46 of file ScannerFrame.h.

46 {time = _time;}

The documentation for this class was generated from the following files: