aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
committerSven Gothel <[email protected]>2014-07-03 16:21:36 +0200
commit556d92b63555a085b25e32b1cd55afce24edd07a (patch)
tree6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
parenta90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
index df3cc4a39..4023a06f0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
@@ -50,8 +50,8 @@ public class ImageUtil {
/** Flips the supplied BufferedImage vertically. This is often a
necessary conversion step to display a Java2D image correctly
with OpenGL and vice versa. */
- public static void flipImageVertically(BufferedImage image) {
- WritableRaster raster = image.getRaster();
+ public static void flipImageVertically(final BufferedImage image) {
+ final WritableRaster raster = image.getRaster();
Object scanline1 = null;
Object scanline2 = null;
@@ -73,8 +73,8 @@ public class ImageUtil {
*
* @return A instance of <code>BufferedImage</code> with a type compatible with the graphics card.
*/
- public static BufferedImage createCompatibleImage(int width, int height) {
- GraphicsConfiguration configuration =
+ public static BufferedImage createCompatibleImage(final int width, final int height) {
+ final GraphicsConfiguration configuration =
GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration();
return configuration.createCompatibleImage(width, height);
@@ -92,7 +92,7 @@ public class ImageUtil {
*
* @return A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
*/
- public static BufferedImage createThumbnail(BufferedImage image, int thumbWidth) {
+ public static BufferedImage createThumbnail(final BufferedImage image, final int thumbWidth) {
// Thanks to Romain Guy for this utility
if (thumbWidth > image.getWidth()) {
throw new IllegalArgumentException("Thumbnail width must be greater than image width");
@@ -102,7 +102,7 @@ public class ImageUtil {
return image;
}
- float ratio = (float) image.getWidth() / (float) image.getHeight();
+ final float ratio = (float) image.getWidth() / (float) image.getHeight();
int width = image.getWidth();
BufferedImage thumb = image;
@@ -112,8 +112,8 @@ public class ImageUtil {
width = thumbWidth;
}
- BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
- Graphics2D g2 = temp.createGraphics();
+ final BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
+ final Graphics2D g2 = temp.createGraphics();
g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);