ihhub / penguinV

Computer vision library with focus on heterogeneous systems
Other
119 stars 90 forks source link

Add missing UI functions for X11 Window class #459

Open ihhub opened 5 years ago

ihhub commented 5 years ago

We have an optional UI Window classes for image display and drawings. All of them locate in src/ui directory. Currently we support Qt, Win32 API and X11 frameworks. X11 code locates in src/ui/x11/x11_ui.h and src/ui/x11/x11_ui.cpp files. UiWindowX11 class does not have an implementation of following functions:

virtual void drawLine( const Point2d & start, const Point2d & end, const PaintColor & color );
virtual void drawEllipse( const Point2d & center, double xRadius, double yRadius, const PaintColor & color );
virtual void drawRectangle( const Point2d & topLeftCorner, double width, double height, const PaintColor & color );

We want to add them. You could have a look at Win32 or Qt implementation for reference of code implementation.

MeKot commented 5 years ago

@ihhub Do you mind if I take this on?

fullset commented 5 years ago

Hi, @MeKot.

Do you still want to work on this issue?

ihhub commented 4 years ago

hi @fullset , you could take this issue.

fullset commented 4 years ago

@ihhub, OK. I'll take a look.

Maybe you have a quick answer to 1 question.

This string is present in x11_ui.cpp:

XDrawLine( _uiDisplay, _window, defaultGC, static_cast<int>(point.x - 1), static_cast<int>(point.y - 1),
            static_cast<int>(point.x + 1), static_cast<int>(point.y + 1) );

That's how the point is painted. Are there any reasons to use XDrawLine() and don not use XDrawPoint() for this?

ihhub commented 4 years ago

hi @fullset , it's done in a way to draw a cross (x) instead of dot as far as I remember. You could try to play around this and replace the code if you see the need in it. Remember that dot usually is something more than just one pixel as dots in computer vision applications are used to show edge points for example.