[GRASS-dev] Re: [GRASS-user] [bug #3041] nviz max resolution ppm image dump

Hamish hamish_nospam at yahoo.com
Wed Aug 30 01:14:28 EDT 2006


adding in some more debug statements:  [Before|After row x col]

Writing Tile 2 of 9
D0/0: Nstart_zoom_cmd(): [B1x3] img_width=1024  img_height=1024
D0/0: Nstart_zoom_cmd(): [B1x3] maxx=2048  XX=-2048  maxy=2048  YY=0 c=1024
  /* Re-set image width or height if required */
D0/0: Nstart_zoom_cmd(): [A1x3] img_width=0  img_height=1024


!! XX=-2048

	    if ((maxx + XX) < c)
		img_width = maxx + XX;
	    if ((maxy + YY) < d)
		img_height = maxy + YY;


XX,YY start as:


/* Set X & Y to zero for lower left corner */
    XX = YY = 0;

then in the for loops:

	    XX -= c;
	    cnt++;
	 } /* Done col */
	/* Reset XX and img_width */
	XX = 0;
	img_width = c;
	YY -= d;
    } /* done row */



Final Assembled Image will be 2048 x 2048
D0/0: Nstart_zoom_cmd(): XX=0  YY=0
D0/0: gsd_viewport(): l=0,b=0,r=2048,t=2048
D0/0: Nstart_zoom_cmd(): XX=0  YY=0
D0/0: Nstart_zoom_cmd(): [B1x1] img_width=1024  img_height=1024
D0/0: Nstart_zoom_cmd(): [B1x1] maxx=2048  XX=0  maxy=2048  YY=0 c=1024
D0/0: Nstart_zoom_cmd(): [A1x1] img_width=1024  img_height=1024
Writing Tile 1 of 9
D0/0: Nstart_zoom_cmd(): XX=-1024  YY=0
D0/0: gsd_viewport(): l=-1024,b=0,r=2048,t=2048
D0/0: Nstart_zoom_cmd(): XX=-1024  YY=0
D0/0: Nstart_zoom_cmd(): [B1x2] img_width=1024  img_height=1024
D0/0: Nstart_zoom_cmd(): [B1x2] maxx=2048  XX=-1024  maxy=2048  YY=0 c=1024
D0/0: Nstart_zoom_cmd(): [A1x2] img_width=1024  img_height=1024
Writing Tile 2 of 9
D0/0: Nstart_zoom_cmd(): XX=-2048  YY=0
D0/0: gsd_viewport(): l=-2048,b=0,r=2048,t=2048
D0/0: Nstart_zoom_cmd(): XX=-2048  YY=0
D0/0: Nstart_zoom_cmd(): [B1x3] img_width=1024  img_height=1024
D0/0: Nstart_zoom_cmd(): [B1x3] maxx=2048  XX=-2048  maxy=2048  YY=0 c=1024
D0/0: Nstart_zoom_cmd(): [A1x3] img_width=0  img_height=1024
Writing Tile 3 of 9
D0/0: Nstart_zoom_cmd(): XX=0  YY=-1024
D0/0: gsd_viewport(): l=0,b=-1024,r=2048,t=2048
D0/0: Nstart_zoom_cmd(): XX=0  YY=-1024
D0/0: Nstart_zoom_cmd(): [B2x1] img_width=1024  img_height=1024
D0/0: Nstart_zoom_cmd(): [B2x1] maxx=2048  XX=0  maxy=2048  YY=-1024 c=1024
D0/0: Nstart_zoom_cmd(): [A2x1] img_width=1024  img_height=1024
Writing Tile 4 of 9
...



if I change the XX and YY -= to += (just a guess) I don't get any errors
and it creates a single test.ppm which is 3072x3072, but the contents 
are still bogus.



Hamish




More information about the grass-dev mailing list