Package quicktime.std.anim

Source Code of quicktime.std.anim.SpriteWorld

/*     */ package quicktime.std.anim;
/*     */
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.jdirect.QTNative;
/*     */ import quicktime.qd.QDColor;
/*     */ import quicktime.qd.QDException;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDPoint;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.qd.Region;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.image.GraphicsMode;
/*     */ import quicktime.std.image.Matrix;
/*     */
/*     */ public class SpriteWorld extends QTObject
/*     */ {
/*  64 */   private Matrix mMatrix = new Matrix();
/*     */   private int mWidth;
/*     */   private int mHeight;
/*     */   private int destPort;
/*  67 */   private int[] savedPort = { 0 };
/*  68 */   private int[] savedDevice = { 0 };
/*     */
/* 104 */   private QDRect bounds = new QDRect();
/*     */
/*     */   private static int allocate(QDGraphics paramQDGraphics1, QDGraphics paramQDGraphics2, QDColor paramQDColor, QDGraphics paramQDGraphics3)
/*     */     throws StdQTException, QDException
/*     */   {
/*  32 */     int[] arrayOfInt = new int[1];
/*  33 */     synchronized (QTNative.globalsLock) {
/*  34 */       int i = NewSpriteWorld(arrayOfInt, QTObject.ID(paramQDGraphics1), QTObject.ID(paramQDGraphics2), paramQDColor == null ? null : paramQDColor.getRGBColor(), QTObject.ID(paramQDGraphics3));
/*     */
/*  40 */       StdQTException.checkError(i);
/*     */     }
/*  42 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public SpriteWorld(QDGraphics paramQDGraphics1, QDGraphics paramQDGraphics2, QDColor paramQDColor, QDGraphics paramQDGraphics3)
/*     */     throws QTException
/*     */   {
/*  55 */     super(allocate(paramQDGraphics1, paramQDGraphics2, paramQDColor, paramQDGraphics3));
/*  56 */     setWidthHeight(paramQDGraphics2);
/*  57 */     setMatrix(this.mMatrix);
/*  58 */     this.destPort = QTObject.ID(paramQDGraphics1);
/*     */   }
/*     */
/*     */   private void setWidthHeight(QDGraphics paramQDGraphics)
/*     */   {
/*  72 */     synchronized (QTNative.globalsLock) {
/*  73 */       QDRect localQDRect = paramQDGraphics.getPortRect();
/*  74 */       this.mWidth = localQDRect.getWidth();
/*  75 */       this.mHeight = localQDRect.getHeight();
/*     */     }
/*     */   }
/*     */
/*     */   public final void setBounds(QDRect paramQDRect)
/*     */     throws StdQTException
/*     */   {
/*  84 */     Matrix localMatrix = new Matrix();
/*  85 */     localMatrix.setTx(paramQDRect.getX());
/*  86 */     localMatrix.setTy(paramQDRect.getY());
/*  87 */     localMatrix.setSx(paramQDRect.getWidth() / this.mWidth);
/*  88 */     localMatrix.setSy(paramQDRect.getHeight() / this.mHeight);
/*  89 */     setMatrix(localMatrix);
/*     */   }
/*     */
/*     */   public final QDRect getBounds()
/*     */     throws StdQTException
/*     */   {
/*  97 */     this.bounds.setX((int)this.mMatrix.getTx());
/*  98 */     this.bounds.setY((int)this.mMatrix.getTy());
/*  99 */     this.bounds.setWidth((int)(this.mMatrix.getSx() * this.mWidth));
/* 100 */     this.bounds.setHeight((int)(this.mMatrix.getSy() * this.mHeight));
/* 101 */     return this.bounds;
/*     */   }
/*     */
/*     */   public final void setClip(Region paramRegion)
/*     */     throws StdQTException
/*     */   {
/* 111 */     synchronized (QTNative.globalsLock) {
/* 112 */       StdQTException.checkError(SetSpriteWorldClip(_ID(), QTObject.ID(paramRegion)));
/*     */     }
/*     */   }
/*     */
/*     */   public final void setGraphicsMode(GraphicsMode paramGraphicsMode)
/*     */     throws StdQTException
/*     */   {
/* 124 */     paramGraphicsMode = paramGraphicsMode == null ? new GraphicsMode() : paramGraphicsMode;
/* 125 */     synchronized (QTNative.globalsLock) {
/* 126 */       StdQTException.checkError(SetSpriteWorldGraphicsMode(_ID(), paramGraphicsMode.getGraphicsMode(), paramGraphicsMode.getColor().getRGBColor()));
/*     */     }
/*     */   }
/*     */
/*     */   public final Matrix getMatrix()
/*     */   {
/* 137 */     return this.mMatrix;
/*     */   }
/*     */
/*     */   public final void setMatrix(Matrix paramMatrix)
/*     */     throws StdQTException
/*     */   {
/* 146 */     synchronized (QTNative.globalsLock) {
/* 147 */       this.mMatrix = (paramMatrix == null ? new Matrix() : paramMatrix);
/* 148 */       StdQTException.checkError(SetSpriteWorldMatrix(_ID(), this.mMatrix.getBytes()));
/*     */     }
/*     */   }
/*     */
/*     */   public final int idle(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 162 */     int[] arrayOfInt = new int[1];
/*     */
/* 164 */     synchronized (QTNative.globalsLock) {
/* 165 */       int i = SpriteWorldIdle(_ID(), paramInt, arrayOfInt);
/* 166 */       StdQTException.checkError(i);
/*     */     }
/* 168 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public final void invalidate(QDRect paramQDRect)
/*     */     throws StdQTException
/*     */   {
/* 178 */     synchronized (QTNative.globalsLock) {
/* 179 */       StdQTException.checkError(InvalidateSpriteWorld(_ID(), paramQDRect == null ? null : paramQDRect.getRect()));
/*     */     }
/*     */   }
/*     */
/*     */   public final Sprite hitTest(int paramInt, QDPoint paramQDPoint)
/*     */     throws QTException
/*     */   {
/* 194 */     int[] arrayOfInt = new int[1];
/* 195 */     synchronized (QTNative.globalsLock) {
/* 196 */       StdQTException.checkError(SpriteWorldHitTest(_ID(), paramInt, paramQDPoint.getPoint(), arrayOfInt));
/*     */     }
/*     */
/* 201 */     return arrayOfInt[0] == 0 ? null : new Sprite(arrayOfInt[0], this);
/*     */   }
/*     */
/*     */   public final void setFlags(int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 210 */     synchronized (QTNative.globalsLock) {
/* 211 */       StdQTException.checkError(SetSpriteWorldFlags(_ID(), paramInt1, paramInt2));
/*     */     }
/*     */   }
/*     */
/*     */   private static native short NewSpriteWorld(int[] paramArrayOfInt, int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3);
/*     */
/*     */   private static native short SetSpriteWorldClip(int paramInt1, int paramInt2);
/*     */
/*     */   private static native short SetSpriteWorldGraphicsMode(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/*     */
/*     */   private static native short SetSpriteWorldMatrix(int paramInt, byte[] paramArrayOfByte);
/*     */
/*     */   private static native short SpriteWorldIdle(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native short InvalidateSpriteWorld(int paramInt, byte[] paramArrayOfByte);
/*     */
/*     */   private static native short SpriteWorldHitTest(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
/*     */
/*     */   private static native short SetSpriteWorldFlags(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native void DisposeAllSprites(int paramInt);
/*     */
/*     */   private static native short GetMoviesError();
/*     */ }

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

Related Classes of quicktime.std.anim.SpriteWorld

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.