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://java.sun.com/docs/books/tutorial/extra/fullscreen/example.html.
- Since:
- Ptolemy II 3.0
- Version:
- $Id: Transform.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Christopher Hylands
- Accepted Rating:
- Proposed Rating:
Method Summary |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Transform
public Transform()
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.