public class ImageUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_IMAGE_TYPE
Default image type in case not provided
|
| Modifier and Type | Method and Description |
|---|---|
static java.awt.image.BufferedImage |
byteArrayToImage(byte[] imageData,
java.lang.String imgFileName)
Method to convert byte array to image
|
static java.awt.image.BufferedImage |
cropImage(java.awt.image.BufferedImage image,
int cropWidth,
int cropHeight)
Method crop an image to the given dimensions.
|
static java.awt.image.BufferedImage |
generateRandomImage(int numOfPixels)
Method to generate a random image filled with noise.
|
static java.awt.image.BufferedImage |
getDiffImage(java.awt.image.BufferedImage leftImage,
java.awt.image.BufferedImage rightImage)
Method generate difference image between two given images
|
static java.awt.image.BufferedImage |
getImageFromYuv(java.util.ArrayList yuv)
Get image (with RGB data) from given YUV data
|
static java.util.ArrayList |
getYuvFromImage(java.awt.image.BufferedImage image)
Get YUV data from given image's RGB data
|
static byte[] |
imageToByteArray(java.awt.image.BufferedImage image,
java.lang.String imageFileName,
OpenStegoPlugin plugin)
Method to convert BufferedImage to byte array
|
static java.awt.image.BufferedImage |
makeImageSquare(java.awt.image.BufferedImage image)
Method to pad an image such that it becomes perfect square.
|
static int |
pixelRange(double p)
Utility method to limit the value within [0,255] range
|
static int |
pixelRange(int p)
Utility method to limit the value within [0,255] range
|
public static java.lang.String DEFAULT_IMAGE_TYPE
public static java.awt.image.BufferedImage generateRandomImage(int numOfPixels)
throws OpenStegoException
numOfPixels - Number of pixels required in the imageOpenStegoExceptionpublic static byte[] imageToByteArray(java.awt.image.BufferedImage image,
java.lang.String imageFileName,
OpenStegoPlugin plugin)
throws OpenStegoException
image - Image dataimageFileName - Name of the image fileplugin - Reference to the pluginOpenStegoExceptionpublic static java.awt.image.BufferedImage byteArrayToImage(byte[] imageData,
java.lang.String imgFileName)
throws OpenStegoException
imageData - Image data as byte arrayimgFileName - Name of the image fileOpenStegoExceptionpublic static java.util.ArrayList getYuvFromImage(java.awt.image.BufferedImage image)
image - Imagepublic static java.awt.image.BufferedImage getImageFromYuv(java.util.ArrayList yuv)
yuv - List with three elements of two-dimensional int's - Y, U and Vpublic static int pixelRange(int p)
p - Input valuepublic static int pixelRange(double p)
p - Input valuepublic static java.awt.image.BufferedImage makeImageSquare(java.awt.image.BufferedImage image)
image - Input imagepublic static java.awt.image.BufferedImage cropImage(java.awt.image.BufferedImage image,
int cropWidth,
int cropHeight)
image - Input imagecropWidth - Width required for cropped imagecropHeight - Height required for cropped imagepublic static java.awt.image.BufferedImage getDiffImage(java.awt.image.BufferedImage leftImage,
java.awt.image.BufferedImage rightImage)
throws OpenStegoException
leftImage - Left input imagerightImage - Right input imageOpenStegoExceptionCopyright © 2007-2009 Samir Vaidya. All Rights Reserved.