Board index » delphi » [ann] AggPas 2.4 RM 3 update

[ann] AggPas 2.4 RM 3 update


2008-01-23 10:11:25 AM
delphi50
Dear Ladies & Gentleman,
I am proud to announce I have just released a new version of AggPas,
the Object Pascal port of the wonderful 2D Vector Graphics library
AGG (originally written in C/C++).
www.aggpas.org
A New version of AggPas 2.4 Release Milano 3 is now capable of doing
same things it is master library in C/C++ does.
On top of that, AggPas has from now a new API for Delphi VCL
environment, which I have completely documented here:
www.aggpas.org/documentation
Have a nice day
Milano
 
 

Re:[ann] AggPas 2.4 RM 3 update

Thanks for the update. It is really a gem of a lib and very versatile also.
Milan Marusinec writes:
Quote
Dear Ladies & Gentleman,

I am proud to announce I have just released a new version of AggPas,
the Object Pascal port of the wonderful 2D Vector Graphics library
AGG (originally written in C/C++).

www.aggpas.org

A New version of AggPas 2.4 Release Milano 3 is now capable of doing
same things it is master library in C/C++ does.

On top of that, AggPas has from now a new API for Delphi VCL
environment, which I have completely documented here:

www.aggpas.org/documentation


Have a nice day
Milano
 

Re:[ann] AggPas 2.4 RM 3 update

"Milan Marusinec" <XXXX@XXXXX.COM>writes
Quote
Dear Ladies & Gentleman,

Can you use class instead of object?
This way is ugly for regular using, so ie. one must make some kind of
wrapper
 

Re:[ann] AggPas 2.4 RM 3 update

"Milan Marusinec" <XXXX@XXXXX.COM>writes
Quote
TAgg2D is class and interracts with TBitmap which is also class.
No wrappers are needed for Delphi VCL, because TAgg2D is "class"
wrapper API itself. (Underlying C/C++ port uses "objects" for
technical reasons, but you won't ever touch them with TAgg2D).
I know., I mean can you use class for implementation...
Can you add support for tbitmap32?Or simply, to be able to add pointer to
gr32's TBitmap32 scanline (to avoid including gr32.pas).Some fields of
TAgg2D are private...I know we have source code, but...
What value should be for stride parameter when adding TBitmap32 (32bit)?
Also, Line drawing calls path drawing and line adding.Can you speed it up?
 

Re:[ann] AggPas 2.4 RM 3 update

Sanyin writes:
Quote
"Milan Marusinec" <XXXX@XXXXX.COM>writes
news:479694d3$XXXX@XXXXX.COM...
>Dear Ladies & Gentleman,
>
Can you use class instead of object?
This way is ugly for regular using, so ie. one must make some kind of
wrapper


TAgg2D is class and interracts with TBitmap which is also class.
No wrappers are needed for Delphi VCL, because TAgg2D is "class"
wrapper API itself. (Underlying C/C++ port uses "objects" for
technical reasons, but you won't ever touch them with TAgg2D).
Milano
 

Re:[ann] AggPas 2.4 RM 3 update

"Milan Marusinec" <XXXX@XXXXX.COM>writes
Quote
Sanyin writes:
>"Milan Marusinec" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>
>>TAgg2D is class and interracts with TBitmap which is also class.
>>No wrappers are needed for Delphi VCL, because TAgg2D is "class"
>>wrapper API itself. (Underlying C/C++ port uses "objects" for
>>technical reasons, but you won't ever touch them with TAgg2D).
>
>I know., I mean can you use class for implementation...

"classes" must be allocated on heap and "objects" don't
("object" can be on stack or on data segment). So by using internally
"objects" instead of "classes" speeds up whole thing, because
as you know, heap allocation is expensive process (at leat
more expensive than placing object on already allocated stack).
OK, but code is not low level, ie. someone will use it.Are you sure that
speed penalty is so big?
What about record methods?
Quote
So I am not gonna use "classes" in low-level implementations.

Yeah, I will probably add a support function for attaching to Graphics32
bitmaps.
I have noticed that gr32 line methods are very very faster than AGG2D.
But my polygon32 wrapper for gr32, using AGG, is much faster.
What about compiling with C++ builder?
 

Re:[ann] AggPas 2.4 RM 3 update

Sanyin writes:
Quote
"Milan Marusinec" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...

>TAgg2D is class and interracts with TBitmap which is also class.
>No wrappers are needed for Delphi VCL, because TAgg2D is "class"
>wrapper API itself. (Underlying C/C++ port uses "objects" for
>technical reasons, but you won't ever touch them with TAgg2D).

I know., I mean can you use class for implementation...
"classes" must be allocated on heap and "objects" don't
("object" can be on stack or on data segment). So by using internally
"objects" instead of "classes" speeds up whole thing, because
as you know, heap allocation is expensive process (at leat
more expensive than placing object on already allocated stack).
So I am not gonna use "classes" in low-level implementations.
Quote
Can you add support for tbitmap32?Or simply, to be able to add pointer to
gr32's TBitmap32 scanline (to avoid including gr32.pas).Some fields of
TAgg2D are private...I know we have source code, but...
Yeah, I will probably add a support function for attaching to Graphics32
bitmaps. Maybe people on this list should also make proposals for more
graphics surfaces they daily use, to which TAgg2D should be able to
Attach for rendering.
Quote
What value should be for stride parameter when adding TBitmap32 (32bit)?
stride:=TBitmap32.Width * 4;
And, it is up to user, if this will be positive or negative.
(Positive for achieving Top to Bottom Y coordinates surface &
Negative for achieving Bottom to Top Y coordinates surface).
Quote
Also, Line drawing calls path drawing and line adding.Can you speed it up?
In vector graphics, everything in the end is a path, because
path is the object that is passed to the rasterizer.
What is the use case where performance of TAgg2D is not sufficient
for you ? Maybe if it is some mission-critical application where
real-time is a must and you are willing to pay for it, I could make
some special implementations just for you to satisfy that needs.
Milano
 

Re:[ann] AggPas 2.4 RM 3 update

"Milan Marusinec" <XXXX@XXXXX.COM>writes
Quote
Sanyin writes:
Yes, in fact, "objects" are "records with methods".
It's a kind of resurrection in latest Borland lang specs.
Have you any documentation about allocationg classes/objects in delphi?
Quote
It may be so, because a very single-problem-oriented solutions
like "rendering just bresenham aa lines on just 4byte-per-pix
surfaces using MMX" can yield a much better performance.
Well, polygon drawing is also MMX optimized and it is slower.I wonder if
there is way to improve AGG2D, nothing else.
Quote
I know things gets done like that. I personally don't have a C++ Builder
and just for that I am not willing to buy one. So If I could ask
somebody on this list, who uses C++ builder on that level,
JPEG library (that comes with Delphi) is compiled with free BC++ 5.5, you
can download it, it is free.
Many other projects are comiled with BC++, than ported to delphi with
wrappers, and this way is much faster.
Of course, for code that is optimized for C++.
Translating C++ to Pascal cannot be done easy, and it doesnt mean that
pascal code will be slower, because of pascal.
I know your lib. is translated from template classes, FPC supports them.
Also, what about "object" in future versions of delphi?
 

Re:[ann] AggPas 2.4 RM 3 update

Sanyin writes:
Quote
OK, but code is not low level, ie. someone will use it.Are you sure that
speed penalty is so big?
The penalty includes allocating memory for class which in case
of disk swapping (virtual memory) can hit in bad moment,
and anyway, the must of doing the allocation always increases time
(not decreases).
Quote
What about record methods?
Yes, in fact, "objects" are "records with methods".
It's a kind of resurrection in latest Borland lang specs.
Quote
I have noticed that gr32 line methods are very very faster than AGG2D.
But my polygon32 wrapper for gr32, using AGG, is much faster.
It may be so, because a very single-problem-oriented solutions
like "rendering just bresenham aa lines on just 4byte-per-pix
surfaces using MMX" can yield a much better performance.
But, can that Gr32 fast line implementation switch on fly to a different
surface geometries like rgb565, gray8, rgb24, etc. ? (while keeping
antialiasing and subpixel positioning ?)
Quote
What about compiling with C++ builder?
I know things gets done like that. I personally don't have a C++ Builder
and just for that I am not willing to buy one. So If I could ask
somebody on this list, who uses C++ builder on that level, Could you
people please try to compile TAggPas under it (or try to make it work)
and contribute it back to the community ?
Milano
 

Re:[ann] AggPas 2.4 RM 3 update

Very nice work!
 

Re:[ann] AggPas 2.4 RM 3 update

Milan
Quote
Maybe people on this list should also make proposals for more graphics
surfaces they daily use, to which TAgg2D should be able to
Attach for rendering.
I would love to see AggPas work with the ImageEn package
(www.hicomponents.com).
Uwe
 

Re:[ann] AggPas 2.4 RM 3 update

Uwe writes:
Quote
I would love to see AggPas work with the ImageEn package
(www.hicomponents.com).
Looking at documentation it should work straight away like this:
// Attach Some real data to TImageEnProc
ImageEnView1.Proc.AttachedBitmap:=Image1.Picture.Bitmap;
// Create instance of TAgg2D vector graphics engine
VG:=TAgg2D.Create;
// Attach vector graphics engine to an existing TBitmap from ImageEn
// (must be pf24bit or pf32bit)
if VG.Attach(ImageEnView1.Proc.AttachedBitmap ) then
begin
// Perform your own vector graphics tasks
VG.Line(10 ,10 ,20 ,20 );
VG.Font('Arial' ,20 );
VG.Text(40 ,40 ,'Hello World !' );
...
end;
If not, let me know and I include it as a special support
for ImageEn in the upcomming release.
Milano
 

Re:[ann] AggPas 2.4 RM 3 update

Milan,
Your code for ImageN does not work, but this does:
procedure TFrmMain.Button1Click( Sender: TObject );
begin
if OpenPictureDialog1.Execute then
begin
ImageEnView1.IO.LoadFromFile( OpenPictureDialog1.FileName );
ImageEnView1.Update;
end;
end;
procedure TFrmMain.Button2Click( Sender: TObject );
begin
// Attach vector graphics engine to an existing TBitmap from ImageEn
// (must be pf24bit or pf32bit)
if ImageEnView1.Bitmap <>nil then
begin
if VG.Attach( ImageEnView1.Bitmap ) then
begin
// Perform your own vector graphics tasks
VG.Line( 10, 10, 20, 20 );
VG.Font( 'Arial', 20 );
VG.Text( 40, 40, 'Hello World !' );
end;
end;
ImageEnView1.Update;
end;
procedure TFrmMain.FormCreate( Sender: TObject );
begin
// Create instance of TAgg2D vector graphics engine
VG := TAgg2D.Create;
end;
procedure TFrmMain.FormDestroy( Sender: TObject );
begin
VG.Free;
end;
 

Re:[ann] AggPas 2.4 RM 3 update

Hi Milan
Yes, you might be right that it works right out of the box. I will check
later today and get back to you in case it doesn't work.
Thanks
Uwe
"Milan Marusinec" <XXXX@XXXXX.COM>writes
Quote
Uwe writes:
>I would love to see AggPas work with the ImageEn package
>(www.hicomponents.com).

Looking at documentation it should work straight away like this:

// Attach Some real data to TImageEnProc
ImageEnView1.Proc.AttachedBitmap:=Image1.Picture.Bitmap;

// Create instance of TAgg2D vector graphics engine
VG:=TAgg2D.Create;

// Attach vector graphics engine to an existing TBitmap from ImageEn
// (must be pf24bit or pf32bit)
if VG.Attach(ImageEnView1.Proc.AttachedBitmap ) then
begin
// Perform your own vector graphics tasks
VG.Line(10 ,10 ,20 ,20 );
VG.Font('Arial' ,20 );
VG.Text(40 ,40 ,'Hello World !' );

...

end;

If not, let me know and I include it as a special support
for ImageEn in the upcomming release.

Milano
 

Re:[ann] AggPas 2.4 RM 3 update

Support for Gr32 Would be a great thing. :-)
Is this library can handle very large image like LibVips ?
www.vips.ecs.soton.ac.uk/index.php
Quote

Yeah, I will probably add a support function for attaching to Graphics32
bitmaps. Maybe people on this list should also make proposals for more
graphics surfaces they daily use, to which TAgg2D should be able to
Attach for rendering.