[GRASS-dev] Re: [GRASS-user] [bug #3041] nviz max resolution
ppm image dump
Hamish
hamish_nospam at yahoo.com
Wed Aug 30 23:48:10 EDT 2006
Bob Covill wrote:
> Are any of the image tiles coming out correctly?
No.
> If not than the fault (in your case) may be with GS_write_zoom.
?
William Hargrove wrote:
> The 6.1.0 version of nviz dumps high res ppms perfectly after I
> comment out the off-screen section.
same here (it works!), GRASS 6.3-cvs:
[do_zoom.c]
/* create off-screen context if possible */
//#if defined(OPENGL_X11) && (defined(HAVE_PBUFFERS) ||
defined(HAVE_PIXMAPS))
#if 0
Bob:
> Is your computer using a 64 bit processor?
No. Plain old Pentium 4 32 bit.
Bob:
> If the problem is not the above, have you tried adjusting the nviz
> screen aspect slightly? This may correct any math errors that are
> being passed to the output images, such as 0 pixels wide.
I tried this, same error. All corner partial panels are broken.
Bob:
> I had a version of this from a while back where I moved all of the
> pnmcat stuff to the TCL side of nviz. This would get rid of the system
> commands in do_zoom.c and allow easier control in the script. For
> example you could check to see if pnmcat is installed, and if not
> pop-up a message box.
I had thought all versions of Mac came with netpbm, apparently not.
So I guess it's a problem.
Glynn Clements wrote:
> The problem appears to be that it computes the number of tiles as:
>
> var_i = (int) (maxx/(c-a)) + 1;
>
> when it should probably be:
>
> var_i = (int) ((maxx + c-a - 1)/(c-a));
>
> I.e. it rounds down then adds 1 rather than rounding up, resulting in
> one too many tiles when the total size is an exact multiple of the
> window size.
That may be correct, and by adding that change for x and y,
- var_i = (int) (maxx/(c-a)) + 1;
+ var_i = (int) ((maxx + c-a - 1)/(c-a));
- var_i = (int)(maxy/(d-b)) + 1;
+ var_i = (int) ((maxy + d-b - 1)/(d-b));
I get a constucted image, but it is still full of random bits of
yesterday's X. (GLX is enabled; GRASS_GLX* is not set)
With off-screen rendering disabled, I get good results with either of
the above var_i calculations.
Hamish
More information about the grass-dev
mailing list