Package ptolemy.actor.lib.image
Class Transform
- java.lang.Object
-
- ptolemy.actor.lib.image.Transform
-
public class Transform extends java.lang.Object
Transform an image by either rotating or scaling it.Some of the code in this file is based on code from http://download.oracle.com/javase/tutorial/extra/fullscreen/example.html.
- Since:
- Ptolemy II 3.0
- Version:
- $Id$
- Author:
- Christopher Hylands
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Constructor Summary
Constructors Constructor Description Transform()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Image
rotate(java.awt.Image originalImage, int rotate)
Rotate an Image.static java.awt.Image
scale(java.awt.Image originalImage, int maximumDimension)
Scale an image so that its maximum dimension is no larger than the maximumDimension parameter.
-
-
-
Method Detail
-
rotate
public static java.awt.Image rotate(java.awt.Image originalImage, int rotate)
Rotate an Image.- Parameters:
originalImage
- The java.awt.Image to rotate.rotate
- The number of degrees to rotate the originalImage- Returns:
- The rotated Image.
-
scale
public static java.awt.Image scale(java.awt.Image originalImage, int maximumDimension)
Scale an image so that its maximum dimension is no larger than the maximumDimension parameter. This method is useful for creating thumbnail images.- Parameters:
originalImage
- The java.awt.Image to rotate.maximumDimension
- The maximum x or y dimension- Returns:
- The scaled Image.
-
-