public class RHImageUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
Color_magenta |
static float[] |
comps |
static float[] |
comps_mag |
static java.awt.Color |
customFillColor1_blue |
static java.awt.Color |
customFillColor1_green |
static java.awt.Color |
customFillColor1_red |
static java.awt.Color |
customFillColor10_blue |
static java.awt.Color |
customFillColor10_green |
static java.awt.Color |
customFillColor10_red |
static java.awt.Color |
customFillColor2_blue |
static java.awt.Color |
customFillColor2_green |
static java.awt.Color |
customFillColor2_mag |
static java.awt.Color |
customFillColor2_red |
static java.awt.Color |
customFillColor3_blue |
static java.awt.Color |
customFillColor3_green |
static java.awt.Color |
customFillColor3_red |
static java.awt.Color |
customFillColor4_blue |
static java.awt.Color |
customFillColor4_green |
static java.awt.Color |
customFillColor4_red |
static java.awt.Color |
customFillColor5_blue |
static java.awt.Color |
customFillColor5_green |
static java.awt.Color |
customFillColor5_red |
static java.awt.Color |
customFillColor6_blue |
static java.awt.Color |
customFillColor6_green |
static java.awt.Color |
customFillColor6_mag |
static java.awt.Color |
customFillColor6_red |
static java.awt.Color |
customFillColor7_blue |
static java.awt.Color |
customFillColor7_green |
static java.awt.Color |
customFillColor7_red |
static java.awt.Color |
customFillColor8_blue |
static java.awt.Color |
customFillColor8_green |
static java.awt.Color |
customFillColor8_red |
static java.awt.Color |
customFillColor9_blue |
static java.awt.Color |
customFillColor9_green |
static java.awt.Color |
customFillColor9_red |
static java.awt.Color |
drawColor |
static java.awt.Color |
enhancedColor |
static java.awt.Color |
enhancedFillColor |
static java.awt.Color |
fillColor |
Constructor and Description |
---|
RHImageUtils() |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
applyAlpha(java.awt.image.BufferedImage theImage,
int alpha)
This method returns an BufferedImage after applying an alpha (transparency) to it
|
static java.awt.image.BufferedImage |
clone(java.awt.image.BufferedImage inImage)
Returns a deep copy of the image
|
static java.awt.image.BufferedImage |
copyAddAlpha(java.awt.image.BufferedImage inImage)
Returns a deep copy of the image
|
static void |
copyByteBuffer(java.nio.ByteBuffer srcBuf,
int srcStep,
java.nio.ByteBuffer dstBuf,
int dstStep,
int channels) |
static java.awt.image.BufferedImage |
copyHasAlpha(java.awt.image.BufferedImage inImage)
Returns a deep copy of the image
|
static int |
countBlackPixels(java.awt.image.BufferedImage theImage)
counts how many pixels are black.
|
static int |
getColorDifference(byte[] cBGR1,
byte[] cBGR2)
get the average difference between two colors
|
static int |
getColorDifference(java.awt.Color col1,
java.awt.Color col2)
get the average difference between two colors
|
static int |
getColorDifference(float[] cBGR1,
float[] cBGR2)
get the average difference between two colors
|
static int |
getColorDifference(int[] cBGR1,
byte[] cBGR2)
get the average difference between two colors
|
static float[] |
getHSBColorVals(byte[] BGR)
returns the HSB color values for an RGB Color
|
static float[] |
getHSBColorVals(java.awt.Color aCol)
returns the HSB color values for an RGB Color
|
static boolean |
hasAlpha(java.awt.Image inImage)
returns whether the provided image has transparent pixels
|
static int |
lightenPixelValue(int pValueIn,
int by)
lightens a pixel value
|
static java.awt.Color |
makeRGBColor(int r,
int b,
int g)
Assembles a RGB color from individual color values
|
static int |
makeRGBColorInt(int r,
int b,
int g)
Assembles a RGB color int from individual color values
|
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image inImage)
This method returns a buffered image with the contents of an image
|
static java.awt.image.BufferedImage |
toBufferedImage(org.opencv.core.Mat inMat)
creates a new BufferedImage from an OpenCV Mat
|
static java.awt.image.BufferedImage |
toBufferedImage(org.openpnp.libuvc4j.uvc_frame frame,
int channels)
This method returns a buffered image with the contents of an uvc_frame
|
static java.awt.Image |
toImage(java.awt.image.BufferedImage inImage)
This method returns an image with the contents of a BufferedImage
|
static org.opencv.core.Mat |
toMat(java.awt.image.BufferedImage inBuffImg) |
public static java.awt.Color fillColor
public static java.awt.Color drawColor
public static java.awt.Color Color_magenta
public static float[] comps_mag
public static java.awt.Color customFillColor2_mag
public static java.awt.Color customFillColor6_mag
public static java.awt.Color enhancedColor
public static float[] comps
public static java.awt.Color enhancedFillColor
public static java.awt.Color customFillColor1_red
public static java.awt.Color customFillColor1_green
public static java.awt.Color customFillColor1_blue
public static java.awt.Color customFillColor2_red
public static java.awt.Color customFillColor2_green
public static java.awt.Color customFillColor2_blue
public static java.awt.Color customFillColor3_red
public static java.awt.Color customFillColor3_green
public static java.awt.Color customFillColor3_blue
public static java.awt.Color customFillColor4_red
public static java.awt.Color customFillColor4_green
public static java.awt.Color customFillColor4_blue
public static java.awt.Color customFillColor5_red
public static java.awt.Color customFillColor5_green
public static java.awt.Color customFillColor5_blue
public static java.awt.Color customFillColor6_red
public static java.awt.Color customFillColor6_green
public static java.awt.Color customFillColor6_blue
public static java.awt.Color customFillColor7_red
public static java.awt.Color customFillColor7_green
public static java.awt.Color customFillColor7_blue
public static java.awt.Color customFillColor8_red
public static java.awt.Color customFillColor8_green
public static java.awt.Color customFillColor8_blue
public static java.awt.Color customFillColor9_red
public static java.awt.Color customFillColor9_green
public static java.awt.Color customFillColor9_blue
public static java.awt.Color customFillColor10_red
public static java.awt.Color customFillColor10_green
public static java.awt.Color customFillColor10_blue
public static java.awt.image.BufferedImage clone(java.awt.image.BufferedImage inImage)
inImage
- the image to usepublic static java.awt.image.BufferedImage copyAddAlpha(java.awt.image.BufferedImage inImage)
inImage
- the image to usepublic static java.awt.image.BufferedImage copyHasAlpha(java.awt.image.BufferedImage inImage) throws java.lang.Exception
inImage
- the image to usejava.lang.Exception
public static boolean hasAlpha(java.awt.Image inImage) throws java.lang.Exception
inImage
- the image to usejava.lang.Exception
public static java.awt.image.BufferedImage toBufferedImage(org.opencv.core.Mat inMat)
inMat
- the 2D array of image datapublic static java.awt.image.BufferedImage toBufferedImage(java.awt.Image inImage) throws java.lang.Exception
inImage
- the image to convertjava.lang.Exception
public static java.awt.image.BufferedImage toBufferedImage(org.openpnp.libuvc4j.uvc_frame frame, int channels)
inImage
- the image to convertpublic static void copyByteBuffer(java.nio.ByteBuffer srcBuf, int srcStep, java.nio.ByteBuffer dstBuf, int dstStep, int channels)
public static java.awt.Image toImage(java.awt.image.BufferedImage inImage)
inImage
- the image to convertpublic static org.opencv.core.Mat toMat(java.awt.image.BufferedImage inBuffImg)
public static java.awt.image.BufferedImage applyAlpha(java.awt.image.BufferedImage theImage, int alpha) throws java.lang.Exception
theImage
- the image to convertjava.lang.Exception
public static int lightenPixelValue(int pValueIn, int by)
pValueIn
- the value to lighten upby
- the lighten factorpublic static float[] getHSBColorVals(byte[] BGR)
public static float[] getHSBColorVals(java.awt.Color aCol)
public static int makeRGBColorInt(int r, int b, int g)
r
- red valueb
- blue valueg
- green valuepublic static java.awt.Color makeRGBColor(int r, int b, int g)
r
- red valueb
- blue valueg
- green valuepublic static int getColorDifference(java.awt.Color col1, java.awt.Color col2)
col1
- color one stored as an intcol2
- color two stored as an intpublic static int getColorDifference(int[] cBGR1, byte[] cBGR2)
cBGR1
- color one stored as an array of bytescBGR2
- color two stored as an array of bytespublic static int countBlackPixels(java.awt.image.BufferedImage theImage)
theImage
- the BufferedImage to searchpublic static int getColorDifference(byte[] cBGR1, byte[] cBGR2)
cBGR1
- color one stored as an array of floatscBGR2
- color two stored as an array of floatspublic static int getColorDifference(float[] cBGR1, float[] cBGR2)
cBGR1
- color one stored as an array of floatscBGR2
- color two stored as an array of floatsRH, 2017