Advertisement

[java] drawImage and affinetransforms

Started by December 12, 2000 07:31 AM
0 comments, last by desti 24 years, 1 month ago
I''ve having some problems optimizing the Graphics2D.rotate function. This is mostly, because I''ve got a situation where nothing will get translated ie. the last column in my transform matrix is going to be 0, 0, 1. What I would like to do is use this to perform faster rotation. So where''s the actual code for drawImage located. Graphics2D.rotate is clearly nothing, but an abstract function, and the actual code is located in AffineTransform.java. Now affinetransform does nothing but manipulates the transform matrix, so the actual code for rotating an image has to be inside the drawImage routine. I tried grepping through the source in java.awt.image.*, but couldn''t find anything. Is this something that has actual code coded in java, or is it hardcoded into the JVM? If anyone know where the code should be, I''d appreciate it. Thanks Edvard Fagerholm
Stupid question, but I don''t feel like using my whole day digging the Java2D API refernce. So what''s the fastest and simplest way to turn an Image into an ImageProducer, so that I could manipulate myself.

The problem is that some of the images are changing, and I have to turn Images into intArrays or something very quickly. Is there any way to simply make your array point direclty to the image object so that I could quickly write pixels into it, or do I have to make a copy of a BufferedImage pixel by pixel into an array. Doing this would produce extra I/O, and that would hurt performance seriously.

I haven''t really been doing any extensive graphics programming in java, I''ve been doing everything relating to graphics in C & asm, so if someone could help me I''d appreciate it.

ps. basically I''ve solved my previous problem by using ImageProducers, but I haven''t seen a function turning an Image into an ARGB array, just the opposite.

This topic is closed to new replies.

Advertisement