/* */ package quicktime.std.image;
/* */
/* */ import java.io.IOException;
/* */ import java.io.ObjectInputStream;
/* */ import java.io.ObjectOutputStream;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.util.EndianOrder;
/* */ import quicktime.util.QTByteObject;
/* */
/* */ public class ICMPixelFormatInfo extends QTByteObject
/* */ {
/* */ private static final int kNativeSize = 36;
/* 34 */ private static byte[] ar = new byte[36];
/* */ static final long serialVersionUID = 8739457055061219117L;
/* */
/* */ public static boolean isValidPixelFormat(int paramInt)
/* */ {
/* 43 */ int i = ICMGetPixelFormatInfo(paramInt, ar);
/* 44 */ return i == 0;
/* */ }
/* */
/* */ public static ICMPixelFormatInfo setPixelFormatInfo(int paramInt)
/* */ throws StdQTException
/* */ {
/* 54 */ if (!QTSession.isCurrentOS(4)) {
/* 55 */ ICMPixelFormatInfo localICMPixelFormatInfo = new ICMPixelFormatInfo();
/* 56 */ int i = ICMSetPixelFormatInfo(paramInt, localICMPixelFormatInfo.getBytes());
/* 57 */ StdQTException.checkError(i);
/* 58 */ return localICMPixelFormatInfo;
/* */ }
/* 60 */ throw new QTRuntimeException("Unsupported OS");
/* */ }
/* */
/* */ public static ICMPixelFormatInfo getPixelFormatInfo(int paramInt)
/* */ throws StdQTException
/* */ {
/* 72 */ ICMPixelFormatInfo localICMPixelFormatInfo = new ICMPixelFormatInfo();
/* 73 */ int i = ICMGetPixelFormatInfo(paramInt, localICMPixelFormatInfo.getBytes());
/* 74 */ StdQTException.checkError(i);
/* 75 */ return localICMPixelFormatInfo;
/* */ }
/* */
/* */ private ICMPixelFormatInfo() {
/* 79 */ super(36);
/* */ }
/* */
/* */ private void readObject(ObjectInputStream paramObjectInputStream)
/* */ throws IOException
/* */ {
/* 87 */ this.bytes = new byte[36];
/* */
/* 89 */ paramObjectInputStream.read(this.bytes);
/* */
/* 91 */ int i = getIntFromArray(this.bytes, 0);
/* 92 */ int j = EndianOrder.flipBigEndianToNative32(i);
/* 93 */ setIntInArray(this.bytes, 0, j);
/* */
/* 95 */ int k = getIntFromArray(this.bytes, 4);
/* 96 */ int m = EndianOrder.flipBigEndianToNative32(k);
/* 97 */ setIntInArray(this.bytes, 4, m);
/* */
/* 99 */ for (int n = 8; n < 36; n += 2) {
/* 100 */ short s1 = getShortFromArray(this.bytes, n);
/* 101 */ short s2 = EndianOrder.flipBigEndianToNative16(s1);
/* 102 */ setShortInArray(getBytes(), n, s2);
/* */ }
/* */ }
/* */
/* */ private void writeObject(ObjectOutputStream paramObjectOutputStream)
/* */ throws IOException
/* */ {
/* 109 */ byte[] arrayOfByte = new byte[36];
/* */
/* 111 */ int i = getIntFromArray(getBytes(), 0);
/* 112 */ int j = EndianOrder.flipNativeToBigEndian32(i);
/* 113 */ setIntInArray(arrayOfByte, 0, j);
/* */
/* 115 */ int k = getFormatFlags();
/* 116 */ int m = EndianOrder.flipNativeToBigEndian32(i);
/* 117 */ setIntInArray(arrayOfByte, 4, m);
/* */
/* 119 */ for (int n = 8; n < 36; n += 2) {
/* 120 */ short s1 = getShortFromArray(arrayOfByte, n);
/* 121 */ short s2 = EndianOrder.flipNativeToBigEndian16(s1);
/* 122 */ setShortInArray(arrayOfByte, n, s2);
/* */ }
/* */
/* 125 */ paramObjectOutputStream.write(arrayOfByte);
/* */ }
/* */
/* */ public int getFormatFlags()
/* */ {
/* 134 */ return getIntAt(4);
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 141 */ return getClass().getName() + "[formatFlags=" + getFormatFlags() + "]";
/* */ }
/* */
/* */ private static native short ICMSetPixelFormatInfo(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native short ICMGetPixelFormatInfo(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native void setIntInArray(byte[] paramArrayOfByte, int paramInt1, int paramInt2);
/* */
/* */ private static native void setShortInArray(byte[] paramArrayOfByte, int paramInt, short paramShort);
/* */
/* */ private static native int getIntFromArray(byte[] paramArrayOfByte, int paramInt);
/* */
/* */ private static native short getShortFromArray(byte[] paramArrayOfByte, int paramInt);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.image.ICMPixelFormatInfo
* JD-Core Version: 0.6.2
*/