Catalano.Imaging
Class FastBitmap
- java.lang.Object
-
- Catalano.Imaging.FastBitmap
-
public class FastBitmap extends java.lang.ObjectClass to handle image.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classFastBitmap.ColorSpaceColor space.static classFastBitmap.CoordinateSystemCoodinate system.
-
Constructor Summary
Constructors Constructor and Description FastBitmap()Initialize a new instance of the FastBitmap class.FastBitmap(java.awt.image.BufferedImage bufferedImage)Initialize a new instance of the FastBitmap class.FastBitmap(FastBitmap fastBitmap)Initialize a new instance of the FastBitmap class.FastBitmap(java.awt.Image image)Initialize a new instance of the FastBitmap class.FastBitmap(javax.swing.ImageIcon ico)Initialize a new instance of the FastBitmap class.FastBitmap(int[][] image)Initialize a new instance of the FastBitmap class.FastBitmap(int[][][] image)Initialize a new instance of the FastBitmap class.FastBitmap(int width, int height)Initialize a new instance of the FastBitmap class.FastBitmap(int width, int height, FastBitmap.ColorSpace colorSpace)Initialize a new instance of the FastBitmap class.FastBitmap(java.lang.String pathname)Initialize a new instance of the FastBitmap class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intclampValues(int value)Clamp values.intclampValues(int value, int min, int max)Clamp values.voidClear()Clear all the image.voidcreateGraphics()Create graphics.intgetAlpha(int offset)Get alpha channel's value.intgetAlpha(int x, int y)Get Alpha.int[]getARGB(int x, int y)Return ARGB color.int[]getARGB(IntPoint point)Return ARGB color.intgetBlue(int offset)Get blue channel's value.intgetBlue(int x, int y)Get Green.intgetBlue(IntPoint point)Get Blue.FastBitmap.ColorSpacegetColorSpace()Get Space color.FastBitmap.CoordinateSystemgetCoordinateSystem()Get the actually coordinate system.java.awt.GraphicsgetGraphics()Allow use Java`s Graphics.intgetGray(int offset)Get gray channel's value.intgetGray(int x, int y)Get Gray.intgetGray(IntPoint point)Get Gray.byte[]getGrayData()Retrieve the raw gray data from the Fast bitmap.intgetGreen(int offset)Get green channel's value.intgetGreen(int x, int y)Get Green.intgetGreen(IntPoint point)Get Green.intgetHeight()Get height.intgetPackedRGB(int offset)Get RGB color as an int representation.intgetPackedRGB(int x, int y)Get RGB color as an int representation.intgetPackedRGB(IntPoint point)Get RGB color as an int representation.intgetRed(int offset)Get red channel's value.intgetRed(int x, int y)Get Red.intgetRed(IntPoint point)Get Red.int[]getRGB(int offset)Return RGB color.int[]getRGB(int x, int y)Return RGB color.int[]getRGB(IntPoint point)Return RGB color.int[]getRGBData()Retrieve the raw rgb or argb data from the Fast bitmap.intgetSize()Get the size of the image in pixels.intgetWidth()Get width.booleanisARGB()Verify ARGB space color.booleanisGrayscale()Verify Grayscale space color.booleanisRGB()Verify RGB space color.voidmatrixToImage(double[][] image)Convert Array to FastBitmap.voidmatrixToImage(double[][][] image)Convert Array to FastBitmap.voidmatrixToImage(float[][] image)Convert Array to FastBitmap.voidmatrixToImage(float[][][] image)Convert Array to FastBitmap.voidmatrixToImage(int[][] image)Convert Array to FastBitmap.voidmatrixToImage(int[][][] image)Convert Array to FastBitmap.voidsaveAsBMP(java.lang.String pathname)Save FastBitmap as Bitmap.voidsaveAsGIF(java.lang.String pathname)Save FastBitmap as GIF.voidsaveAsJPG(java.lang.String pathname)Save FastBitmap as JPG.voidsaveAsJPG(java.lang.String pathname, float quality)Save FastBitmap as JPG.voidsaveAsJPG(java.lang.String pathname, float quality, int xDpi, int yDpi)Save FastBitmap as JPG.voidsaveAsPNG(java.lang.String pathname)Save FastBitmap as PNG.voidsetAlpha(int offset, int value)Set alpha channel's value.voidsetAlpha(int x, int y, int value)Set Alpha.voidsetARGB(int offset, int[] argb)Set ARGB values.voidsetARGB(int x, int y, int[] rgb)Set ARGB.voidsetARGB(int offset, int alpha, int red, int green, int blue)Set ARGB values.voidsetARGB(int x, int y, int alpha, int red, int green, int blue)Set ARGB.voidsetARGB(IntPoint point, int[] rgb)Set ARGB.voidsetARGB(IntPoint point, int alpha, int red, int green, int blue)Set ARGB.voidsetBlue(int offset, int value)Set blue channel's value.voidsetBlue(int x, int y, int value)Set Blue.voidsetBlue(IntPoint point, int value)Set Blue.voidsetCoordinateSystem(FastBitmap.CoordinateSystem coSystem)Set coordinate system.voidsetGray(int offset, int value)Set gray channel's value.voidsetGray(int x, int y, int value)Set Gray.voidsetGray(IntPoint point, int value)Set Gray.voidsetGrayData(byte[] data)Set the raw gray data in the Fast Bitmap.voidsetGreen(int offset, int value)Set green channel's value.voidsetGreen(int x, int y, int value)Set Green.voidsetGreen(IntPoint point, int value)Set Green.voidsetImage(java.awt.image.BufferedImage bufferedImage)Set image to FastBitmap.voidsetImage(FastBitmap fastBitmap)Set Image to Fast Bitmap.voidsetRed(int offset, int value)Set red channel's value.voidsetRed(int x, int y, int value)Set Red.voidsetRed(IntPoint point, int value)Set Red.voidsetRGB(int offset, Color color)Set RGB values.voidsetRGB(int offset, int color)Set RGB.voidsetRGB(int offset, int[] rgb)Set RGB values.voidsetRGB(int x, int y, Color color)Set RGB.voidsetRGB(int x, int y, int color)Set RGB.voidsetRGB(int x, int y, int[] rgb)Set RGB.voidsetRGB(int offset, int red, int green, int blue)Set RGB values.voidsetRGB(int x, int y, int red, int green, int blue)Set RGB.voidsetRGB(IntPoint point, Color color)Set RGB.voidsetRGB(IntPoint point, int color)Set RGB.voidsetRGB(IntPoint point, int[] rgb)Set RGB.voidsetRGB(IntPoint point, int red, int green, int blue)Set RGB.voidsetRGBData(int[] data)Set the raw rgb or argb data in the Fast Bitmap.voidtoARGB()Convert any others space colors to RGB.double[]toArrayGrayAsDouble()Convert the image to array of double representation.float[]toArrayGrayAsFloat()Convert the image to array of double representation.int[]toArrayGrayAsInt()Convert the image to array of double representation.java.awt.image.BufferedImagetoBufferedImage()Convert FastBitmap to BufferedImage.voidtoGrayscale()Convert any others space color to Grayscale.javax.swing.ImageIcontoIcon()Convert FastBitmap to Icon.java.awt.ImagetoImage()Convert FastBitmap to Image.double[][]toMatrixGrayAsDouble()Convert the image to matrix of double representation.float[][]toMatrixGrayAsFloat()Convert the image to matrix of float representation.int[][]toMatrixGrayAsInt()Convert the image to matrix of integer representation.double[][][]toMatrixRGBAsDouble()Convert the image to matrix of integer representation.float[][][]toMatrixRGBAsFloat()Convert the image to matrix of integer representation.int[][][]toMatrixRGBAsInt()Convert the image to matrix of integer representation.voidtoRGB()Convert any others space colors to RGB.
-
-
-
Constructor Detail
-
FastBitmap
public FastBitmap()
Initialize a new instance of the FastBitmap class.
-
FastBitmap
public FastBitmap(FastBitmap fastBitmap)
Initialize a new instance of the FastBitmap class.- Parameters:
fastBitmap- FastBitmap
-
FastBitmap
public FastBitmap(java.awt.image.BufferedImage bufferedImage)
Initialize a new instance of the FastBitmap class.- Parameters:
bufferedImage- Buffered image.
-
FastBitmap
public FastBitmap(java.awt.Image image)
Initialize a new instance of the FastBitmap class.- Parameters:
image- Image.
-
FastBitmap
public FastBitmap(javax.swing.ImageIcon ico)
Initialize a new instance of the FastBitmap class.- Parameters:
ico- Ico.
-
FastBitmap
public FastBitmap(java.lang.String pathname)
Initialize a new instance of the FastBitmap class.- Parameters:
pathname- The path that indicate a image.
-
FastBitmap
public FastBitmap(int width, int height)Initialize a new instance of the FastBitmap class.- Parameters:
width- Width.height- Height.
-
FastBitmap
public FastBitmap(int width, int height, FastBitmap.ColorSpace colorSpace)Initialize a new instance of the FastBitmap class.- Parameters:
width- Width.height- Height.colorSpace- Space color.
-
FastBitmap
public FastBitmap(int[][] image)
Initialize a new instance of the FastBitmap class.- Parameters:
image- Array.
-
FastBitmap
public FastBitmap(int[][][] image)
Initialize a new instance of the FastBitmap class.- Parameters:
image- Array.
-
-
Method Detail
-
getColorSpace
public FastBitmap.ColorSpace getColorSpace()
Get Space color.- Returns:
- Space color.
-
getGrayData
public byte[] getGrayData()
Retrieve the raw gray data from the Fast bitmap.- Returns:
- The data with the pixels values.
-
setGrayData
public void setGrayData(byte[] data)
Set the raw gray data in the Fast Bitmap.- Parameters:
data- Data.
-
getRGBData
public int[] getRGBData()
Retrieve the raw rgb or argb data from the Fast bitmap.- Returns:
- The data with pixels values.
-
getSize
public int getSize()
Get the size of the image in pixels.- Returns:
- Number of pixels.
-
setRGBData
public void setRGBData(int[] data)
Set the raw rgb or argb data in the Fast Bitmap.- Parameters:
data-
-
setImage
public void setImage(java.awt.image.BufferedImage bufferedImage)
Set image to FastBitmap.- Parameters:
bufferedImage- BufferedImage.
-
setImage
public void setImage(FastBitmap fastBitmap)
Set Image to Fast Bitmap.- Parameters:
fastBitmap- FastBitmap.
-
getCoordinateSystem
public FastBitmap.CoordinateSystem getCoordinateSystem()
Get the actually coordinate system.- Returns:
- Coordinate system.
-
setCoordinateSystem
public void setCoordinateSystem(FastBitmap.CoordinateSystem coSystem)
Set coordinate system.- Parameters:
coSystem- Coordinate system.
-
toBufferedImage
public java.awt.image.BufferedImage toBufferedImage()
Convert FastBitmap to BufferedImage.- Returns:
- Buffered Image.
-
toImage
public java.awt.Image toImage()
Convert FastBitmap to Image.- Returns:
- Image.
-
toIcon
public javax.swing.ImageIcon toIcon()
Convert FastBitmap to Icon.- Returns:
- Icon.
-
toGrayscale
public void toGrayscale()
Convert any others space color to Grayscale.
-
toARGB
public void toARGB()
Convert any others space colors to RGB.
-
toRGB
public void toRGB()
Convert any others space colors to RGB.
-
toArrayGrayAsDouble
public double[] toArrayGrayAsDouble()
Convert the image to array of double representation.- Returns:
- Array of the image.
-
toArrayGrayAsInt
public int[] toArrayGrayAsInt()
Convert the image to array of double representation.- Returns:
- Array of the image.
-
toArrayGrayAsFloat
public float[] toArrayGrayAsFloat()
Convert the image to array of double representation.- Returns:
- Array of the image.
-
toMatrixGrayAsInt
public int[][] toMatrixGrayAsInt()
Convert the image to matrix of integer representation.- Returns:
- Matrix of the image.
-
toMatrixGrayAsDouble
public double[][] toMatrixGrayAsDouble()
Convert the image to matrix of double representation.- Returns:
- Matrix of the image.
-
toMatrixGrayAsFloat
public float[][] toMatrixGrayAsFloat()
Convert the image to matrix of float representation.- Returns:
- Matrix of the image.
-
toMatrixRGBAsInt
public int[][][] toMatrixRGBAsInt()
Convert the image to matrix of integer representation.- Returns:
- Matrix of the image.
-
toMatrixRGBAsDouble
public double[][][] toMatrixRGBAsDouble()
Convert the image to matrix of integer representation.- Returns:
- Matrix of the image.
-
toMatrixRGBAsFloat
public float[][][] toMatrixRGBAsFloat()
Convert the image to matrix of integer representation.- Returns:
- Matrix of the image.
-
matrixToImage
public void matrixToImage(int[][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
matrixToImage
public void matrixToImage(float[][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
matrixToImage
public void matrixToImage(double[][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
matrixToImage
public void matrixToImage(int[][][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
matrixToImage
public void matrixToImage(float[][][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
matrixToImage
public void matrixToImage(double[][][] image)
Convert Array to FastBitmap.- Parameters:
image- Array.
-
Clear
public void Clear()
Clear all the image. Set all pixels with value 0.
-
getGraphics
public java.awt.Graphics getGraphics()
Allow use Java`s Graphics.- Returns:
- Graphics.
-
createGraphics
public void createGraphics()
Create graphics.
-
isGrayscale
public boolean isGrayscale()
Verify Grayscale space color.- Returns:
- True if is Grayscale, otherwise false.
-
isRGB
public boolean isRGB()
Verify RGB space color.- Returns:
- True if is RGB, otherwise false.
-
isARGB
public boolean isARGB()
Verify ARGB space color.- Returns:
- True if is ARGB, otherwise false.
-
getWidth
public int getWidth()
Get width.- Returns:
- Width.
-
getHeight
public int getHeight()
Get height.- Returns:
- Height.
-
getRGB
public int[] getRGB(int offset)
Return RGB color.- Parameters:
offset- Offset.- Returns:
- RGB.
-
getRGB
public int[] getRGB(int x, int y)Return RGB color.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- RGB.
-
getRGB
public int[] getRGB(IntPoint point)
Return RGB color.- Parameters:
point- Point.- Returns:
- RGB.
-
getPackedRGB
public int getPackedRGB(int offset)
Get RGB color as an int representation.- Parameters:
offset- Offset.- Returns:
- RGB.
-
getPackedRGB
public int getPackedRGB(int x, int y)Get RGB color as an int representation.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- RGB.
-
getPackedRGB
public int getPackedRGB(IntPoint point)
Get RGB color as an int representation.- Parameters:
point- Coordinate.- Returns:
- RGB.
-
getARGB
public int[] getARGB(int x, int y)Return ARGB color.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- ARGB.
-
getARGB
public int[] getARGB(IntPoint point)
Return ARGB color.- Parameters:
point- Point.- Returns:
- ARGB.
-
setRGB
public void setRGB(int x, int y, Color color)Set RGB.- Parameters:
x- X axis coordinates.y- Y axis coordinates.color- RGB color.
-
setRGB
public void setRGB(int x, int y, int red, int green, int blue)Set RGB.- Parameters:
x- X axis coordinates.y- Y axis coordinates.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setRGB
public void setRGB(IntPoint point, Color color)
Set RGB.- Parameters:
point- IntPoint.color- RGB color.
-
setRGB
public void setRGB(IntPoint point, int red, int green, int blue)
Set RGB.- Parameters:
point- IntPoint.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setRGB
public void setRGB(int x, int y, int[] rgb)Set RGB.- Parameters:
x- X axis coordinates.y- Y axis coordinates.rgb- RGB color.
-
setRGB
public void setRGB(int offset, int red, int green, int blue)Set RGB values.- Parameters:
offset- Offset.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setRGB
public void setRGB(int offset, int[] rgb)Set RGB values.- Parameters:
offset- Offset.rgb- RGB array.
-
setRGB
public void setRGB(int offset, Color color)Set RGB values.- Parameters:
offset- Offset.color- Color.
-
setRGB
public void setRGB(IntPoint point, int[] rgb)
Set RGB.- Parameters:
point- IntPoint.rgb- RGB color.
-
setRGB
public void setRGB(int offset, int color)Set RGB.- Parameters:
offset- Offset.color- RGB as int representation.
-
setRGB
public void setRGB(int x, int y, int color)Set RGB.- Parameters:
x- X axis coordinate.y- Y axis coordinate.color- RGB as int representation.
-
setRGB
public void setRGB(IntPoint point, int color)
Set RGB.- Parameters:
point- Point.color- RGB as int representation.
-
setARGB
public void setARGB(int x, int y, int alpha, int red, int green, int blue)Set ARGB.- Parameters:
x- X axis coordinates.y- Y axis coordinates.alpha- Alpha channel's value.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setARGB
public void setARGB(IntPoint point, int alpha, int red, int green, int blue)
Set ARGB.- Parameters:
point- IntPoint.alpha- Alpha channel's value.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setARGB
public void setARGB(int x, int y, int[] rgb)Set ARGB.- Parameters:
x- X axis coordinates.y- Y axis coordinates.rgb- ARGB color.
-
setARGB
public void setARGB(IntPoint point, int[] rgb)
Set ARGB.- Parameters:
point- IntPoint.rgb- ARGB color.
-
setARGB
public void setARGB(int offset, int alpha, int red, int green, int blue)Set ARGB values.- Parameters:
offset- Offset.alpha- Alpha channel's value.red- Red channel's value.green- Green channel's value.blue- Blue channel's value.
-
setARGB
public void setARGB(int offset, int[] argb)Set ARGB values.- Parameters:
offset- Offset.argb- ARGB array.
-
getGray
public int getGray(int x, int y)Get Gray.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- Gray channel's value.
-
getGray
public int getGray(IntPoint point)
Get Gray.- Parameters:
point- Point contains X and Y coordinates.- Returns:
- Gray channel's value.
-
getGray
public int getGray(int offset)
Get gray channel's value.- Parameters:
offset- Offset.
-
setGray
public void setGray(int offset, int value)Set gray channel's value.- Parameters:
offset- Offset.value- Gray channel's value.
-
setGray
public void setGray(int x, int y, int value)Set Gray.- Parameters:
x- X axis coordinate.y- Y axis coordinate.value- Gray channel's value.
-
setGray
public void setGray(IntPoint point, int value)
Set Gray.- Parameters:
point- IntPoint.value- Gray channel's value.
-
getAlpha
public int getAlpha(int x, int y)Get Alpha.- Parameters:
x- X Axis coordinate.y- Y Axis coordinate.- Returns:
- Alpha value.
-
getAlpha
public int getAlpha(int offset)
Get alpha channel's value.- Parameters:
offset- Offset.
-
setAlpha
public void setAlpha(int offset, int value)Set alpha channel's value.- Parameters:
offset- Offset.value- Alpha channel's value.
-
setAlpha
public void setAlpha(int x, int y, int value)Set Alpha.- Parameters:
x- X axis coordinate.y- Y axis coordinate.value- Alpha channel's value.
-
getRed
public int getRed(int x, int y)Get Red.- Parameters:
x- X axis component.y- Y axis component.- Returns:
- Red channel's value.
-
getRed
public int getRed(IntPoint point)
Get Red.- Parameters:
point- IntPoint.- Returns:
- Red channel's value.
-
getRed
public int getRed(int offset)
Get red channel's value.- Parameters:
offset- Offset.
-
setRed
public void setRed(int offset, int value)Set red channel's value.- Parameters:
offset- Offset.value- Red channel's value.
-
setRed
public void setRed(int x, int y, int value)Set Red.- Parameters:
x- X axis coordinate.y- Y axis coordinate.value- Red channel's value.
-
setRed
public void setRed(IntPoint point, int value)
Set Red.- Parameters:
point- IntPoint.value- Red channel's value.
-
getGreen
public int getGreen(int x, int y)Get Green.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- Green channel's value.
-
getGreen
public int getGreen(IntPoint point)
Get Green.- Parameters:
point- IntPoint.- Returns:
- Green channel's value.
-
getGreen
public int getGreen(int offset)
Get green channel's value.- Parameters:
offset- Offset.
-
setGreen
public void setGreen(int offset, int value)Set green channel's value.- Parameters:
offset- Offset.value- Green channel's value.
-
setGreen
public void setGreen(int x, int y, int value)Set Green.- Parameters:
x- X axis coordinate.y- Y axis coordinate.value- Green channel's value.
-
setGreen
public void setGreen(IntPoint point, int value)
Set Green.- Parameters:
point- IntPoint.value- Green channel's value.
-
getBlue
public int getBlue(int x, int y)Get Green.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- Blue channel's value.
-
getBlue
public int getBlue(IntPoint point)
Get Blue.- Parameters:
point- IntPoint.- Returns:
- Blue channel's value.
-
getBlue
public int getBlue(int offset)
Get blue channel's value.- Parameters:
offset- Offset.
-
setBlue
public void setBlue(int offset, int value)Set blue channel's value.- Parameters:
offset- Offset.value- Blue channel's value.
-
setBlue
public void setBlue(int x, int y, int value)Set Blue.- Parameters:
x- X axis coordinate.y- Y axis coordinate.value- Blue channel's value.
-
setBlue
public void setBlue(IntPoint point, int value)
Set Blue.- Parameters:
point- IntPoint.value- Blue channel's value.
-
clampValues
public int clampValues(int value)
Clamp values. [0,255]- Parameters:
value- Value.- Returns:
- Clamped value.
-
clampValues
public int clampValues(int value, int min, int max)Clamp values.- Parameters:
value- Value.min- Minimum value.max- Maximum value.- Returns:
- Clamped values.
-
saveAsBMP
public void saveAsBMP(java.lang.String pathname)
Save FastBitmap as Bitmap.- Parameters:
pathname- Path name.
-
saveAsPNG
public void saveAsPNG(java.lang.String pathname)
Save FastBitmap as PNG.- Parameters:
pathname- Path name.
-
saveAsGIF
public void saveAsGIF(java.lang.String pathname)
Save FastBitmap as GIF.- Parameters:
pathname- Path name.
-
saveAsJPG
public void saveAsJPG(java.lang.String pathname, float quality)Save FastBitmap as JPG.- Parameters:
pathname- Path name.quality- Quality.
-
saveAsJPG
public void saveAsJPG(java.lang.String pathname, float quality, int xDpi, int yDpi)Save FastBitmap as JPG.- Parameters:
pathname- Path name.quality- Quality.xDpi- X resolution DPI.yDpi- Y resolution DPI.
-
saveAsJPG
public void saveAsJPG(java.lang.String pathname)
Save FastBitmap as JPG.- Parameters:
pathname- Path name.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG