Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Painter
Painter [message #19761] Wed, 14 January 2009 13:52 Go to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
Ok,

so I have renamed SDraw to Painter and officially moved it to uppsrc.

Means, since today, we have high-quality, high-peformance, easy to use software renderer in U++.

There is still a lot of work to be done, especially we need Painting and PaintingPainter classes (to store paintings) and printing support, then printing support in Draw.

Later, I plan for some reingeneering of rendering internal, some AGG design choices are IMO a little bit long in teeth (plus, there is already a couple of bugs I had to fix). OTOH, as source of nice geometrick algorithms, AGG is invaluable Smile

Even later, we need to finally split Draw into (system-GUI-)Draw and CoreDraw (depending only on Core) and make Painter dependent only on CoreDraw (plus font libraries, Fc and Ft).

Mirek
Re: Painter [message #19764 is a reply to message #19761] Wed, 14 January 2009 23:26 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I hope this won`t make GUI binaries sizes something like 15Mb, ecpecially with gcc Smile

[Updated on: Wed, 14 January 2009 23:26]

Report message to a moderator

Re: Painter [message #19766 is a reply to message #19764] Thu, 15 January 2009 01:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
Of course, it is not mandatory.

OTOH, so far it is surprisingly small, something like 100KB, and IMO it can be pushed to less.

Mirek
Re: Painter [message #19767 is a reply to message #19761] Thu, 15 January 2009 19:34 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 579
Registered: December 2005
Location: Budapest, Hungary
Contributor
Thanks for your work, Mirek!
Re: Painter [message #19769 is a reply to message #19767] Thu, 15 January 2009 23:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
examples/PainterExamples contains all you need to use new Painter class.

(Meanwhile, its "Stroker bug" shows one current AGG problem we are about to solve....)

Mirek
Re: Painter [message #19772 is a reply to message #19769] Fri, 16 January 2009 14:21 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 168
Registered: May 2007
Location: Grenoble, France
Experienced Member
C:\upp\uppsrc\Painter\/agg_path_storage.h:967: error: 'bezier_arc_svg' was not declared in this scope
I also see in the same file that
#include "agg_bezier_arc.h"
is commented out, and the header is not present. What was that for ?

Lionel

[Updated on: Fri, 16 January 2009 14:21]

Report message to a moderator

Re: Painter [message #19773 is a reply to message #19772] Fri, 16 January 2009 17:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
Should be now fixed for Linux and GCC.

Also, in Ubuntu64, the size of Painter is now 122KB - measured by comparing reference/Reports size compiled in optimal mode with and without Painter.
Re: Painter [message #19774 is a reply to message #19773] Fri, 16 January 2009 17:49 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 168
Registered: May 2007
Location: Grenoble, France
Experienced Member
sorry, I was trying on Windows+MinGW... I got it working by nastily hacking the code (uncommenting the header inclusion, adding it to the sources plus other few fixes).

Speaking of the few fixes, it seems that PrintDlg is #define'd by windows headers and replaced in Print.cpp by PrintDlgA, thus a compiling error follows... I don't know why it did not happen before. Maybe the reorganization makes the windows header appear earlier.

I added the following :

#ifdef PrintDlg
# undef PrintDlg
#endif

and it worked then.

I also had problems with the call to function abs(). I don't know if there is one that exists on windows for double types... So I also added a #define ABS() doing quite the same, and replaced the calls to abs() by ABS().

Just my 2 cents to keep U++ compilable on every platforms... Don't follow my fixes they are ugly, but can give some hints to speed up the real correction.

Lionel
Re: Painter [message #19803 is a reply to message #19761] Thu, 22 January 2009 14:34 Go to previous messageGo to next message
Tom1
Messages: 621
Registered: March 2007
Contributor
Hi,

Good work with the Painter, Mirek! The interface to various features is very nice once one gets to know it.

Now I would like to know the road-map of the Painter development. (Maybe I have missed it somewhere else in the forum??) Is this new interface something that will be introduced for hardware based rendering too (entirely or partly) or is this only for the software based Painter?

I did some quick benchmarking of the Painter versus Draw and found that the cost of using the Painter instead of Draw is about 10x..20x slowdown for rendering strokes. The fills are not that slow, but they still do not match the speed of Draw. I may well be dead wrong, but I guess the main reason for the huge slowdown is the anti-aliasing. Is there a way to disable anti-aliasing to speed up the rendering at the cost of quality? (I wish there was. Actually, I wish it could be turned on and off on-the-fly.)

My application is very sensitive to speed and anti-aliasing is usually not required. However, the dashed line styles (with great flexibility in Painter, I might add) is what I have been waiting to get for Draw for quite some time now.

Anyway, great stuff!

Best regards,

Tom
Re: Painter [message #19804 is a reply to message #19803] Thu, 22 January 2009 15:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
Tom1 wrote on Thu, 22 January 2009 08:34


Now I would like to know the road-map of the Painter development. (Maybe I have missed it somewhere else in the forum??)



Not really, I have to admit that I sort of got interested first and captured later doing this. But it was really missing for a long time.

Quote:


Is this new interface something that will be introduced for hardware based rendering too (entirely or partly) or is this only for the software based Painter?



It is meant to be solely sw based, at least for now.

Quote:


I did some quick benchmarking of the Painter versus Draw and found that the cost of using the Painter instead of Draw is about 10x..20x slowdown for rendering strokes. The fills are not that slow, but they still do not match the speed of Draw. I may well be dead wrong, but I guess the main reason for the huge slowdown is the anti-aliasing.



IMO, the main difference is the way how strokes are drawn. GDI simply draws lines, at least as long as line width is 1 - and in that case, it is often HW accelerated.

Painter first converts strokes to polygons and then draws them.

In future, we might consider optimizing this and draw strokes directly in important special cases.

BTW, you might also try to benchmark different line widths...

Quote:


Is there a way to disable anti-aliasing to speed up the rendering at the cost of quality? (I wish there was. Actually, I wish it could be turned on and off on-the-fly.)



Yes, there is "NoAA" attribute. But do not expect huge performance gains, it was rather added for printing where antialiasing does not look well.

Mirek
Re: Painter [message #19958 is a reply to message #19804] Thu, 05 February 2009 14:14 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

I tried Stroke example from uppdev.
I have interesting situation in this image:
index.php?t=getfile&id=1574&private=0
Is this a normal situation?
Re: Painter [message #19977 is a reply to message #19803] Fri, 06 February 2009 23:40 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 2966
Registered: August 2008
Veteran
Hello Mirek

I am also happy with Painter. Thank you.

As Tom said:
Quote:

Now I would like to know the road-map of the Painter development


Now I am doing a very basic library for interactively doing flowcharts. Should I have to port and develop it using Painter?. No problem if the answer is yes.

Best regards
Koldo


Best regards
IƱaki
Re: Painter [message #19978 is a reply to message #19958] Sat, 07 February 2009 11:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
tojocky wrote on Thu, 05 February 2009 08:14

I tried Stroke example from uppdev.
I have interesting situation in this image:
index.php?t=getfile&id=1574&private=0
Is this a normal situation?


Nope.

Well, "Stroke" was my development package for stroking the path.

For that reason, I was using exisitng AGG based painter for comparison. I believe the bug you see is in AGG Smile

Anyway, that phase is now over, my stroker is working.

Funny thing is that AGG stroker is 800 lines while my new stroker is 150 lines long Smile (and 2KB in compiled code).

I guess that my "AGG-free" painter will squeeze to 20KB of code - something that could be easily added to Draw (or future DrawCore).

Mirek

[Updated on: Sat, 07 February 2009 14:39]

Report message to a moderator

Re: Painter [message #19979 is a reply to message #19977] Sat, 07 February 2009 11:47 Go to previous message
mirek is currently offline  mirek
Messages: 11956
Registered: November 2005
Ultimate Member
koldo wrote on Fri, 06 February 2009 17:40

Hello Mirek

I am also happy with Painter. Thank you.

As Tom said:
Quote:

Now I would like to know the road-map of the Painter development





Well, I got bored with AGG so started again from the scratch. There is "Painter 2.0" coming - hard parts are finished (rasterizer and stroker), the rest should be quite simple.

Anyway, from the interface perspective, existing methods will stay. The interface will only be enchanced with Pointf based variants (in addition to x, y pars).

Quote:


Now I am doing a very basic library for interactively doing flowcharts. Should I have to port and develop it using Painter?. No problem if the answer is yes.



Well, Painter is here to stay....

Mirek
Previous Topic: X11 caret
Next Topic: Ide + docking package
Goto Forum:
  


Current Time: Sat Jul 20 04:56:33 CEST 2019

Total time taken to generate the page: 0.00787 seconds