|
rock_widget_collection
0.1
|
#include <ImageViewOld.h>
Inherits MultiWidget.
Inherited by RangeView, and SonarView.
Public Slots | |
| void | emitUserExport () |
| void | update () |
| void | update2 () |
| void | setDefaultImage () |
| void | setZoomEnabled (bool enabled) |
| virtual void | openGL (bool flag) |
| bool | onOpenGL () |
Public Slots inherited from MultiWidget | |
| void | setActive (bool b) |
| QString | getMinimizedLabel () |
| void | setMinimizedLabel (QString label) |
| void | childEvent (QChildEvent *event) |
| bool | event (QEvent *event) |
| bool | isHiddenWhenMinimized () const |
| void | hideWhenMin (bool b) |
Public Slots inherited from PaintWidget | |
| QObject * | addItem (QObject *object) |
| QObject * | addPoints (const QList< int > &points_x, const QList< int > &points_y, int groupNr, const QColor &color) |
| QObject * | addText (int xPos, int yPos, int groupNr, const QString &text) |
| QObject * | addLine (int xPos, int yPos, int groupNr, const QColor &color, int endX, int endY) |
| QObject * | addEllipse (int xPos, int yPos, int groupNr, const QColor &color, int width, int height) |
| QObject * | addRectangle (int xPos, int yPos, int groupNr, const QColor &color, int width, int height) |
| QObject * | addPolyline (int groupNr, const QColor &color, const QList< QPoint > &points) |
| QObject * | addPolygon (int groupNr, const QColor &color, const QList< QPoint > &points) |
| QObject * | removeItem (QObject *drawItem, bool delete_object) |
| void | removeAllItems (bool delete_objects) |
Signals | |
| void | clickImage (int x, int y) |
| void | userExport () |
Signals inherited from MultiWidget | |
| void | activityChanged (bool) |
Public Member Functions | |
| ImageViewOld (QWidget *parent=NULL, bool use_openGL=false) | |
| virtual | ~ImageViewOld () |
| void | contextMenuEvent (QContextMenuEvent *event) |
| int | heightForWidth (int w) |
| void | mouseDoubleClickEvent (QMouseEvent *event) |
| void | setAspectRatio (bool value) |
| bool | getAspectRatio () |
| void | saveImage (bool overlay=true) |
| bool | saveImage2 (QString path, bool overlay=true) |
| bool | saveImage3 (const QString &mode, int pixel_size, int width, int height, const char *pbuffer, QString path, QString format) |
| void | resetCrop () |
| void | crop (int x, int y, int w, int h) |
| void | addRawImage (const QString &mode, int pixel_size, int width, int height, const char *pbuffer, const int size) |
| void | addFrame (const base::samples::frame::Frame &frame) |
| void | addImage (const QImage &image) |
| void | setGroupStatus (int groupNr, bool enable) |
| void | clearGroups () |
| int | getHeight () const |
| int | getWidth () const |
| int | getFormat () const |
Public Member Functions inherited from MultiWidget | |
| MultiWidget (QWidget *parent=0) | |
Public Member Functions inherited from PaintWidget | |
| PaintWidget (QWidget *parent) | |
| ~PaintWidget () | |
Protected Member Functions | |
| void | drawDrawItemsToImage (QImage &image, bool all=false) |
| void | drawDrawItemsToPainter (QPainter &painter, bool all=false) |
| virtual void | resizeEvent (QResizeEvent *event) |
| virtual void | paintEvent (QPaintEvent *event) |
| void | mousePressEvent (QMouseEvent *event) |
| void | mouseReleaseEvent (QMouseEvent *event) |
| void | calculateRects () |
| std::pair< QPoint, bool > | toImage (QPoint const &p) |
Protected Member Functions inherited from PaintWidget | |
| void | drawDrawItemsToImage (QImage &image, bool all=false) |
| void | drawDrawItemsToPainter (QPainter &painter, bool all=false) |
| void | paintEvent (QPaintEvent *event) |
Protected Attributes | |
| QMenu | contextMenu |
| QAction * | save_image_act |
| QAction * | user_export_act |
| QString | save_path |
| QImage | originalImage |
| QImage | image |
| QRect | currentCrop |
| bool | no_input |
| bool | aspect_ratio |
| frame_helper::FrameQImageConverter | frame_converter |
| ImageViewOldGL * | image_view_gl |
| QRectF | target |
| QRectF | source |
| bool | zoomEnabled |
| QPoint | pressPoint |
| bool | pressValid |
Protected Attributes inherited from MultiWidget | |
| bool | isActive |
| bool | wasHidden |
Protected Attributes inherited from PaintWidget | |
| QList< DrawItem * > | items |
| QList< int > | disabledGroups |
| bool | isOpenGL |
Properties | |
| bool | Use_OpenGL |
| bool | Aspect_Ratio |
Properties inherited from MultiWidget | |
| bool | hideWhenMinimized |
| QString | minimizedLabel |
Friends | |
| class | ImageViewOldGL |
Widget which displays an image. The dimensions and the format needs to be given and images can then be added an will be shown immidiately.
If an image which is larger than the specified dimension is added, only the images visible parts (within the dimension specified) will be shown.
Alternatively one can add an image and scale it. No scaling will be done if the image already has the proportions given at start. Scaling is costy though. If more images of a different size shall be added the best way is to change the format via changeFormat. This will change the format according to the new dimensions. This should be the default behaviour e.g. if a cameras resolution was changed so is the widgets. Scaling should only be done if a few images are changed or if the images are all quite large and should be scaled to enhance the viewing. Note though, again, that scaling does cost performance.
One can draw shapes on top of the image. Currently these are:
One can add the shapes via addItem or a specific convenience method like addText, addLine etc. Added Items will be displayed on top of the image currently displayed and all successive images. RemoveItems, removes the given item. Alternatively all specific shapes can be removed or all Items.
Items can have a group number and all items with a specific group number can be shown or hidden. Note that hidden is NOT the same as removed. Hidden just does not draw them, removed items can not be retrieved by the widget (even though they might be from outside the class).
Note: After adding any shape no repaint will be done. You need to either explicitly call repaint on the widget or add a different image will will automatically have the shapes added ontop of it. Otherwise, if adding multiple shapes, repaint would be called very often which especially when working with video would be a performance waste.
Definition at line 74 of file ImageViewOld.h.
| ImageViewOld::ImageViewOld | ( | QWidget * | parent = NULL, |
| bool | use_openGL = false |
||
| ) |
Initializing the widget with the given format and dimensions For format parameters
| width | the width of images put onto the widget |
| height | the height of images put onto the widget |
Definition at line 15 of file ImageViewOld.cc.
|
virtual |
| void ImageViewOld::addFrame | ( | const base::samples::frame::Frame & | frame | ) |
Definition at line 250 of file ImageViewOld.cc.
| void ImageViewOld::addImage | ( | const QImage & | image | ) |
Adds a QImage to the widget.
| image | the image to be added |
Definition at line 242 of file ImageViewOld.cc.
| void ImageViewOld::addRawImage | ( | const QString & | mode, |
| int | pixel_size, | ||
| int | width, | ||
| int | height, | ||
| const char * | pbuffer, | ||
| const int | size | ||
| ) |
Adds an image to the display, given raw data in pbuffer
The following modes are understood in mode:
Definition at line 225 of file ImageViewOld.cc.
|
protected |
Definition at line 309 of file ImageViewOld.cc.
| void ImageViewOld::clearGroups | ( | ) |
Removes all groups stati. If there are still shapes with group numbers they will all be visible afterwards
Definition at line 206 of file ImageViewOld.cc.
|
signal |
| void ImageViewOld::contextMenuEvent | ( | QContextMenuEvent * | event | ) |
Definition at line 61 of file ImageViewOld.cc.
| void ImageViewOld::crop | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h | ||
| ) |
|
protected |
Adds all shapes to the image
| shownImage | teh iamge to add the shapes to |
Definition at line 283 of file ImageViewOld.cc.
|
protected |
Definition at line 265 of file ImageViewOld.cc.
|
slot |
Definition at line 50 of file ImageViewOld.cc.
|
inline |
Definition at line 118 of file ImageViewOld.h.
|
inline |
Definition at line 167 of file ImageViewOld.h.
|
inline |
Definition at line 165 of file ImageViewOld.h.
|
inline |
Definition at line 166 of file ImageViewOld.h.
|
inline |
Definition at line 96 of file ImageViewOld.h.
| void ImageViewOld::mouseDoubleClickEvent | ( | QMouseEvent * | event | ) |
Definition at line 350 of file ImageViewOld.cc.
|
protected |
Definition at line 90 of file ImageViewOld.cc.
|
protected |
Definition at line 97 of file ImageViewOld.cc.
|
inlineslot |
Definition at line 111 of file ImageViewOld.h.
|
virtualslot |
Definition at line 141 of file ImageViewOld.cc.
|
protectedvirtual |
Reimplemented in SonarView.
Definition at line 331 of file ImageViewOld.cc.
| void ImageViewOld::resetCrop | ( | ) |
Removes any cropping previously set with crop(x, y, w, h)
Definition at line 211 of file ImageViewOld.cc.
|
protectedvirtual |
Definition at line 338 of file ImageViewOld.cc.
| void ImageViewOld::saveImage | ( | bool | overlay = true | ) |
Definition at line 165 of file ImageViewOld.cc.
| bool ImageViewOld::saveImage2 | ( | QString | path, |
| bool | overlay = true |
||
| ) |
Definition at line 173 of file ImageViewOld.cc.
| bool ImageViewOld::saveImage3 | ( | const QString & | mode, |
| int | pixel_size, | ||
| int | width, | ||
| int | height, | ||
| const char * | pbuffer, | ||
| QString | path, | ||
| QString | format | ||
| ) |
Definition at line 186 of file ImageViewOld.cc.
|
inline |
Definition at line 112 of file ImageViewOld.h.
|
slot |
Definition at line 126 of file ImageViewOld.cc.
| void ImageViewOld::setGroupStatus | ( | int | groupNr, |
| bool | enable | ||
| ) |
Definition at line 194 of file ImageViewOld.cc.
|
slot |
Definition at line 56 of file ImageViewOld.cc.
|
protected |
Definition at line 66 of file ImageViewOld.cc.
|
slot |
Definition at line 296 of file ImageViewOld.cc.
|
slot |
Definition at line 291 of file ImageViewOld.cc.
|
signal |
|
friend |
Definition at line 82 of file ImageViewOld.h.
|
protected |
Definition at line 192 of file ImageViewOld.h.
|
protected |
Definition at line 183 of file ImageViewOld.h.
|
protected |
Definition at line 190 of file ImageViewOld.h.
|
protected |
Definition at line 194 of file ImageViewOld.h.
|
protected |
Definition at line 189 of file ImageViewOld.h.
|
protected |
Definition at line 195 of file ImageViewOld.h.
|
protected |
Definition at line 191 of file ImageViewOld.h.
|
protected |
Definition at line 188 of file ImageViewOld.h.
|
protected |
Definition at line 201 of file ImageViewOld.h.
|
protected |
Definition at line 202 of file ImageViewOld.h.
|
protected |
Definition at line 184 of file ImageViewOld.h.
|
protected |
Definition at line 186 of file ImageViewOld.h.
|
protected |
Definition at line 198 of file ImageViewOld.h.
|
protected |
Definition at line 197 of file ImageViewOld.h.
|
protected |
Definition at line 185 of file ImageViewOld.h.
|
protected |
Definition at line 200 of file ImageViewOld.h.
|
readwrite |
Definition at line 79 of file ImageViewOld.h.
|
readwrite |
Definition at line 78 of file ImageViewOld.h.
1.8.11