On 27. aug.. 2008, at 12.05, [EMAIL PROTECTED] wrote:
Calling the BufferedImage constructor directly or using one obtained through ImageIO or GraphicsConfiguration will return a managed image.
[...]
Further, if you try and grab the image data directly by calling getDataBuffer() on the Raster, then it will be permanently unaccelerated so if you want to make changes to the image, then stick with Graphics calls.
Just curious. I guess this is not the case, but... If I create a new BufferedImage from a Raster, and the Raster is again created from a DataBuffer created with a preallocated data array, will it still be managed/accelerated? I can easily hold on to and mutate the data array, and the docs clearly says the array is not cloned (for performance). Or is there some magic code that knows that I don't hold on to the reference any more?
In my ImageIO plugins I often access the data buffer directly, and write to the data array, because it's the fastest way to read typical pixel data. I guess I should stop doing that...
-- Harald K =========================================================================== 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".