• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BufferedImage versus VolatileImage

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The topic pretty much says it. In what cases is one image type preferable to the other, assuming the image is used for buffering - a long computation that results in an update to the image, which is then drawn on a JPanel. Also, just list any other advantages and disadvantages. I know volatile images may have to be restored at any time, but with that disadvantage, whats the advantage?

Thanks,

Andy
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disclaimer: I'm no expert on this stuff.

That said, the only advantage of VolatileImage that I'm aware of is that is is hardware accelerated, hence can provide some increase of speed for high fps games etc. On modern fast machines with adequate RAM, I don't think this makes a perceptible difference.

If a long computation is involved, I would say the better choice is BufferedImage.

Would be nice to know the views of anyone who has used VolatilImage to advantage.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a good in-depth discussion on VolatileImage on Chet Haase's Blog - VolatileImage Q&A
 
Andy Selador
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, thats exactly what I'm looking for. Volatile images seem kind of a hassle... at any moment the VRAM may be reclaimed, meaning if you had a separate thread perform the rendering, you have to instantiate and run it again (though I guess you could have a buffered image snapshot , but I'm don't know about performance issues and trade offs - is it better to redo the rendering on the volatile image and have that drawn to the screen, or to have a buffered image snapshot made during initial rendering, and have that drawn to the screen if the volatile image needs to be rerendered...).

Andy
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Nate, that's a good link.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic