Class ImageProcessingOperations

java.lang.Object
com.idrsolutions.image.process.ImageProcessingOperations
All Implemented Interfaces:
ImageProcessingOps

public class ImageProcessingOperations extends Object implements ImageProcessingOps
  • Constructor Details

    • ImageProcessingOperations

      public ImageProcessingOperations()
  • Method Details

    • apply

      public BufferedImage apply(BufferedImage image)
      Applies the chosen image operation/operations to the image.
      Specified by:
      apply in interface ImageProcessingOps
      Parameters:
      image - BufferedImage to apply the processing operation to.
      Returns:
      BufferedImage The new image.
    • blur

      Adds the blur operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the blur operation.
    • custom

      public ImageProcessingOperations custom(ImageOperation custom)
      Adds the custom operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      custom - ImageOperation to be applied
      Returns:
      This instance of ImageProcessingOperations that includes the custom operation.
    • clip

      public ImageProcessingOperations clip(Shape s, boolean clipToShape)
    • crop

    • edgeDetection

      public ImageProcessingOperations edgeDetection()
      Adds the edge detection operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the edge detection operation.
    • emboss

      public ImageProcessingOperations emboss()
      Adds the emboss operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the emboss operation.
    • exposure

      public ImageProcessingOperations exposure(float exposure)
      Adds the exposure operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      exposure - float amount of exposure to apply
      Returns:
      This instance of ImageProcessingOperations that includes the exposure operation.
    • gaussianBlur

      public ImageProcessingOperations gaussianBlur()
      Adds the gaussian blur operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the gaussian blur operation.
    • invertColors

      public ImageProcessingOperations invertColors()
      Adds the invert colors operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the invert colors operation.
    • kernel

      public ImageProcessingOperations kernel(float[] kernel)
      Adds the Kernel operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      kernel - float[] of kernel to apply
      Returns:
      The updated ImageProcessingOperations that includes the kernel operation.
    • brighten

      public ImageProcessingOperations brighten(float percent)
      Adds the Brighten operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      percent - float percentage to brighten
      Returns:
      The updated ImageProcessingOperations that includes the brighten operation.
    • mirror

      public ImageProcessingOperations mirror(com.idrsolutions.image.process.MirrorOperations mirrorOp)
      Adds the mirror operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      mirrorOp - enum of which mirroring operation to do
      Returns:
      This instance of ImageProcessingOperations that includes the mirror operation.
    • mirror

      public ImageProcessingOperations mirror()
      Adds the mirror operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the mirror operation.
    • resizeToFit

      public ImageProcessingOperations resizeToFit(int newWidth, int newHeight)
      Adds the resize to fit operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      newWidth - Integer of new width
      newHeight - Integer of new height
      Returns:
      This instance of ImageProcessingOperations that includes the resize to fit operation.
    • resizeToHeight

      public ImageProcessingOperations resizeToHeight(int newHeight)
      Adds the resize to height operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      newHeight - Integer of new height
      Returns:
      This instance of ImageProcessingOperations that includes the resize to height operation.
    • resizeToWidth

      public ImageProcessingOperations resizeToWidth(int newWidth)
      Adds the resize to width operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      newWidth - Integer of new width
      Returns:
      This instance of ImageProcessingOperations that includes the resize to width operation.
    • rotate

      public ImageProcessingOperations rotate(double degrees)
      Adds the rotate operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      degrees - Double of degrees to rotate the image
      Returns:
      This instance of ImageProcessingOperations that includes the rotate operation.
    • scale

      public ImageProcessingOperations scale(double scaling)
      Adds the scale operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      scaling - Double of scale to apply the image
      Returns:
      This instance of ImageProcessingOperations that includes the scale operation.
    • scale

      public ImageProcessingOperations scale(double scaling, int interpolation)
      Adds the scale operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      scaling - Double of scale to be applied
      interpolation - Integer of interpolation to be applied
      Returns:
      This instance of ImageProcessingOperations that includes the scale operation.
    • sharpen

      public ImageProcessingOperations sharpen()
      Adds the sharpen operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the sharpen operation.
    • stretchToFill

      public ImageProcessingOperations stretchToFill(int newWidth, int newHeight)
      Adds the stretch to fill operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      newWidth - Integer of new width
      newHeight - Integer of new height
      Returns:
      This instance of ImageProcessingOperations that includes the stretch to fill operation.
    • superScale2x

      public ImageProcessingOperations superScale2x()
      Adds the super scale 2x operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the super scale 2x operation.
    • toARGB

      public ImageProcessingOperations toARGB()
      Adds the toARGB operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the toARGB operation.
    • toBinary

      public ImageProcessingOperations toBinary()
      Adds the toBinary operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the toBinary operation.
    • toGrayscale

      public ImageProcessingOperations toGrayscale()
      Adds the toGrayscale operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the toGrayscale operation.
    • toIndexed

      public ImageProcessingOperations toIndexed()
      Adds the toIndexed operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the toIndexed operation.
    • toRGB

      public ImageProcessingOperations toRGB()
      Adds the toRGB operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Returns:
      This instance of ImageProcessingOperations that includes the toRGB operation.
    • qualityScale

      public ImageProcessingOperations qualityScale(double scaling)
      Adds the quality scale operation to a list of operations to be applied.
      See the JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      scaling - Double of the scale to be applied
      Returns:
      This instance of ImageProcessingOperations that includes the quality scale operation.
    • thumbnail

      public ImageProcessingOperations thumbnail(int width, int height)
      Adds the thumbnail operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use.
      Parameters:
      height - Integer of the thumbnail height
      width - Integer of the thumbnail width
      Returns:
      This instance of ImageProcessingOperations that includes the thumbnail operation.
    • watermark

      public ImageProcessingOperations watermark(String text, Color color, Font font, Watermark.WatermarkPosition pos)
      Adds the watermark operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      text - String text to be displayed as watermark, '\n' will divide watermark across multiple lines
      color - Color to be used to represent text watermark
      font - font style to represent text watermark
      pos - Enum WatermarkPosition which represents the position of the Watermark for centre or fit to image position
      Returns:
      This instance of ImageProcessingOperations that includes the watermark operation.
    • watermark

      public ImageProcessingOperations watermark(BufferedImage watermarkImage, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite)
      Adds the watermark operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      watermarkImage - BufferedImage of image to watermark
      pos - Enum WatermarkPosition which represents the position of the Watermark for centre or fit to image position
      alphaComposite - AlphaComposite to be used when applying watermark
      Returns:
      This instance of ImageProcessingOperations that includes the watermark operation.
    • watermark

      public ImageProcessingOperations watermark(Shape shape, Color color, Watermark.WatermarkPosition pos, AlphaComposite alphaComposite, Watermark.WatermarkShapeProperties properties)
      Adds the watermark operation to a list of operations to be applied.
      See JDeli tutorials for more information on how to use this processing operation.
      Parameters:
      shape - Shape to use when applying watermark
      color - Color to be used to represent text watermark
      pos - Enum WatermarkPosition which represents the position of the Watermark for centre or fit to image position
      alphaComposite - AlphaComposite to be used when applying watermark
      properties - Enum WatermarkShapeProperties to use when applying the watermark
      Returns:
      The instance of ImageProcessingOperations that includes the watermark operation.
    • undo

    • redo

    • operationsListSize

      public int operationsListSize()