[fpc-pascal] Implementing AggPas with PtcGraph
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Wed May 31 02:19:10 CEST 2017
On 2017-05-30 22:37, James Richters wrote:
> Putimage() takes
> Initial X position
> Initial Y position
> Pointer to beginning of memory bitmap
In that case the AggPas code should be even faster, because PutImage()
only want a pointer to the bitmap data - thus no need to go through the
slow FPImage code to generate a PNG or BMP image. The pixel-by-pixel
conversions for FPImage is very slow.
> Size := ImageSize(10, 20, 30, 40);
> GetMem(Q, Size); { Allocate memory on heap }
So you can do pretty much the same with AggPas then. Allocate the memory
you need, and attach that as the rendering buffer or AggPas. As I
mentioned before, AggPas just needs to know what memory it can write
too, and in what format you want that rendered data to be. AggPas
supports many render buffer formats. BGR, BGRA, RGB, RGBA, Gray8,
rgb555, rgb565 etc etc. And if an existing render buffer format doesn't
exist, it is really easy and quick to add a new one - just a few really
simple procedures to implement.
See the pf_*.inc files for plenty of examples. The "pf_" prefix stands
for "pixel format definition".
> I'm looking at it and I think getimage / putimage are just one byte per pixel... maybe?
I'll see if I can get graph or ptcgraph working working here under
FreeBSD, then I'll take a look at what pixel format they use.
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal
mailing list