Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

clFrameBuf Class Reference

Framebuffer class. More...

#include <FrameBuf.hh>

Inheritance diagram for clFrameBuf:

Inheritance graph
[legend]
Collaboration diagram for clFrameBuf:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 clFrameBuf ()
 ~clFrameBuf ()
void SetSize (int, int)
 Set size of framebuffer.

void Clear ()
 Clear framebuffer.

unsigned int * GetFBPtr ()
 Get pointer to raw framebuffer.

unsigned int * GetPalPtr ()
 Get pointer to palette buffer.

guchar * GetCurPtr (int, int)
 Get pointer to current position in doublebuffered framebuffer.

gint GetRowStride ()
 Get row stride.

int GetNumColors ()
 Get number of colors in palette LUT.

int GetWidth ()
 Get width of framebuffer.

int GetHeight ()
 Get height of framebuffer.

void DrawLine (unsigned int *)
 Draw line to vertically scrolling graph.

void DrawLine (GDT *)
void DrawColumn (unsigned int *)
 Draw column to horizontally scrolling graph.

void DrawColumn (GDT *)
unsigned int operator[] (int iPix)
 Get single pixel from framebuffer.

void PalGenBW ()
 Generate white-to-black palette.

void PalGenHSV ()
 Generate black-blue-cyan-green-yellow-red palette.

void PalGenLight ()
 Generate palette matching to light's spectrum.

void PalGenTemp ()
 Generate black-red-yellow-white palette.

void PalGenDir ()
 Generate black-white palette with two highest values red.

void PalGenGreen ()
 Generate black-green-red palette.

void PalGenGreen2 ()
 Generate black-green-white palette.

void PalGenGreen3 ()
 Generate black-green-yellow palette.

void PalGenGreen4 ()
 Generate black-green-red-yellow palette.

void PalGenPureGreen ()
 Generate black-green palette.

void PalGenWB ()
 Generate black-white palette.

bool SaveToFile (const char *, int, int, const char *)
 Save current framebuffer contents to TIFF file.

bool SaveToFile (const char *, int, int, const char *, double, double, double, double)
bool StartSaveToFile (const char *, int, int, const char *, int)
 Start continuous save to TIFF file.

void StopSaveToFile ()
 Stop continuous save to TIFF file.


Private Member Functions

void RGBA2RGB (unsigned char *, const unsigned int *, int, int, int, int, int, int)
bool SetTiffTags (const char *, int, int, const char *, int, int, int)
bool WriteTiffData ()
bool WriteTiffData (int, int, double, double, double, double)
bool WriteTiffScanData ()
void DrawHLine (unsigned char *, int, int, int, int, int)
void DrawVLine (unsigned char *, int, int, int, int, int)
bool DrawText (unsigned char *, int, int, int, int, const char *)

Private Attributes

bool bSaving
int iType
int iWidth
int iHeight
int iCurPos
int iPixFontSize
int iMaxFontWidth
char cpDateTime [FB_TIFF_DATELEN+1]
unsigned int * upFrameBuf
uint32 * upScanBuf
uint32 uiStripSize
tstrip_t uiContStrip
TIFF * tiffImg
FT_Library ftLib
FT_Face ftFace
clAlloc FrameBuf
clAlloc ScanBuf

Detailed Description

Framebuffer class.

Framebuffer class for vertically or horizontally scrolling intensity graph. Capable of saving contents to tiff and also continuous saving. Uses doublebuffering for speed.

Dataformat is 32-bit BGRA (0xAABBGGRR).

Definition at line 87 of file FrameBuf.hh.


Constructor & Destructor Documentation

clFrameBuf::clFrameBuf  ) 
 

Definition at line 393 of file FrameBuf.cc.

References bSaving, FB_TIFF_FONTSIZE, FB_TIFF_RESOLUTION, FB_TYPE_NONE, ftFace, ftLib, iCurPos, iHeight, iMaxFontWidth, iPixFontSize, iType, iWidth, upFrameBuf, and upScanBuf.

clFrameBuf::~clFrameBuf  ) 
 

Definition at line 430 of file FrameBuf.cc.

References bSaving, ftFace, ftLib, and StopSaveToFile().


Member Function Documentation

void clFrameBuf::RGBA2RGB unsigned char *  ,
const unsigned int *  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int 
[private]
 

Definition at line 39 of file FrameBuf.cc.

Referenced by WriteTiffData(), and WriteTiffScanData().

bool clFrameBuf::SetTiffTags const char *  ,
int  ,
int  ,
const char *  ,
int  ,
int  ,
int 
[private]
 

Definition at line 65 of file FrameBuf.cc.

References cpDateTime, FB_TIFF_COMPRESS_JPEG, FB_TIFF_CONT_HORIZONTAL, FB_TIFF_CONT_NO, FB_TIFF_CONT_VERTICAL, FB_TIFF_DATELEN, FB_TIFF_RESOLUTION, GLOBAL_VERSMAJ, GLOBAL_VERSMIN, GLOBAL_VERSPL, tiffImg, and uiStripSize.

Referenced by SaveToFile(), and StartSaveToFile().

bool clFrameBuf::WriteTiffData  )  [private]
 

Definition at line 165 of file FrameBuf.cc.

References GetCurPtr(), iHeight, iWidth, RGBA2RGB(), tiffImg, and uiStripSize.

Referenced by SaveToFile().

bool clFrameBuf::WriteTiffData int  ,
int  ,
double  ,
double  ,
double  ,
double 
[private]
 

Definition at line 206 of file FrameBuf.cc.

References cpDateTime, DrawHLine(), DrawText(), DrawVLine(), GetCurPtr(), iHeight, iMaxFontWidth, iPixFontSize, iWidth, RGBA2RGB(), tiffImg, and uiStripSize.

bool clFrameBuf::WriteTiffScanData  )  [private]
 

Definition at line 287 of file FrameBuf.cc.

References iWidth, RGBA2RGB(), tiffImg, uiContStrip, and upScanBuf.

Referenced by DrawColumn(), and DrawLine().

void clFrameBuf::DrawHLine unsigned char *  ,
int  ,
int  ,
int  ,
int  ,
int 
[private]
 

Definition at line 308 of file FrameBuf.cc.

Referenced by WriteTiffData().

void clFrameBuf::DrawVLine unsigned char *  ,
int  ,
int  ,
int  ,
int  ,
int 
[private]
 

Definition at line 324 of file FrameBuf.cc.

Referenced by WriteTiffData().

bool clFrameBuf::DrawText unsigned char *  ,
int  ,
int  ,
int  ,
int  ,
const char * 
[private]
 

Definition at line 341 of file FrameBuf.cc.

References FB_TIFF_RESOLUTION, ftFace, and iPixFontSize.

Referenced by WriteTiffData().

void clFrameBuf::SetSize int  ,
int 
 

Set size of framebuffer.

Resize is non-destructive.

Parameters:
iReqWidth Width
iReqHeight Height

Definition at line 438 of file FrameBuf.cc.

References FB_TYPE_COLUMN, FB_TYPE_LINE, FB_TYPE_NONE, FrameBuf, iCurPos, iHeight, iType, iWidth, ScanBuf, upFrameBuf, and upScanBuf.

Referenced by clSpectGUI::Build(), clGUILofar::Configure(), clGUILofar::Exec(), clGUIDir::Exec(), clGUIDir::InitConnection(), and clSpectGUI::ReConfigDisplay().

void clFrameBuf::Clear  ) 
 

Clear framebuffer.

Definition at line 467 of file FrameBuf.cc.

References iHeight, iWidth, and upFrameBuf.

Referenced by clGUILofar::Exec(), and clGUIDir::Exec().

unsigned int* clFrameBuf::GetFBPtr  )  [inline]
 

Get pointer to raw framebuffer.

Returns:
Pointer to raw framebuffer

Definition at line 137 of file FrameBuf.hh.

References upFrameBuf.

Referenced by clSpectGUI::Build().

unsigned int* clFrameBuf::GetPalPtr  )  [inline]
 

Get pointer to palette buffer.

Returns:
Pointer to palette LUT

Definition at line 143 of file FrameBuf.hh.

References clPalette::upPalette.

Referenced by clSpectGUI::Build().

guchar * clFrameBuf::GetCurPtr int  ,
int 
 

Get pointer to current position in doublebuffered framebuffer.

Parameters:
iXPos X position offset
iYPos Y position offset
Returns:
Pointer to framebuffer position

Definition at line 480 of file FrameBuf.cc.

References FB_TYPE_COLUMN, FB_TYPE_LINE, iCurPos, iType, iWidth, and upFrameBuf.

Referenced by clSpectGUI::DrawSpectrogram(), clGUIDir::InitConnection(), clGUILofar::OnExposeLofar(), clSpectGUI::OnExposeSgram(), clGUIDir::OnExposeWorm(), clGUILofar::OnGdkInput(), clGUIDir::OnGdkInput(), and WriteTiffData().

gint clFrameBuf::GetRowStride  )  [inline]
 

Get row stride.

Get size of scanline in bytes. For use with gdk_rgb_*

Returns:
Size of scanline

Definition at line 159 of file FrameBuf.hh.

References iWidth.

Referenced by clSpectGUI::DrawSpectrogram(), clGUIDir::InitConnection(), clGUILofar::OnExposeLofar(), clSpectGUI::OnExposeSgram(), clGUIDir::OnExposeWorm(), clGUILofar::OnGdkInput(), and clGUIDir::OnGdkInput().

int clFrameBuf::GetNumColors  )  [inline]
 

Get number of colors in palette LUT.

Returns:
Number of colors

Definition at line 165 of file FrameBuf.hh.

References clPalette::iPalSize.

Referenced by clSpectGUI::Build().

int clFrameBuf::GetWidth  )  [inline]
 

Get width of framebuffer.

Returns:
Width of framebuffer

Definition at line 171 of file FrameBuf.hh.

References iWidth.

int clFrameBuf::GetHeight  )  [inline]
 

Get height of framebuffer.

Returns:
Height of framebuffer

Definition at line 177 of file FrameBuf.hh.

References iHeight.

Referenced by clGUILofar::OnSaveClicks(), and clGUIDir::OnSaveClicks().

void clFrameBuf::DrawLine unsigned int *   ) 
 

Draw line to vertically scrolling graph.

Scroll graph down and draw new scanline to top. Indexes to palette LUT as parameter.

Parameters:
upLineBuf Scanline LUT indexes

Definition at line 498 of file FrameBuf.cc.

References bSaving, FB_TYPE_LINE, iCurPos, iHeight, iType, iWidth, upFrameBuf, clPalette::upPalette, upScanBuf, and WriteTiffScanData().

Referenced by clGUILofar::OnGdkInput(), and clGUIDir::OnGdkInput().

void clFrameBuf::DrawLine GDT *   ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
fpDataBuf Normalized data values [0..1]

Definition at line 524 of file FrameBuf.cc.

References bSaving, FB_TYPE_LINE, GDT, iCurPos, iHeight, clPalette::iPalSize, iType, iWidth, upFrameBuf, clPalette::upPalette, upScanBuf, and WriteTiffScanData().

void clFrameBuf::DrawColumn unsigned int *   ) 
 

Draw column to horizontally scrolling graph.

Scroll graph left and draw new column to right. Indexes to palette LUT as parameter.

Parameters:
upColumnBuf Column LUT indexes

Definition at line 555 of file FrameBuf.cc.

References bSaving, FB_TYPE_COLUMN, iCurPos, iHeight, iType, iWidth, upFrameBuf, clPalette::upPalette, upScanBuf, and WriteTiffScanData().

Referenced by clSpectGUI::DrawSpectrogram().

void clFrameBuf::DrawColumn GDT *   ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
fpDataBuf Normalized data values [0..1]

Definition at line 581 of file FrameBuf.cc.

References bSaving, FB_TYPE_COLUMN, GDT, iCurPos, iHeight, clPalette::iPalSize, iType, iWidth, upFrameBuf, clPalette::upPalette, upScanBuf, and WriteTiffScanData().

unsigned int clFrameBuf::operator[] int  iPix  )  [inline]
 

Get single pixel from framebuffer.

Returns:
Pixel value

Reimplemented from clPalette.

Definition at line 211 of file FrameBuf.hh.

References upFrameBuf.

void clFrameBuf::PalGenBW  )  [inline]
 

Generate white-to-black palette.

Definition at line 216 of file FrameBuf.hh.

References clPalette::GenBW().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenHSV  )  [inline]
 

Generate black-blue-cyan-green-yellow-red palette.

Definition at line 220 of file FrameBuf.hh.

References clPalette::GenHSV().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenLight  )  [inline]
 

Generate palette matching to light's spectrum.

Definition at line 224 of file FrameBuf.hh.

References clPalette::GenLight().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenTemp  )  [inline]
 

Generate black-red-yellow-white palette.

Definition at line 228 of file FrameBuf.hh.

References clPalette::GenTemp().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenDir  )  [inline]
 

Generate black-white palette with two highest values red.

Definition at line 232 of file FrameBuf.hh.

References clPalette::GenDir().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenGreen  )  [inline]
 

Generate black-green-red palette.

"NATO-style"

Definition at line 236 of file FrameBuf.hh.

References clPalette::GenGreen().

Referenced by clSpectGUI::BuildDrawingPrims(), clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenGreen2  )  [inline]
 

Generate black-green-white palette.

Definition at line 240 of file FrameBuf.hh.

References clPalette::GenGreen2().

Referenced by clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenGreen3  )  [inline]
 

Generate black-green-yellow palette.

Definition at line 244 of file FrameBuf.hh.

References clPalette::GenGreen3().

Referenced by clGUILofar::SetPalette().

void clFrameBuf::PalGenGreen4  )  [inline]
 

Generate black-green-red-yellow palette.

Definition at line 248 of file FrameBuf.hh.

References clPalette::GenGreen4().

Referenced by clGUILofar::SetPalette().

void clFrameBuf::PalGenPureGreen  )  [inline]
 

Generate black-green palette.

Definition at line 252 of file FrameBuf.hh.

References clPalette::GenPureGreen().

Referenced by clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

void clFrameBuf::PalGenWB  )  [inline]
 

Generate black-white palette.

Definition at line 256 of file FrameBuf.hh.

References clPalette::GenWB().

Referenced by clGUIDir::BuildDrawingPrims(), clSpectGUI::OnPaletteActivate(), clGUIDir::OnPaletteActivate(), and clGUILofar::SetPalette().

bool clFrameBuf::SaveToFile const char *  ,
int  ,
int  ,
const char * 
 

Save current framebuffer contents to TIFF file.

Parameters:
cpFileName Name of TIFF file
iCompression TIFF CODEC
iJPEGQuality Quality for JPEG CODEC
cpDescription Description
dXMin X-axis minimum
dXMax X-axis maximum
dYMin Y-axis minimum
dYMax Y-axis maximum
Returns:
Success

Definition at line 612 of file FrameBuf.cc.

References bSaving, FB_TIFF_CONT_NO, FB_TIFF_MODE, iHeight, iWidth, SetTiffTags(), tiffImg, and WriteTiffData().

Referenced by clSpectGUI::OnSaveClicks(), clGUILofar::OnSaveClicks(), and clGUIDir::OnSaveClicks().

bool clFrameBuf::SaveToFile const char *  ,
int  ,
int  ,
const char *  ,
double  ,
double  ,
double  ,
double 
 

Definition at line 632 of file FrameBuf.cc.

References bSaving, FB_TIFF_CONT_NO, FB_TIFF_MODE, iHeight, iMaxFontWidth, iPixFontSize, iWidth, SetTiffTags(), tiffImg, and WriteTiffData().

bool clFrameBuf::StartSaveToFile const char *  ,
int  ,
int  ,
const char *  ,
int 
 

Start continuous save to TIFF file.

All new data is saved to TIFF until saving is stopped.

Parameters:
cpFileName Name of TIFF file
iCompression TIFF CODEC
iJPEGQuality Quality for JPEG CODEC
cpDescription Description
iDirection Drawing direction
Returns:
Success

Definition at line 660 of file FrameBuf.cc.

References bSaving, FB_TIFF_MODE, iHeight, iWidth, SetTiffTags(), tiffImg, and uiContStrip.

Referenced by clGUILofar::OnSaveClicks(), clGUIDir::OnSaveClicks(), clGUILofar::StartNewImgFile(), and clGUIDir::StartNewImgFile().

void clFrameBuf::StopSaveToFile  ) 
 

Stop continuous save to TIFF file.

Definition at line 676 of file FrameBuf.cc.

References bSaving, and tiffImg.

Referenced by clGUILofar::OnDelete(), clGUIDir::OnDelete(), clGUILofar::OnSaveClicks(), clGUIDir::OnSaveClicks(), clGUILofar::StartNewImgFile(), clGUIDir::StartNewImgFile(), and ~clFrameBuf().


Member Data Documentation

bool clFrameBuf::bSaving [private]
 

Definition at line 89 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawColumn(), DrawLine(), SaveToFile(), StartSaveToFile(), StopSaveToFile(), and ~clFrameBuf().

int clFrameBuf::iType [private]
 

Definition at line 90 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawColumn(), DrawLine(), GetCurPtr(), and SetSize().

int clFrameBuf::iWidth [private]
 

Definition at line 91 of file FrameBuf.hh.

Referenced by Clear(), clFrameBuf(), DrawColumn(), DrawLine(), GetCurPtr(), GetRowStride(), GetWidth(), SaveToFile(), SetSize(), StartSaveToFile(), WriteTiffData(), and WriteTiffScanData().

int clFrameBuf::iHeight [private]
 

Definition at line 92 of file FrameBuf.hh.

Referenced by Clear(), clFrameBuf(), DrawColumn(), DrawLine(), GetHeight(), SaveToFile(), SetSize(), StartSaveToFile(), and WriteTiffData().

int clFrameBuf::iCurPos [private]
 

Definition at line 93 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawColumn(), DrawLine(), GetCurPtr(), and SetSize().

int clFrameBuf::iPixFontSize [private]
 

Definition at line 94 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawText(), SaveToFile(), and WriteTiffData().

int clFrameBuf::iMaxFontWidth [private]
 

Definition at line 95 of file FrameBuf.hh.

Referenced by clFrameBuf(), SaveToFile(), and WriteTiffData().

char clFrameBuf::cpDateTime[FB_TIFF_DATELEN + 1] [private]
 

Definition at line 96 of file FrameBuf.hh.

Referenced by SetTiffTags(), and WriteTiffData().

unsigned int* clFrameBuf::upFrameBuf [private]
 

Definition at line 97 of file FrameBuf.hh.

Referenced by Clear(), clFrameBuf(), DrawColumn(), DrawLine(), GetCurPtr(), GetFBPtr(), operator[](), and SetSize().

uint32* clFrameBuf::upScanBuf [private]
 

Definition at line 98 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawColumn(), DrawLine(), SetSize(), and WriteTiffScanData().

uint32 clFrameBuf::uiStripSize [private]
 

Definition at line 99 of file FrameBuf.hh.

Referenced by SetTiffTags(), and WriteTiffData().

tstrip_t clFrameBuf::uiContStrip [private]
 

Definition at line 100 of file FrameBuf.hh.

Referenced by StartSaveToFile(), and WriteTiffScanData().

TIFF* clFrameBuf::tiffImg [private]
 

Definition at line 101 of file FrameBuf.hh.

Referenced by SaveToFile(), SetTiffTags(), StartSaveToFile(), StopSaveToFile(), WriteTiffData(), and WriteTiffScanData().

FT_Library clFrameBuf::ftLib [private]
 

Definition at line 102 of file FrameBuf.hh.

Referenced by clFrameBuf(), and ~clFrameBuf().

FT_Face clFrameBuf::ftFace [private]
 

Definition at line 103 of file FrameBuf.hh.

Referenced by clFrameBuf(), DrawText(), and ~clFrameBuf().

clAlloc clFrameBuf::FrameBuf [private]
 

Definition at line 104 of file FrameBuf.hh.

Referenced by SetSize().

clAlloc clFrameBuf::ScanBuf [private]
 

Definition at line 105 of file FrameBuf.hh.

Referenced by SetSize().


The documentation for this class was generated from the following files:
Generated on Sun Oct 26 19:12:18 2003 for HASAS by doxygen 1.3.3