net.sourceforge.openstego.util
Class ImageUtil

java.lang.Object
  extended bynet.sourceforge.openstego.util.ImageUtil

public class ImageUtil
extends Object

Image utilities


Field Summary
static String DEFAULT_IMAGE_TYPE
          Default image type in case not provided
 
Constructor Summary
ImageUtil()
           
 
Method Summary
static BufferedImage byteArrayToImage(byte[] imageData, String imgFileName)
          Method to convert byte array to image
static int byteToInt(int b)
          Byte to Int converter
static BufferedImage generateRandomImage(int numOfPixels)
          Method to generate a random image filled with noise.
static byte[] imageToByteArray(BufferedImage image, String imageFileName, OpenStegoPlugin plugin)
          Method to convert BufferedImage to byte array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IMAGE_TYPE

public static String DEFAULT_IMAGE_TYPE
Default image type in case not provided

Constructor Detail

ImageUtil

public ImageUtil()
Method Detail

generateRandomImage

public static BufferedImage generateRandomImage(int numOfPixels)
                                         throws OpenStegoException
Method to generate a random image filled with noise.

Parameters:
numOfPixels - Number of pixels required in the image
Returns:
Random image filled with noise
Throws:
OpenStegoException

imageToByteArray

public static byte[] imageToByteArray(BufferedImage image,
                                      String imageFileName,
                                      OpenStegoPlugin plugin)
                               throws OpenStegoException
Method to convert BufferedImage to byte array

Parameters:
image - Image data
imageFileName - Name of the image file
plugin - Reference to the plugin
Returns:
Image data as byte array
Throws:
OpenStegoException

byteArrayToImage

public static BufferedImage byteArrayToImage(byte[] imageData,
                                             String imgFileName)
                                      throws OpenStegoException
Method to convert byte array to image

Parameters:
imageData - Image data as byte array
imgFileName - Name of the image file
Returns:
Buffered image
Throws:
OpenStegoException

byteToInt

public static int byteToInt(int b)
Byte to Int converter

Parameters:
b - Input byte value
Returns:
Int value


Copyright © 2007-2008 Samir Vaidya. All Rights Reserved.