axe pixmapgraphics update

BlitzMax Forums/BlitzMax Programming/axe pixmapgraphics update

skidracer(Posted 2009) [#1]
This is a work in progress module that lets you draw directly to a pixmap.



Personally I am interested in removing hardware accelerated requirement of current BlitzMax drivers for targetting esoteric linux devices but others may be interested in the possibility of reducing their dependence on the GrabImage command for simple compositing operations.

http://max-edit.googlecode.com/svn/trunk/mod/axe.mod/pixmapgraphics.mod

If you are interested, please test. The pixel format of the included test may make it break on Mac and blending of the 32 bit png seems a little faulty, but yes, text and basic drawimage commands are now somewhat supported.


pixel formats: argb32 only

done:

Method SetLineWidth( width# )
Method Cls()
Method Plot( x#,y# )
Method DrawLine( lx0#,ly0#,lx1#,ly1#,tx#,ty# )
Method DrawPoly( xy#[],handlex#,handley#,originx#,originy# )
Method DrawRect( lx0#,ly0#,lx1#,ly1#,tx#,ty# )
Method DrawPixRect( lx0#,ly0#,lx1#,ly1#,tx#,ty#,srcpix:TPixmap )

need help:

Method DrawOval( lx0#,ly0#,lx1#,ly1#,tx#,ty# )
Method DrawPixmap( pixmap:TPixmap,x,y )
Method GrabPixmap:TPixmap( x,y,width,height )

todo:

Method SetBlend( blend )
Method SetAlpha( alpha# )
Method SetColor( red,green,blue )
Method SetClsColor( red,green,blue )
Method SetViewport( x,y,width,height )

doubtful:
Method SetTransform( xx#,xy#,yx#,yy# )


Ked(Posted 2009) [#2]
Cool! Downloading now!

Edit: Err.. User name and password?!


skidracer(Posted 2009) [#3]
oops its just http for public, fixed...

btw, that's a subversion address, for browsing you will need to download the 3 files to a %blitzmax%/mod/axe.mod/pixmapgraphics.mod folder of your own making


Amon(Posted 2009) [#4]
Downloading now!


Difference(Posted 2009) [#5]
Working well here. (Mac Mini nVidia 9400M, Snow Leopard )


GaryV(Posted 2009) [#6]
Personally I am interested in removing hardware accelerated requirement of current BlitzMax drivers


Thank you, Thank you, Thank you!


ImaginaryHuman(Posted 2009) [#7]
Looks nice. Try adding my oval-drawing code in the code archives - under bmx graphics - non rotatable but it'd work for drawing filled/unfilled to a pixmap.


Mr. Write Errors Man(Posted 2009) [#8]
Excellence. Will test it out.


Pete Rigz(Posted 2009) [#9]
Hmm very interesting, thanks for the mod!

I'm wondering how useful this would be for my particle editor. If you can render straight to a pixmap then that'd simplify a lot of things especially rendering to frames larger then the screen. But then the main question I have is, would it have the same quality as hardware accelerated drawing when scaling, rotating etc once they're implemented?


skidracer(Posted 2009) [#10]
Rotation will never be practical for this implementation. Scaling maybe. I would consider Cairo (Brucey mod) or AGG (could be bolted on to this module in future perhaps) if you aren't constrained to real time performance.


theHand(Posted 2009) [#11]
I'll test, but please make the whole SVN accessible. Sorry, I just ran out of time, and won't be able to test. Will test later.
RapidSVN returns "Error: Error while performing action: Repository access denied."
right after these two: "Added: /home/diamond/SVN_storage/max-edit/mod/axe3d.mod/assimp.mod/boost/bimap.hpp
Updated: /home/diamond/SVN_storage/max-edit/mod/axe3d.mod/assimp.mod/boost"

Pardon my ignorance, I assumed that axe3d.mod was the only one that got downloaded.

If you are talking about adding to this, wouldn't it be better to use something like GGI (BSD license)? (If you are talking about modifications--that we can do ourselves--that you know from experience are possible, then I apologize.)


Brucey(Posted 2009) [#12]
or AGG (could be bolted on to this module in future perhaps)

Would be nice if it wasn't for its GPL license - I'd have wrapped it already if it wasn't for that.


skidracer(Posted 2009) [#13]
I was thinking of what I call agg lite. It's a single file implementation with free license and some nice credits to the freetype guy who originated the basic scan line conversion algorithm.

For more recent releases some would argue AGG guy devoted too much time on a hurried svg implementation and ended up with less than optimal hacks, although the separate alpha accumulation stuff he has written about is dead interesting. I don't think his new stuff fixes (it's not broken) or speeds up any of the basics, it just buries them deeper with documentation that leaves the reader at the peak of their interest with a "to be continued".

I love a good antialias line (I think I'd pick Wu for this module). The problem is gamma correction which becomes critical when you want to out perform HW AA in terms of quality.


Difference(Posted 2009) [#14]
I corresponded with Andreas Shiffler who gave me permission to use his code, back when I made a 2D lib "TooD" for BlitzBasic

He made some code for SDL that worked quite well.

http://www.ferzkopp.net/joomla/content/view/19/14/

It might be worth a look.


Difference(Posted 2009) [#15]
Hey! I found TooD and put it here for now: /Community/posts.php?topic=87923


skidracer(Posted 2009) [#16]
AGG lite line and polygon drawing is in and seems to be working.

Big thanks to those helping to test, edits at top.


skidracer(Posted 2015) [#17]
Rest in peace Maxim Shemanarev.

Your AGG template code is the best.