Logo Search packages:      
Sourcecode: camstream version File versions  Download package

CCamPanel Class Reference

Inheritance diagram for CCamPanel:

CBasicPanel CDCTPanel CDeltaPanel CDiffPanel CImagePanelRGB CImagePanelYUV CIntgPanel CRGBShow

List of all members.

Detailed Description

Abstract class for panels, visual representations of various stages in the image processing.

The process from image to (compressed) datastream is a long one, involving a number of steps. A CamPanel is used to hold data for a step, and if possible draw a graphical representation on the screen (this is great for debugging, but also produces some pretty pictures :)).

A CamPanel can show something as simple as the RGB image retrieved from the video device, or the DCT-ized version of the differential motion-compensated YUV image. Whatever is shown, it needs to be represented in a uniform manner through a decent base class.

CamPanels are handled by CamWidget: a CamPanel registers itself with CamWidget; this class determines which panels should be shown (depending on flags and user settings), arranges them on the screen and gives the command to draw them.

CamPanels have a unique name; this name is used to register the panel and retrieve others. Note: the name is unique per class of CamPanel, not per instance.

For example, the differentiator works on a YUV image, so when the diff-panel needs to be drawn/calculated, it will request the image(s) from the YUV panel (which may or not be visible). The YUV panel may in turn require the RGB panel, etcetera. A panel may be needed by several other panels, or require more than one panel. Circular references are not allowed.

The signal/slot mechanism of Qt is used to keep things going; the 'lower' panels with basic images are updated by CamWidget; these panels emited Updated() signal which 'higher', more sophisticated Panels may connect to. They in turn will emit Updated() signals when they are done with their work.

Panels can, and will be, created by various classes. For example, a video compressor based on the DCT and H.3* protocols may register a set of panels, while another compressor based upon subband image coding will use another set of panels. Both sets however, may be dependant upon the same 'base' panels. CamWidget itself registers 3 panels, nl. the full colour image, the YUV image and differentional YUV image (which are pretty basic :))

Panels come in three basic forms: a single RGB image that forms the begin (or end)point YUV panels in 4:2:0 format, used for steps. The UV panels are a quarter in size and displayed below the large Y image Non-image panels, for example graphs

TODO: A full list of available panels

Definition at line 16 of file CamPanel.h.

Public Types

enum  PanelTypes { None, RGB, YUV420, Graph }

Public Slots

void DecrementUse ()
 Decrement usage counter.
void IncrementUse ()
 Increment usage counter.
virtual void RightClick (const QPoint &pos)
virtual void SetSize (const QSize &new_size)
 Slot to signal changes in image size.


void ChangedImageSize (const QSize &new_size)
 Emitted when the principle image-size has been changed.
void ChangedToHidden ()
 Only emitted when the panel is turned off.
void ChangedToUnused ()
 Emitted when the usage counter drops to 0 (not used any more).
void ChangedToUsed ()
 Emitted when the usage counter increases to 1 (first use).
void ChangedToVisible ()
 Only emitted when the panel is turned on.
void ChangedUsage (int new_usage)
 Emitted whenever the usage counter changes.
void ChangedVisibility (bool new_visibility)
 The visibility has changed.
void ChangedVisibleSize (const QSize &new_size)
 Emitted when the visible size has been changed.
void Updated ()
 Emitted after the panel's data has been updated.

Public Member Functions

const CCamPanelcopy (const CCamPanel &src)
 Make deep copies of images, by overwriting buffers.
QString GetDescription () const
 Returns a short description of the panel.
virtual const QImage & GetImage (int n=0)
 Return image representing step.
QSize GetImageSize () const
 Return size of principle image. May be (0, 0).
QString GetName () const
 Returns unique name of panel.
int GetPanelType () const
 Returns the panel type.
const QPixmap & GetPixmap () const
 Return pixmap object.
virtual QDialog * GetPropertiesDialog () const
QSize GetVisibleSize () const
 Return size of drawable portion; may be (0, 0) when there's nothing to draw.
bool IsDrawable ()
int IsUsed ()
 Returns usage counter.
const CCamPaneloperator+= (const CCamPanel &add)
 Operator overload that will add the values of the buffers of plus to this panel.
CCamPaneloperator-= (const CCamPanel &minus)
virtual void paintEvent (QPaintEvent *)
 Paint visible representation of step.
virtual QSize sizeHint () const
virtual QSizePolicy sizePolicy () const
virtual ~CCamPanel ()

Protected Member Functions

 CCamPanel (const QString &new_name, const QString &new_description, int panel_type, bool draw=TRUE, QWidget *parent=0, const char *name=0)
void ConnectResizes (CCamPanel *parent)
 Make SIGNAL/SLOT connections to propagate updates.
void ConnectUsage (CCamPanel *parent)
 Make SIGNAL/SLOT connections for usage counting.
void CreateImages ()
 Create image buffers in ImgRGB, ImgY/U/V or Graph resp.
void SetImageSize (const QSize &new_size)
 Sets principle image size.
void SetVisibleSize (const QSize &new_size)
 Sets visible image size.

Protected Attributes

int half_h
 Half image height; set by SetImageSize();.
int half_w
 Half image width; set by SetImageSize();.
int image_h
 Image height; set by SetImageSize();.
int image_w
 Image width; set by SetImageSize();.
QImage ImgRGB
 Ready-to-use QImage object for RGB image.
QImage ImgU
 Ready-to-use QImage object for U data.
QImage ImgV
 Ready-to-use QImage object for V data.
QImage ImgY
 Ready-to-use QImage object for Y data.
bool MenuVisible
QPixmap PixGraph
 Ready-to-use QPixmap for graphs.
QPopupMenu * pMenu

Private Member Functions

void CallIntg (int n, uchar *dst, uchar *src)

Private Attributes

QString Description
bool Drawable
 Drawable: if false, does not show up in a list, and can never be drawn.
QImage ImgNull
QSize ImgSize
QString Name
int PanelType
 Type; see PanelTypes.
int Usage
 Usage counter; 0 means unused.
QSize VisSize

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

Generated by  Doxygen 1.6.0   Back to index