View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Jun 11, 2009 4:48 am Post subject: |
|
|
Ian,
I do all my graphics drawing/painting in a %gr window, by manageing my own virtual screen. Each pixel has 4 attributes; red, green, blue and depth, all stored in my common block. This is to handle hidden line removal and some other effects. The surfaces I draw are limited to flat polygons with linearly varying values of RGBZ.
It is not as efficient/quick as opengl, but is fairly quick, at about 10 to 20 frames per second, for the type of graphics I draw (FEA). For photos it would be a bit slower.
The important point is that it does work fairly well. You could develop your own image definition in memory(RGB), then convert it and dump it.
To speed up the dump process, rather than process pixels, I look for lines of similar colour. This works very well for my FEA images, but would be less effective for photos. ( I think you can also get access to the %gr memory array via USER_SURFACE which would speed it up significantly. I'll have to look at than one day. )
I've found this approach very useful.
John |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Thu Jun 11, 2009 7:52 am Post subject: |
|
|
Ian,
I have now looked at your latest example program and it works well. One of the strengths of this simple algorithm is that the colour chosen is a colour that is present in the original picture and not a modified colour that is probably not present, if an averageing method is chosen.
John |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Jun 11, 2009 12:40 pm Post subject: |
|
|
Hi Ian,
Your solution follows my first suggestion (use colour of nearest old pixel). I'm glad it works.
Interpolation suggestions were for the situation that the result wasn't good enough. Mention of Lagrangian interpolation was to frighten you off doing anything complicated!
Every time we get a really satisfactory solution to a problem, it gets lost in the general morass of questions and unsatisfactory answers in these forums. Wouldn't it be a good idea to have a repository of good solutions?
Eddie |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Thu Jun 11, 2009 1:22 pm Post subject: |
|
|
I'll second that Eddie!
An online library of useful source code routines would be good, rather than have some vague recollection that I once saw a solution posted to that problem in some thread you have forgotten the name of! |
|
Back to top |
|
|
|