|
|
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Painter 2.0
Painter 2.0 [message #20039] |
Thu, 12 February 2009 17:57  |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
I am happy to announce that I have finished the "Painter 2.0", basically a 2D rendering system with PDF/SVG strength, this time written almost from scratch (Painter1.0 was AGG based).
I have only recycled (and optimized) the basic polygon rasterizer from AGG (which, I believe, uses FreeType rasterizer code, which has roots in LibArt) - that algorithm is really unbeatable. Kudos to Raph Levien!
The result is about 10% faster, has about 60% of original code size and, most importantly, is internally much more flexible. I believe Maxim Shemanarev has done some inferior design decisions in AGG, that is now fixed for us 
Mirek
[Updated on: Thu, 12 February 2009 17:58] Report message to a moderator
|
|
|
|
|
|
|
Re: Painter 2.0 [message #20052 is a reply to message #20039] |
Sat, 14 February 2009 00:31   |
emr84
Messages: 26 Registered: April 2008 Location: Argentina
|
Promising Member |
|
|
When I tried to compile PainterExamples (on Windows XP with mingw, Debug mode) in svn 861:
Quote: | ----- Painter ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (2 / 10)
BLITZ: Painter.cpp PainterPath.cpp FontWin32.cpp FontX11.cpp DrawOp.cpp Painting.cpp Math.cpp Xform2D.cpp Approximate.c
pp Stroker.cpp Dasher.cpp Transformer.cpp Interpolator.cpp Rasterizer.cpp RasterizerClip.cpp Path.cpp Context.cpp I
mage.cpp Mask.cpp Gradient.cpp RadialGradient.cpp
In file included from C:/uppsvn/out/Painter/MINGW.Debug.Debug_full.Gui\$blitz.cpp: 27:
C:\uppsvn\uppsrc\Painter\Math.cpp: In function 'Upp::Pointf Upp::Mid(const Upp::Pointf&, const Upp::Pointf&)':
C:\uppsvn\uppsrc\Painter\Math.cpp:12: error: ISO C++ says that these are ambiguous, even though the worst conversion fo
r the first is better than the worst conversion for the second:
C:\uppsvn\uppsrc/Core/Gtypes.h:148: note: candidate 1: Upp::Point_<double> Upp::operator/(Upp::Point_<double>, double)
C:\uppsvn\uppsrc/Core/Gtypes.h:148: note: candidate 2: Upp::Point_<int> Upp::operator/(Upp::Point_<int>, int)
In file included from C:/uppsvn/out/Painter/MINGW.Debug.Debug_full.Gui\$blitz.cpp: 31:
C:\uppsvn\uppsrc\Painter\Xform2D.cpp: In member function 'bool Upp::Xform2D::IsRegular() const':
C:\uppsvn\uppsrc\Painter\Xform2D.cpp:24: error: call of overloaded 'abs(double)' is ambiguous
C:\upp\mingw\include/stdlib.h:369: note: candidates are: int abs(int)
C:\uppsvn\uppsrc/Core/Core.h:484: note: Upp::int64 abs(Upp::int64)
C:\uppsvn\uppsrc\Painter\Xform2D.cpp:24: error: call of overloaded 'abs(const double&)' is ambiguous
C:\upp\mingw\include/stdlib.h:369: note: candidates are: int abs(int)
C:\uppsvn\uppsrc/Core/Core.h:484: note: Upp::int64 abs(Upp::int64)
In file included from C:/uppsvn/out/Painter/MINGW.Debug.Debug_full.Gui\$blitz.cpp: 35:
C:\uppsvn\uppsrc\Painter\Approximate.cpp: In function 'void Upp::ApproximateArc(Upp::LinearPathConsumer&, const Upp::Po
intf&, const Upp::Pointf&, double, double, double)':
C:\uppsvn\uppsrc\Painter\Approximate.cpp:78: error: call of overloaded 'abs(double)' is ambiguous
C:\upp\mingw\include/stdlib.h:369: note: candidates are: int abs(int)
C:\uppsvn\uppsrc/Core/Core.h:484: note: Upp::int64 abs(Upp::int64)
In file included from C:/uppsvn/out/Painter/MINGW.Debug.Debug_full.Gui\$blitz.cpp: 72:
C:\uppsvn\uppsrc\Painter\Path.cpp: In member function 'virtual void Upp::BufferPainter::QuadraticOp(const Upp::Pointf&,
bool)':
C:\uppsvn\uppsrc\Painter\Path.cpp:73: error: ISO C++ says that these are ambiguous, even though the worst conversion fo
r the first is better than the worst conversion for the second:
C:\uppsvn\uppsrc/Core/Gtypes.h:146: note: candidate 1: Upp::Point_<double> Upp::operator*(double, Upp::Point_<double>)
C:\uppsvn\uppsrc/Core/Gtypes.h:146: note: candidate 2: Upp::Point_<int> Upp::operator*(int, Upp::Point_<int>)
C:\uppsvn\uppsrc\Painter\Path.cpp: In member function 'virtual void Upp::BufferPainter::CubicOp(const Upp::Pointf&, con
st Upp::Pointf&, bool)':
C:\uppsvn\uppsrc\Painter\Path.cpp:87: error: ISO C++ says that these are ambiguous, even though the worst conversion fo
r the first is better than the worst conversion for the second:
C:\uppsvn\uppsrc/Core/Gtypes.h:146: note: candidate 1: Upp::Point_<double> Upp::operator*(double, Upp::Point_<double>)
C:\uppsvn\uppsrc/Core/Gtypes.h:146: note: candidate 2: Upp::Point_<int> Upp::operator*(int, Upp::Point_<int>)
Fillers.cpp
Render.cpp
PaintPainting.icpp
Painter: 24 file(s) built in (0:15.37), 640 msecs / file, duration = 16047 msecs
There were errors. (2:43.95)
|
|
|
|
|
|
|
Re: Painter 2.0 [message #20091 is a reply to message #20039] |
Tue, 17 February 2009 10:35   |
Tom1
Messages: 1301 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi Mirek,
Painter 2.0 was a welcome enhancement. Thank you!
I recall you were earlier referring to a future CoreDraw and more. Could you outline the future you have planned for Draw and Painter interfaces?
As I understand it, currently the Draw interface can be used to render graphics on screen, images and printer using the hardware accelerated graphics of the system where available.
Now, the Painter interface can be used to render graphics on ImageBuffers without hardware acceleration.
Is there a plan to create a Painter interface for Windows GDI and X11 accelerated graphics? How about for printing on Linux or BSD?
// Tom
|
|
|
Re: Painter 2.0 [message #20094 is a reply to message #20091] |
Tue, 17 February 2009 12:06   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Tue, 17 February 2009 04:35 | Hi Mirek,
Painter 2.0 was a welcome enhancement. Thank you!
I recall you were earlier referring to a future CoreDraw and more. Could you outline the future you have planned for Draw and Painter interfaces?
|
Interfaces stay (with minor improvements / fixes).
The goal of CoreDraw is to separate Draw from sytem. The main target is webserver like apps (which need graphics, in form of e.g. .png, but cannot use X11).
Quote: |
As I understand it, currently the Draw interface can be used to render graphics on screen, images and printer using the hardware accelerated graphics of the system where available.
|
Yes.
Quote: |
Now, the Painter interface can be used to render graphics on ImageBuffers without hardware acceleration.
|
Yes, but I think people are generally puttin too much emphasis on "hardware acceleration". 2D works quite well (and in fact, in some cases even faster) without HW. MacOS X since recently was using only sw rendering of 2D graphics and nobody complained...
Quote: |
Is there a plan to create a Painter interface for Windows GDI and X11 accelerated graphics?
|
No, does not make sense. WinGDI and X11 are not good enough.
In theory, we could consider OpenGL / DirectDraw...
Quote: |
How about for printing on Linux or BSD?
// Tom
|
AFAIK, works.
Mirek
|
|
|
|
|
|
|
Re: Painter 2.0 [message #20111 is a reply to message #20110] |
Wed, 18 February 2009 16:59   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
luzr wrote on Wed, 18 February 2009 08:47 |
cbpporter wrote on Wed, 18 February 2009 07:44 | Sorry if I'm missing something, but how can you use Painter when X libs are not available, if Painter inherits from Draw and Draw can't be built without those libs.
|
That is why we need DrawCore.... We need abstract "Draw" with no Xlib dependencies.
The, in "Draw" there will be platform Draw derived class that is then used in GUI widgets.
Mirek
|
Thinking about the issue more, I guess the final solution will to move "GuiDraw" from Draw to CtrlCore, leaving Draw independent from X11 libs.
Of course, we will still have to handle text metrics - but fontconfig and freetype should fill the gap, I hope...
Mirek
|
|
|
|
|
Re: Painter 2.0 [message #20443 is a reply to message #20278] |
Wed, 18 March 2009 23:34   |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |

|
|
As there`s no special "Painter" forum (hope we`ll have one), I post my little proposal here. It is adopted from one of my recent Painter etudes.
//Rectangle with rounded corners
Painter & Painter::Rectangle(double x, double y, double cx, double cy, double r)
{
ASSERT(r >= 0.);
if (cx < 0.) {x+=cx; cx=-cx;}
if (cy < 0.) {y+=cy; cy=-cy;}
Move(x+r,y)
.Arc(x+r,y+r,r,r,-M_PI/2.,-M_PI/2.)
.Line(x, y+cy-r)
.Arc(x+r,y+cy-r,r,r,M_PI,-M_PI/2.)
.Line(x+cx-r, y+cy)
.Arc(x+cx-r,y+cy-r,r,r,M_PI/2,-M_PI/2.)
.Line(x+cx, y+r)
.Arc(x+cx-r,y+r,r,r,0.,-M_PI/2.)
.Line(x+r, y);
}
[Updated on: Wed, 18 March 2009 23:38] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 00:22:20 CEST 2025
Total time taken to generate the page: 0.01436 seconds
|
|
|