Hi,

I am using Java2D to generate pseudo-satellite images from digitized
geo-spatial data.  I basically render to a large off-screen BufferedImage and
then write the BufferedImage out to disk as a Targa file.  My question relates
to the way I draw on the BufferedImage.  Besides using Shapes to draw things
like coastlines and roads, I also alter the color of individual pixels in order
to get realistic relief shading.  The pixels are shaded based on the position
of the sun and a digital elevation map.  Basically, the algorithm looks like
this

for( int x = 0; x < img.getWidth(); x++ )
{
  for( int y = 0; y < img.getHeight(); y++ )
  {
    int color = img.getRGB(x,y);
    color = shadePixel(color);
    img.setRGB(x,y,color);
  }
}

This works fine, but I'm wondering if this is the most efficient way to do
this.  Would it be better to retrieve the whole Raster object and use that or
is that essentially the same thing I'm doing here?  Any comments/suggestions
welcome.

Thanks,
Todd Klaus


__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one Place.
http://shopping.yahoo.com/

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to