Class CloudSpin
java.lang.Object
com.jackmeng.halcyoninae.cloudspin.CloudSpin
This class is used for general graphical manipulation.
For example taking an image and blurring it.
This package is intended to replace the overburdened
DeImage
which has been here since 2.0 and features the old burden class style of
having a util
class that handles a lot of functions.
- Since:
- 3.2
- Author:
- Jack Meng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImageapplyMask(BufferedImage img, BufferedImage mask, int method) static voidcolorTone(BufferedImage img, Color tone) Deprecated, for removal: This API element is subject to removal in a future version.Not used and defunct AFstatic BufferedImagecreateGradient(BufferedImage src, int startOpacity, int endOpacity, int startX, int startY, int endX, int endY) static BufferedImagestatic int[]forPixels(BufferedImage img) Macro Methodsstatic BufferedImagegrabCrop(BufferedImage target, Rectangle w, int... points) static voidgrabCropSafe(BufferedImage target, Rectangle w) static voidhueImage(BufferedImage image, int[] color) Applies a specific hue upon the image.static BufferedImagehueImageUnsafe(BufferedImage img, int[] color) static ImageiconToImage(Icon icon) A lite util method to convert an Icon to an Image preferable for use as a BufferedImage.static int[]pixelRGBA(int pixel) static BufferedImageresizeToFitViewport(Dimension viewport, BufferedImage src)
-
Constructor Details
-
CloudSpin
private CloudSpin()
-
-
Method Details
-
forPixels
Macro Methods- Parameters:
img- A bufferedImage- Returns:
- An int array representing the individual pixels of the image.
-
colorTone
Deprecated, for removal: This API element is subject to removal in a future version.Not used and defunct AFThis method will apply a toner on the original image.- Parameters:
img- The original image.tone- The tone of the color to shift to.
-
applyMask
- Parameters:
img-mask-method-- Returns:
- BufferedImage
-
createGradient
public static BufferedImage createGradient(BufferedImage src, int startOpacity, int endOpacity, int startX, int startY, int endX, int endY) - Parameters:
src-startOpacity-endOpacity-startX-startY-endX-endY-- Returns:
- BufferedImage
-
pixelRGBA
public static int[] pixelRGBA(int pixel) -
iconToImage
A lite util method to convert an Icon to an Image preferable for use as a BufferedImage.- Parameters:
icon- An Icon to convert.- Returns:
- An Image after the conversion.
-
grabCrop
- Parameters:
target-w-- Returns:
- BufferedImage
-
grabCropSafe
- Parameters:
target-w-
-
hueImage
Applies a specific hue upon the image. This method tries to preserve the pixel's original Alpha, however depending on the given hue, this is not guranteed.This method will not return anything, use the same object as you passed in by reference.
This method will perform bound checks upon the hue and will only take the first 3 elements
- Parameters:
image- A desired image to alter (java.awt.image.BufferedImage)color- A Color to shift the pixels to (int[]). Where hue[0] is RED, hue[1] is GREEN, and hue[2] is BLUE- Since:
- 3.3
-
hueImageUnsafe
- Parameters:
img-color-- Returns:
- BufferedImage
-
createUnknownIMG
- Returns:
- BufferedImage
-
resizeToFitViewport
- Parameters:
viewport-src-- Returns:
-