glass.eclipse.theme.utils
Class CGraphicUtils

java.lang.Object
  extended by glass.eclipse.theme.utils.CGraphicUtils

public class CGraphicUtils
extends Object

CGraphicUtils.java Thomas Hilbert 20.09.2009


Constructor Summary
CGraphicUtils()
           
 
Method Summary
static BufferedImage addPhotoBorder(BufferedImage src, int outer, int inner, Color colOuter, Color colInner)
          Adds a two colored border to the given image.
static BufferedImage CreateThumb(BufferedImage img, int thumbSize)
          Creates a thumb of the specified image with the given thumb size.
static BufferedImage getScaledInstance(BufferedImage img, int destw, int desth, Object hint)
          Gets a scaled instance of the source image.
static Shape MergeClipShapes(Shape destination, Shape currentClip)
          Merges the specified shapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGraphicUtils

public CGraphicUtils()
Method Detail

getScaledInstance

public static BufferedImage getScaledInstance(BufferedImage img,
                                              int destw,
                                              int desth,
                                              Object hint)
Gets a scaled instance of the source image. Uses Graphics2D for scaling.

Parameters:
img -
destw - Target width, -1 if width should be in correct aspect ratio to target height.
desth - Target height, -1 if height should be in correct aspect ratio to target width.
hint - See RenderingHints.VALUE_INTERPOLATION_XXX
Returns:

addPhotoBorder

public static BufferedImage addPhotoBorder(BufferedImage src,
                                           int outer,
                                           int inner,
                                           Color colOuter,
                                           Color colInner)
Adds a two colored border to the given image.

Parameters:
src -
outer -
inner -
colOuter -
colInner -
Returns:

CreateThumb

public static BufferedImage CreateThumb(BufferedImage img,
                                        int thumbSize)
Creates a thumb of the specified image with the given thumb size.

Parameters:
img -
thumbSize -
Returns:

MergeClipShapes

public static Shape MergeClipShapes(Shape destination,
                                    Shape currentClip)
Merges the specified shapes. In other words, returns the intersection of destination and currentClip

Parameters:
destination -
currentClip -
Returns: