Class CloudSpin

java.lang.Object
com.jackmeng.halcyoninae.cloudspin.CloudSpin

public final class CloudSpin extends Object
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 Details

    • CloudSpin

      private CloudSpin()
  • Method Details

    • forPixels

      public static int[] forPixels(BufferedImage img)
      Macro Methods
      Parameters:
      img - A bufferedImage
      Returns:
      An int array representing the individual pixels of the image.
    • colorTone

      @Deprecated(forRemoval=true) public static void colorTone(BufferedImage img, Color tone)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used and defunct AF
      This method will apply a toner on the original image.
      Parameters:
      img - The original image.
      tone - The tone of the color to shift to.
    • applyMask

      public static BufferedImage applyMask(BufferedImage img, BufferedImage mask, int method)
      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

      public static Image iconToImage(Icon icon)
      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

      public static BufferedImage grabCrop(BufferedImage target, Rectangle w, int... points)
      Parameters:
      target -
      w -
      Returns:
      BufferedImage
    • grabCropSafe

      public static void grabCropSafe(BufferedImage target, Rectangle w)
      Parameters:
      target -
      w -
    • hueImage

      public static void hueImage(BufferedImage image, int[] color)
      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

      public static BufferedImage hueImageUnsafe(BufferedImage img, int[] color)
      Parameters:
      img -
      color -
      Returns:
      BufferedImage
    • createUnknownIMG

      public static BufferedImage createUnknownIMG()
      Returns:
      BufferedImage
    • resizeToFitViewport

      public static BufferedImage resizeToFitViewport(Dimension viewport, BufferedImage src)
      Parameters:
      viewport -
      src -
      Returns: