Package quicktime.std.image

Source Code of quicktime.std.image.ImageDescription

/*     */ package quicktime.std.image;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.jdirect.QTNative;
/*     */ import quicktime.qd.ColorTable;
/*     */ import quicktime.qd.PixMap;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.anim.Sprite;
/*     */ import quicktime.std.movies.AtomContainer;
/*     */ import quicktime.std.movies.media.SampleDescription;
/*     */ import quicktime.std.qtcomponents.ImageCompressionDialog;
/*     */ import quicktime.util.EndianDescriptor;
/*     */ import quicktime.util.EndianFlipSpec;
/*     */ import quicktime.util.QTHandle;
/*     */ import quicktime.util.QTHandleRef;
/*     */ import quicktime.util.QTUtils;
/*     */ import quicktime.util.RawEncodedImage;
/*     */ import quicktime.util.UtilException;
/*     */
/*     */ public class ImageDescription extends SampleDescription
/*     */ {
/*     */   private static EndianDescriptor ed;
/*     */   public static final int kNativeSize = 86;
/* 100 */   private static final int[] savedPort = { 0 };
/* 101 */   private static final int[] savedDevice = { 0 };
/*     */
/*     */   protected static EndianDescriptor makeED()
/*     */   {
/*  36 */     EndianDescriptor localEndianDescriptor = SampleDescription.makeED();
/*     */
/*  38 */     EndianFlipSpec localEndianFlipSpec1 = new EndianFlipSpec(16, 2, 2);
/*  39 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec1);
/*     */
/*  41 */     EndianFlipSpec localEndianFlipSpec2 = new EndianFlipSpec(20, 4, 3);
/*  42 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec2);
/*     */
/*  44 */     EndianFlipSpec localEndianFlipSpec3 = new EndianFlipSpec(32, 2, 2);
/*  45 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec3);
/*     */
/*  48 */     EndianFlipSpec localEndianFlipSpec4 = new EndianFlipSpec(36, 4, 2);
/*  49 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec4);
/*     */
/*  51 */     EndianFlipSpec localEndianFlipSpec5 = new EndianFlipSpec(44, 4, 1);
/*  52 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec5);
/*     */
/*  54 */     EndianFlipSpec localEndianFlipSpec6 = new EndianFlipSpec(48, 2, 1);
/*  55 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec6);
/*     */
/*  58 */     EndianFlipSpec localEndianFlipSpec7 = new EndianFlipSpec(82, 2, 2);
/*  59 */     localEndianDescriptor.addFlipSpec(localEndianFlipSpec7);
/*  60 */     return localEndianDescriptor;
/*     */   }
/*     */
/*     */   public static EndianDescriptor getEndianDescriptor()
/*     */   {
/*  68 */     if (ed == null)
/*  69 */       ed = makeED();
/*  70 */     return ed;
/*     */   }
/*     */
/*     */   public static ImageDescription fromGraphicsExporter(GraphicsExporter paramGraphicsExporter)
/*     */     throws StdQTException
/*     */   {
/* 110 */     int[] arrayOfInt = new int[1];
/* 111 */     int i = GraphicsExportGetInputImageDescription(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/* 112 */     StdQTException.checkError(i);
/* 113 */     return new ImageDescription(arrayOfInt[0], null);
/*     */   }
/*     */
/*     */   public static ImageDescription fromGraphicsExporterCompressor(GraphicsExporter paramGraphicsExporter, AtomContainer paramAtomContainer)
/*     */     throws StdQTException
/*     */   {
/* 122 */     int[] arrayOfInt = { 0 };
/* 123 */     int i = GraphicsExportDoUseCompressor(QTObject.ID(paramGraphicsExporter), QTObject.ID(paramAtomContainer), arrayOfInt);
/* 124 */     StdQTException.checkError(i);
/* 125 */     return new ImageDescription(arrayOfInt[0], paramGraphicsExporter);
/*     */   }
/*     */
/*     */   public static ImageDescription fromGraphicsImporter(GraphicsImporter paramGraphicsImporter)
/*     */     throws StdQTException
/*     */   {
/* 134 */     int[] arrayOfInt = new int[1];
/* 135 */     int i = GraphicsImportGetImageDescription(QTObject.ID(paramGraphicsImporter), arrayOfInt);
/* 136 */     StdQTException.checkError(i);
/* 137 */     return new ImageDescription(arrayOfInt[0], null);
/*     */   }
/*     */
/*     */   public static ImageDescription fromSprite(Sprite paramSprite)
/*     */     throws StdQTException
/*     */   {
/* 147 */     int[] arrayOfInt = { 0 };
/* 148 */     int i = GetSpriteProperty(QTObject.ID(paramSprite), 2, arrayOfInt);
/* 149 */     StdQTException.checkError(i);
/* 150 */     return new ImageDescription(arrayOfInt[0], paramSprite); }
/*     */   public static QTImage fromImageCompressionDialog(ImageCompressionDialog paramImageCompressionDialog, QDGraphics paramQDGraphics, QDRect paramQDRect) throws QTException { // Byte code:
/*     */     //   0: aload_2
/*     */     //   1: ifnull +10 -> 11
/*     */     //   4: aload_2
/*     */     //   5: invokevirtual 15  quicktime/qd/QDRect:getRect  ()[B
/*     */     //   8: goto +4 -> 12
/*     */     //   11: aconst_null
/*     */     //   12: astore_3
/*     */     //   13: iconst_1
/*     */     //   14: newarray int
/*     */     //   16: dup
/*     */     //   17: iconst_0
/*     */     //   18: iconst_0
/*     */     //   19: iastore
/*     */     //   20: astore 4
/*     */     //   22: iconst_1
/*     */     //   23: newarray int
/*     */     //   25: dup
/*     */     //   26: iconst_0
/*     */     //   27: iconst_0
/*     */     //   28: iastore
/*     */     //   29: astore 5
/*     */     //   31: aload_1
/*     */     //   32: ifnonnull +13 -> 45
/*     */     //   35: new 16  quicktime/std/StdQTException
/*     */     //   38: dup
/*     */     //   39: bipush 206
/*     */     //   41: invokespecial 17  quicktime/std/StdQTException:<init>  (I)V
/*     */     //   44: athrow
/*     */     //   45: iconst_0
/*     */     //   46: istore 6
/*     */     //   48: getstatic 18  quicktime/jdirect/QTNative:globalsLock  Ljava/lang/Object;
/*     */     //   51: dup
/*     */     //   52: astore 7
/*     */     //   54: monitorenter
/*     */     //   55: iconst_1
/*     */     //   56: invokestatic 19  quicktime/QTSession:isCurrentOS  (I)Z
/*     */     //   59: ifne +10 -> 69
/*     */     //   62: iconst_4
/*     */     //   63: invokestatic 19  quicktime/QTSession:isCurrentOS  (I)Z
/*     */     //   66: ifeq +12 -> 78
/*     */     //   69: getstatic 20  quicktime/std/image/ImageDescription:savedPort  [I
/*     */     //   72: getstatic 21  quicktime/std/image/ImageDescription:savedDevice  [I
/*     */     //   75: invokestatic 22  quicktime/std/image/ImageDescription:GetGWorld  ([I[I)V
/*     */     //   78: aload_1
/*     */     //   79: invokestatic 7  quicktime/QTObject:ID  (Lquicktime/QTObject;)I
/*     */     //   82: iconst_0
/*     */     //   83: invokestatic 23  quicktime/std/image/ImageDescription:SetGWorld  (II)V
/*     */     //   86: aload_0
/*     */     //   87: invokestatic 7  quicktime/QTObject:ID  (Lquicktime/QTObject;)I
/*     */     //   90: aload_1
/*     */     //   91: invokevirtual 24  quicktime/qd/QDGraphics:getPixMap  ()Lquicktime/qd/PixMap;
/*     */     //   94: invokestatic 7  quicktime/QTObject:ID  (Lquicktime/QTObject;)I
/*     */     //   97: aload_3
/*     */     //   98: aload 4
/*     */     //   100: aload 5
/*     */     //   102: invokestatic 25  quicktime/std/image/ImageDescription:SCCompressImage  (II[B[I[I)I
/*     */     //   105: istore 6
/*     */     //   107: iconst_1
/*     */     //   108: invokestatic 19  quicktime/QTSession:isCurrentOS  (I)Z
/*     */     //   111: ifne +10 -> 121
/*     */     //   114: iconst_4
/*     */     //   115: invokestatic 19  quicktime/QTSession:isCurrentOS  (I)Z
/*     */     //   118: ifeq +16 -> 134
/*     */     //   121: getstatic 20  quicktime/std/image/ImageDescription:savedPort  [I
/*     */     //   124: iconst_0
/*     */     //   125: iaload
/*     */     //   126: getstatic 21  quicktime/std/image/ImageDescription:savedDevice  [I
/*     */     //   129: iconst_0
/*     */     //   130: iaload
/*     */     //   131: invokestatic 23  quicktime/std/image/ImageDescription:SetGWorld  (II)V
/*     */     //   134: aload 7
/*     */     //   136: monitorexit
/*     */     //   137: goto +11 -> 148
/*     */     //   140: astore 8
/*     */     //   142: aload 7
/*     */     //   144: monitorexit
/*     */     //   145: aload 8
/*     */     //   147: athrow
/*     */     //   148: iload 6
/*     */     //   150: iconst_1
/*     */     //   151: if_icmpne +13 -> 164
/*     */     //   154: new 16  quicktime/std/StdQTException
/*     */     //   157: dup
/*     */     //   158: bipush 128
/*     */     //   160: invokespecial 17  quicktime/std/StdQTException:<init>  (I)V
/*     */     //   163: athrow
/*     */     //   164: iload 6
/*     */     //   166: invokestatic 9  quicktime/std/StdQTException:checkError  (I)V
/*     */     //   169: new 26  quicktime/std/image/ImageDescription$1ImageHdl
/*     */     //   172: dup
/*     */     //   173: aload 5
/*     */     //   175: iconst_0
/*     */     //   176: iaload
/*     */     //   177: aconst_null
/*     */     //   178: invokespecial 27  quicktime/std/image/ImageDescription$1ImageHdl:<init>  (ILjava/lang/Object;)V
/*     */     //   181: astore 7
/*     */     //   183: aload 7
/*     */     //   185: invokevirtual 28  quicktime/util/QTHandleRef:lockHigh  ()V
/*     */     //   188: new 29  quicktime/std/image/QTImage
/*     */     //   191: dup
/*     */     //   192: new 10  quicktime/std/image/ImageDescription
/*     */     //   195: dup
/*     */     //   196: aload 4
/*     */     //   198: iconst_0
/*     */     //   199: iaload
/*     */     //   200: aconst_null
/*     */     //   201: invokespecial 11  quicktime/std/image/ImageDescription:<init>  (ILjava/lang/Object;)V
/*     */     //   204: aload 7
/*     */     //   206: invokestatic 30  quicktime/util/RawEncodedImage:fromQTHandle  (Lquicktime/util/QTHandleRef;)Lquicktime/util/RawEncodedImage;
/*     */     //   209: invokespecial 31  quicktime/std/image/QTImage:<init>  (Lquicktime/std/image/ImageDescription;Lquicktime/util/EncodedImage;)V
/*     */     //   212: areturn
/*     */     //
/*     */     // Exception table:
/*     */     //   from  to  target  type
/*     */     //   55  137  140  finally
/*     */     //   140  145  140  finally }
/* 206 */   public static ImageDescription getJavaDefaultPixelDescription(int paramInt1, int paramInt2) throws QTException { ImageDescription localImageDescription = null;
/*     */
/* 208 */     if (QTSession.isCurrentOS(2) == true)
/* 209 */       localImageDescription = new ImageDescription(QDGraphics.kDefaultPixelFormat);
/*     */     else {
/* 211 */       localImageDescription = new ImageDescription(1918990112);
/*     */     }
/*     */
/* 214 */     localImageDescription.setDepth(32);
/* 215 */     localImageDescription.setSpatialQuality(512);
/* 216 */     localImageDescription.setWidth(paramInt1);
/* 217 */     localImageDescription.setHeight(paramInt2);
/* 218 */     localImageDescription.setHRes(72.0F);
/* 219 */     localImageDescription.setVRes(72.0F);
/*     */
/* 221 */     localImageDescription.setFrameCount(1);
/* 222 */     localImageDescription.setClutID(-1);
/*     */
/* 224 */     return (ImageDescription)localImageDescription.clone();
/*     */   }
/*     */
/*     */   public static ImageDescription forEffect(int paramInt)
/*     */     throws QTException
/*     */   {
/* 233 */     return new ImageDescription(allocate(paramInt), null);
/*     */   }
/*     */
/*     */   public ImageDescription(int paramInt)
/*     */     throws QTException
/*     */   {
/* 240 */     super(86, true, paramInt);
/*     */   }
/*     */
/*     */   public ImageDescription(PixMap paramPixMap)
/*     */     throws QTException
/*     */   {
/* 247 */     this(allocate(paramPixMap), null);
/*     */   }
/*     */
/*     */   protected ImageDescription(int paramInt, Object paramObject) {
/* 251 */     super(paramInt, paramObject, false);
/*     */   }
/*     */
/*     */   private static int allocate(PixMap paramPixMap) throws QTException {
/* 255 */     int[] arrayOfInt = { 0 };
/* 256 */     StdQTException.checkError(MakeImageDescriptionForPixMap(QTObject.ID(paramPixMap), arrayOfInt));
/*     */
/* 259 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   private static int allocate(int paramInt) throws QTException {
/* 263 */     int[] arrayOfInt = { 0 };
/* 264 */     StdQTException.checkError(MakeImageDescriptionForEffect(paramInt, arrayOfInt));
/*     */
/* 267 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public Object clone()
/*     */   {
/* 272 */     return new ImageDescription(makeAndCopyHandle(), null);
/*     */   }
/*     */
/*     */   public void setCTable(ColorTable paramColorTable)
/*     */     throws StdQTException
/*     */   {
/* 280 */     StdQTException.checkError(SetImageDescriptionCTable(_ID(), QTObject.ID(paramColorTable)));
/*     */   }
/*     */
/*     */   public ColorTable getCTable()
/*     */     throws QTException
/*     */   {
/* 290 */     return ColorTable.fromImageDescription(this);
/*     */   }
/*     */
/*     */   public int countExtensionType(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 300 */     int[] arrayOfInt = new int[1];
/* 301 */     StdQTException.checkError(CountImageDescriptionExtensionType(_ID(), paramInt, arrayOfInt));
/* 302 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public int getNextExtensionType()
/*     */     throws StdQTException
/*     */   {
/* 311 */     int[] arrayOfInt = new int[1];
/* 312 */     StdQTException.checkError(GetNextImageDescriptionExtensionType(_ID(), arrayOfInt));
/* 313 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public void addExtension(int paramInt, QTHandle paramQTHandle)
/*     */     throws StdQTException
/*     */   {
/* 323 */     StdQTException.checkError(AddImageDescriptionExtension(_ID(), QTObject.ID(paramQTHandle), paramInt));
/*     */   }
/*     */
/*     */   public void removeExtension(int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 333 */     StdQTException.checkError(RemoveImageDescriptionExtension(_ID(), paramInt1, paramInt2));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QTHandle getExtension(int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 364 */     return QTHandle.fromImageDescription(this, paramInt1, paramInt2);
/*     */   }
/*     */
/*     */   public QDGraphics newGWorld(int paramInt)
/*     */     throws QTException
/*     */   {
/* 375 */     return new QDGraphics(this, paramInt);
/*     */   }
/*     */
/*     */   public int getIdSize() {
/* 379 */     return getIntAt(0);
/*     */   }
/*     */   public int getCType() {
/* 382 */     return getIntAt(4);
/*     */   }
/*     */   public int getVersion() {
/* 385 */     return getShortAt(16);
/*     */   }
/*     */   public int getRevisionLevel() {
/* 388 */     return getShortAt(18);
/*     */   }
/*     */   public int getVendor() {
/* 391 */     return getIntAt(20);
/*     */   }
/*     */   public int getTemporalQuality() {
/* 394 */     return getIntAt(24);
/*     */   }
/*     */   public int getSpatialQuality() {
/* 397 */     return getIntAt(28);
/*     */   }
/*     */   public int getWidth() {
/* 400 */     return getShortAt(32);
/*     */   }
/*     */   public int getHeight() {
/* 403 */     return getShortAt(34);
/*     */   }
/*     */   public QDRect getBounds() {
/* 406 */     return new QDRect(0, 0, getShortAt(32), getShortAt(34));
/*     */   }
/*     */   public float getHRes() {
/* 409 */     return QTUtils.Fix2X(getIntAt(36));
/*     */   }
/*     */   public float getVRes() {
/* 412 */     return QTUtils.Fix2X(getIntAt(40));
/*     */   }
/*     */   public int getDataSize() {
/* 415 */     return getIntAt(44);
/*     */   }
/*     */   public int getFrameCount() {
/* 418 */     return getShortAt(48);
/*     */   }
/*     */   public String getName() throws UtilException {
/* 421 */     return getPStringAt(50);
/*     */   }
/*     */   public int getDepth() {
/* 424 */     return getShortAt(82);
/*     */   }
/*     */   public int getClutID() {
/* 427 */     return getShortAt(84);
/*     */   }
/*     */
/*     */   public void setCType(int paramInt)
/*     */   {
/* 433 */     setIntAt(4, paramInt);
/*     */   }
/*     */
/*     */   public void setVersion(int paramInt)
/*     */   {
/* 439 */     setShortAt(16, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setRevisionLevel(int paramInt)
/*     */   {
/* 445 */     setShortAt(18, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setVendor(int paramInt)
/*     */   {
/* 451 */     setIntAt(20, paramInt);
/*     */   }
/*     */
/*     */   public void setTemporalQuality(int paramInt)
/*     */   {
/* 457 */     setIntAt(24, paramInt);
/*     */   }
/*     */
/*     */   public void setSpatialQuality(int paramInt)
/*     */   {
/* 463 */     setIntAt(28, paramInt);
/*     */   }
/*     */
/*     */   public void setWidth(int paramInt)
/*     */   {
/* 469 */     setShortAt(32, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setHeight(int paramInt)
/*     */   {
/* 475 */     setShortAt(34, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setHRes(float paramFloat)
/*     */   {
/* 481 */     setIntAt(36, QTUtils.X2Fix(paramFloat));
/*     */   }
/*     */
/*     */   public void setVRes(float paramFloat)
/*     */   {
/* 487 */     setIntAt(40, QTUtils.X2Fix(paramFloat));
/*     */   }
/*     */
/*     */   public void setDataSize(int paramInt)
/*     */   {
/* 493 */     setIntAt(44, paramInt);
/*     */   }
/*     */
/*     */   public void setFrameCount(int paramInt)
/*     */   {
/* 499 */     setShortAt(48, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setName(String paramString)
/*     */     throws UtilException
/*     */   {
/* 505 */     setPStringAt(50, 31, paramString);
/*     */   }
/*     */
/*     */   public void setDepth(int paramInt)
/*     */   {
/* 511 */     setShortAt(82, (short)paramInt);
/*     */   }
/*     */
/*     */   public void setClutID(int paramInt)
/*     */   {
/* 517 */     setShortAt(84, (short)paramInt);
/*     */   }
/*     */
/*     */   public String toString() {
/* 521 */     String str = "";
/*     */     try {
/* 523 */       str = getName();
/*     */     } catch (QTException localQTException) {
/*     */     }
/* 526 */     return getClass().getName() + "[cType=" + QTUtils.fromOSType(getCType()) + ",temporalQuality=" + getTemporalQuality() + ",spatialQulity=" + getSpatialQuality() + ",width=" + getWidth() + ",height=" + getHeight() + ",dataSize=" + getDataSize() + ",frameCount=" + getFrameCount() + ",name=" + str + ",depth=" + getDepth() + "]";
/*     */   }
/*     */
/*     */   private static native int GraphicsExportDoUseCompressor(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native int GraphicsExportGetInputImageDescription(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int GraphicsImportGetImageDescription(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native short GetSpriteProperty(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native int SCCompressImage(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */
/*     */   private static native short MakeImageDescriptionForPixMap(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native short SetImageDescriptionCTable(int paramInt1, int paramInt2);
/*     */
/*     */   private static native short GetImageDescriptionExtension(int paramInt1, int[] paramArrayOfInt, int paramInt2, int paramInt3);
/*     */
/*     */   private static native short AddImageDescriptionExtension(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native short RemoveImageDescriptionExtension(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native short CountImageDescriptionExtensionType(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native short GetNextImageDescriptionExtensionType(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native short MakeImageDescriptionForEffect(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native void SetGWorld(int paramInt1, int paramInt2);
/*     */
/*     */   private static native void GetGWorld(int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.std.image.ImageDescription
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.std.image.ImageDescription

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.