类 TransformFilter

    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static int BILINEAR
      Use bilinear interpolation.
      static int CLAMP
      Clamp pixels to the image edges.
      protected int edgeAction
      The action to take for pixels off the image edge.
      protected int interpolation
      The type of interpolation to use.
      static int NEAREST_NEIGHBOUR
      Use nearest-neighbout interpolation.
      protected java.awt.Rectangle originalSpace
      The input image rectangle.
      static int RGB_CLAMP
      Clamp pixels RGB to the image edges, but zero the alpha.
      protected java.awt.Rectangle transformedSpace
      The output image rectangle.
      static int WRAP
      Wrap pixels off the edge onto the oppsoite edge.
      static int ZERO
      Treat pixels off the edge as zero.
    • 字段详细资料

      • ZERO

        public static final int ZERO
        Treat pixels off the edge as zero.
        另请参阅:
        常量字段值
      • CLAMP

        public static final int CLAMP
        Clamp pixels to the image edges.
        另请参阅:
        常量字段值
      • WRAP

        public static final int WRAP
        Wrap pixels off the edge onto the oppsoite edge.
        另请参阅:
        常量字段值
      • RGB_CLAMP

        public static final int RGB_CLAMP
        Clamp pixels RGB to the image edges, but zero the alpha. This prevents gray borders on your image.
        另请参阅:
        常量字段值
      • NEAREST_NEIGHBOUR

        public static final int NEAREST_NEIGHBOUR
        Use nearest-neighbout interpolation.
        另请参阅:
        常量字段值
      • BILINEAR

        public static final int BILINEAR
        Use bilinear interpolation.
        另请参阅:
        常量字段值
      • edgeAction

        protected int edgeAction
        The action to take for pixels off the image edge.
      • interpolation

        protected int interpolation
        The type of interpolation to use.
      • transformedSpace

        protected java.awt.Rectangle transformedSpace
        The output image rectangle.
      • originalSpace

        protected java.awt.Rectangle originalSpace
        The input image rectangle.
    • 构造器详细资料

      • TransformFilter

        public TransformFilter()
    • 方法详细资料

      • setEdgeAction

        public void setEdgeAction​(int edgeAction)
        Set the action to perform for pixels off the edge of the image.
        参数:
        edgeAction - one of ZERO, CLAMP or WRAP
        另请参阅:
        getEdgeAction()
      • getEdgeAction

        public int getEdgeAction()
        Get the action to perform for pixels off the edge of the image.
        返回:
        one of ZERO, CLAMP or WRAP
        另请参阅:
        setEdgeAction(int)
      • setInterpolation

        public void setInterpolation​(int interpolation)
        Set the type of interpolation to perform.
        参数:
        interpolation - one of NEAREST_NEIGHBOUR or BILINEAR
        另请参阅:
        getInterpolation()
      • getInterpolation

        public int getInterpolation()
        Get the type of interpolation to perform.
        返回:
        one of NEAREST_NEIGHBOUR or BILINEAR
        另请参阅:
        setInterpolation(int)
      • transformInverse

        protected abstract void transformInverse​(int x,
                                                 int y,
                                                 float[] out)
        Inverse transform a point. This method needs to be overriden by all subclasses.
        参数:
        x - the X position of the pixel in the output image
        y - the Y position of the pixel in the output image
        out - the position of the pixel in the input image
      • transformSpace

        protected void transformSpace​(java.awt.Rectangle rect)
        Forward transform a rectangle. Used to determine the size of the output image.
        参数:
        rect - the rectangle to transform
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dst)
      • filterPixelsNN

        protected java.awt.image.BufferedImage filterPixelsNN​(java.awt.image.BufferedImage dst,
                                                              int width,
                                                              int height,
                                                              int[] inPixels,
                                                              java.awt.Rectangle transformedSpace)