|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jimi.core.util.JimiUtil
This class contains several general utility methods which didnt really fit anywhere else.
The methods in this class are all static and hold no state.
This method uses an odd filename to create Error Image objects and Error ImageProducers which is a bit of a kludgey way to do it.
Field Summary | |
static boolean |
TRUE
|
Constructor Summary | |
JimiUtil()
|
Method Summary | |
static JimiRasterImage |
asJimiRasterImage(JimiImage ji)
Take a JimiImage which is really a raster image and return the JimiRasterImage object for it. |
static byte |
countBitsSet(int val)
This assumes that bits are set contiguously |
static void |
expandOneBitPixels(byte[] input,
byte[] output,
int count)
|
static void |
expandOneBitPixels(byte[] input,
byte[] output,
int count,
int inputOffset,
int outputOffset)
|
static void |
expandOneBitPixelsToBW(byte[] input,
int[] output,
int count,
int inputOffset,
int outputOffset)
|
static void |
expandPixels(int bitSize,
byte[] in,
byte[] out,
int outLen)
|
static boolean |
flagSet(int flaggedValue,
int flag)
|
static boolean |
flagsSet(int flaggedValue,
int flags)
|
static byte[] |
getChannelWidths(java.awt.image.ColorModel cm)
|
static java.awt.Image |
getErrorImage()
|
static java.awt.image.ImageProducer |
getErrorImageProducer()
|
static boolean |
isCompatibleWithJavaVersion(int major,
int minor)
|
static boolean |
isRGBDefault(java.awt.image.ColorModel cm)
Currently this method is a bit dumb in that it assumes that the rgb default color model is a DirectColorModel. |
static void |
packOneBitPixels(byte[] in,
int inByte,
byte[] out,
int base,
int outPixel,
int len)
This is more general version of JimiUtil.packPixels() but restricted for 1 bit pixels. |
static void |
packPixels(int[] in,
int sindex,
byte[] out,
int dindex,
int len)
Take pixels from buf each of depth 'depth' and stored in the least significant bits of byte. |
static int |
packPixels(int depth,
byte[] in,
byte[] out)
Take pixels from buf each of depth 'depth' and stored in the least significant bits of byte. |
static void |
pixelDepthChange(int depth,
byte[] buf,
int newDepth)
Designed to change the bit depth representation of pixel data. |
static void |
runCommands(java.util.Vector commands)
Run commands contained in a Vector of Runnables. |
static JimiImageFactory |
stripStamping(JimiImageFactory imageFactory)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final boolean TRUE
Constructor Detail |
public JimiUtil()
Method Detail |
public static boolean isRGBDefault(java.awt.image.ColorModel cm)
cm
- color model to check if its rgb default color modelpublic static byte[] getChannelWidths(java.awt.image.ColorModel cm)
cm
- color model to retrieve the individual channel widths.public static byte countBitsSet(int val)
val
- count the bits set in this variablepublic static java.awt.Image getErrorImage()
public static java.awt.image.ImageProducer getErrorImageProducer()
public static void expandPixels(int bitSize, byte[] in, byte[] out, int outLen)
bitSize
- the number of bits each pixel takes up in the
bitpacked input array. can only be 1, 2 or 4.in
- input array of bit packed pixelsout
- output array for expanded pixels. The size of this
array determines how many pixels are retrieved from in and
expanded.outLen
- number of bytes to expand into the the out buffer.public static void expandOneBitPixels(byte[] input, byte[] output, int count, int inputOffset, int outputOffset)
public static void expandOneBitPixelsToBW(byte[] input, int[] output, int count, int inputOffset, int outputOffset)
public static void expandOneBitPixels(byte[] input, byte[] output, int count)
public static void packOneBitPixels(byte[] in, int inByte, byte[] out, int base, int outPixel, int len)
in
- the source array containing one-pixel-per-byteinByte
- starting byte-index in sourceout
- the buffer to pack 8-bit-per-pixel bytes intobase
- the starting byte-index in outoutPixel
- the bit-index of the first pixel to copy tolen
- how many pixels [1 pixel per byte] of data from 'in' to copypublic static void packPixels(int[] in, int sindex, byte[] out, int dindex, int len)
depth
- depth of each pixel in buffer bufin
- input set of pixelsout
- the output buffer for packed pixels. The processing
continues until all pixels in the input buf are output to out[]public static int packPixels(int depth, byte[] in, byte[] out)
depth
- depth of each pixel in buffer bufin
- input set of pixelsout
- the output buffer for packed pixels. The processing
continues until all pixels in the input buf are output to out[]public static void pixelDepthChange(int depth, byte[] buf, int newDepth)
depth
- size of the pixel data stored in each entry in bufbuf
- buffer of one pixel per byte[] data to be modified so that
pixelnewDepth
- the depth to convert each pixel to in buf.public static JimiRasterImage asJimiRasterImage(JimiImage ji)
public static boolean flagSet(int flaggedValue, int flag)
public static boolean flagsSet(int flaggedValue, int flags)
public static JimiImageFactory stripStamping(JimiImageFactory imageFactory)
public static boolean isCompatibleWithJavaVersion(int major, int minor)
public static void runCommands(java.util.Vector commands)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |