[gui] Add TYPE_BICUBIC to AffineTransformOp
Jerry Quinn
jlquinn@optonline.net
Wed Nov 3 06:10:00 GMT 2004
2004-11-03 Jerry Quinn <jlquinn@optonline.net>
* java/awt/image/AffineTransformOp.java: Add TYPE_BICUBIC.
Index: AffineTransformOp.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/AffineTransformOp.java,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 AffineTransformOp.java
--- AffineTransformOp.java 3 Nov 2004 04:22:24 -0000 1.1.2.8
+++ AffineTransformOp.java 3 Nov 2004 06:08:41 -0000
@@ -57,13 +57,15 @@
{
public static final int TYPE_NEAREST_NEIGHBOR = 1;
public static final int TYPE_BILINEAR = 2;
+ public static final int TYPE_BICUBIC = 3;
private AffineTransform transform;
private RenderingHints hints;
/**
* Construct AffineTransformOp with the given xform and interpolationType.
- * Interpolation type can be either TYPE_BILINEAR or TYPE_NEAREST_NEIGHBOR.
+ * Interpolation type can be TYPE_BILINEAR, TYPE_BICUBIC or
+ * TYPE_NEAREST_NEIGHBOR.
*
* @param xform AffineTransform that will applied to the source image
* @param interpolationType type of interpolation used
@@ -74,14 +76,20 @@
if (xform.getDeterminant() == 0)
throw new ImagingOpException(null);
- if (interpolationType == 0)
+ switch (interpolationType)
+ {
+ case TYPE_BILINEAR:
hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-
- else
+ break;
+ case TYPE_BICUBIC:
+ hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
+ RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ break;
+ default:
hints = new RenderingHints (RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
-
+ }
}
/**
More information about the Java-patches
mailing list