Package quicktime.app.image

Source Code of quicktime.app.image.QTEffect

/*     */ package quicktime.app.image;
/*     */
/*     */ import java.awt.Dimension;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTRuntimeException;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.app.display.QTDrawable;
/*     */ import quicktime.app.time.TaskThread;
/*     */ import quicktime.qd.QDDimension;
/*     */ import quicktime.qd.QDGraphics;
/*     */ import quicktime.qd.QDRect;
/*     */ import quicktime.qd.Region;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.clocks.TimeBase;
/*     */ import quicktime.std.comp.ComponentDescription;
/*     */ import quicktime.std.comp.ComponentIdentifier;
/*     */ import quicktime.std.image.DSequence;
/*     */ import quicktime.std.image.GraphicsMode;
/*     */ import quicktime.std.image.ICMFrameTime;
/*     */ import quicktime.std.image.ImageDescription;
/*     */ import quicktime.std.image.Matrix;
/*     */ import quicktime.std.movies.Atom;
/*     */ import quicktime.std.movies.AtomContainer;
/*     */ import quicktime.std.movies.AtomData;
/*     */ import quicktime.util.EncodedImage;
/*     */ import quicktime.util.EndianOrder;
/*     */ import quicktime.util.QTUtils;
/*     */ import quicktime.util.RawEncodedImage;
/*     */
/*     */ /** @deprecated */
/*     */ public class QTEffect
/*     */   implements QTDrawable, Redrawable
/*     */ {
/*     */   ImageDescription effectDesc;
/*     */   QDRect mDisplayBounds;
/*     */   QDDimension initSize;
/* 142 */   private QDGraphics mDestPort = QDGraphics.scratch;
/* 143 */   int mNumberOfFrames = 1;
/*     */   AtomContainer effectSample;
/*     */   RawEncodedImage effectSamplePtr;
/*     */   private Region clip;
/*     */   TimeBase tb;
/*     */   DSequence effectSequence;
/*     */   Matrix mat;
/*     */   GraphicsMode gMode;
/*     */   private TaskThread tt;
/* 155 */   ICMFrameTime ft = new ICMFrameTime();
/* 156 */   int currentFrame = 1;
/*     */   private boolean mRedrawFlag;
/*     */   private int singleFrameFlag;
/* 160 */   boolean needsRedraw = false;
/*     */
/*     */   /** @deprecated */
/*     */   public QTEffect()
/*     */     throws QTException
/*     */   {
/*  51 */     this(2, new QDDimension());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QTEffect(Dimension paramDimension)
/*     */     throws QTException
/*     */   {
/*  61 */     this(2, new QDDimension(paramDimension.width, paramDimension.height));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QTEffect(int paramInt)
/*     */     throws QTException
/*     */   {
/*  74 */     this(paramInt, new QDDimension());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QTEffect(int paramInt, Dimension paramDimension)
/*     */     throws QTException
/*     */   {
/*  92 */     this(paramInt, new QDDimension(paramDimension.width, paramDimension.height));
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QTEffect(int paramInt, QDDimension paramQDDimension)
/*     */     throws QTException
/*     */   {
/* 108 */     this.mRedrawFlag = (paramInt == 2);
/* 109 */     this.singleFrameFlag = paramInt;
/*     */
/* 112 */     this.effectDesc = new ImageDescription(0);
/*     */
/* 114 */     this.effectDesc.setTemporalQuality(512);
/* 115 */     this.effectDesc.setSpatialQuality(512);
/*     */
/* 118 */     this.effectDesc.setHRes(72.0F);
/* 119 */     this.effectDesc.setVRes(72.0F);
/*     */
/* 121 */     this.effectDesc.setDepth(24);
/*     */
/* 123 */     this.effectDesc.setFrameCount(1);
/*     */
/* 125 */     this.effectDesc.setClutID(-1);
/*     */
/* 127 */     this.mat = new Matrix();
/* 128 */     if ((paramQDDimension != null) &&
/* 129 */       (paramQDDimension.getWidth() != 0) && (paramQDDimension.getHeight() != 0)) {
/* 130 */       setDisplayBounds(new QDRect(paramQDDimension));
/*     */     }
/* 132 */     this.initSize = paramQDDimension;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setRedrawing(boolean paramBoolean)
/*     */   {
/* 173 */     this.mRedrawFlag = paramBoolean;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isRedrawing()
/*     */   {
/* 180 */     return this.mRedrawFlag;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public boolean isSingleFrame()
/*     */   {
/* 188 */     return this.singleFrameFlag == 1;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setGraphicsMode(GraphicsMode paramGraphicsMode)
/*     */     throws QTException
/*     */   {
/* 196 */     if (this.effectSequence != null) this.effectSequence.setGraphicsMode(paramGraphicsMode);
/* 197 */     this.gMode = paramGraphicsMode;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public GraphicsMode getGraphicsMode()
/*     */   {
/* 205 */     return this.gMode;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setClip(Region paramRegion)
/*     */     throws StdQTException
/*     */   {
/* 215 */     this.clip = paramRegion;
/* 216 */     if (this.effectSequence != null) this.effectSequence.setMask(this.clip);
/*     */   }
/*     */
/*     */   public Region getClip()
/*     */   {
/* 221 */     return this.clip;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public AtomContainer getEffect()
/*     */     throws StdQTException
/*     */   {
/* 230 */     return this.effectSample.copyAtom(Atom.kParentIsContainer);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setEffect(AtomContainer paramAtomContainer)
/*     */     throws QTException
/*     */   {
/* 241 */     if (paramAtomContainer == null) {
/* 242 */       this.effectSamplePtr = null;
/* 243 */       if (this.effectSample != null) this.effectSample.unlock();
/* 244 */       this.effectSample = null;
/* 245 */       return;
/*     */     }
/*     */
/* 248 */     this.effectSample = paramAtomContainer;
/* 249 */     Atom localAtom = this.effectSample.findChildByID_Atom(Atom.kParentIsContainer, 2003329396, 1);
/* 250 */     this.effectSample.lock();
/* 251 */     AtomData localAtomData = this.effectSample.getAtomData(localAtom);
/* 252 */     this.effectDesc.setCType(EndianOrder.flipBigEndianToNative32(localAtomData.getInt(0)));
/* 253 */     this.effectSamplePtr = RawEncodedImage.fromQTPointer(this.effectSample.toQTPointer());
/*     */
/* 255 */     setUpSequence();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   protected synchronized boolean setUpSequence()
/*     */     throws QTException
/*     */   {
/* 267 */     QDRect localQDRect = getDisplayBounds();
/* 268 */     if ((QDGraphics.scratch.equals(getGWorld())) || (this.effectSamplePtr == null) || (localQDRect == null)) {
/* 269 */       return false;
/*     */     }
/* 271 */     this.mat.setTx(localQDRect.getX());
/* 272 */     this.mat.setTy(localQDRect.getY());
/* 273 */     this.effectSequence = new DSequence(this.effectDesc, this.effectSamplePtr, getGWorld(), null, this.mat, getClip(), 0, 512, null);
/*     */
/* 284 */     if (this.gMode != null) this.effectSequence.setGraphicsMode(this.gMode);
/*     */
/* 287 */     this.tb = new TimeBase();
/* 288 */     this.tb.setRate(0.0F);
/* 289 */     this.effectSequence.setTimeBase(this.tb);
/* 290 */     return true;
/*     */   }
/*     */
/*     */   public int getFrames()
/*     */   {
/* 297 */     return this.mNumberOfFrames;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public int getCurrentFrame()
/*     */   {
/* 304 */     return this.currentFrame;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void checkForEffect(int paramInt)
/*     */     throws QTException
/*     */   {
/* 313 */     ComponentDescription localComponentDescription = new ComponentDescription();
/* 314 */     localComponentDescription.setType(QTUtils.toOSType("imdc"));
/* 315 */     localComponentDescription.setSubType(paramInt);
/* 316 */     ComponentIdentifier localComponentIdentifier = ComponentIdentifier.find(localComponentDescription);
/* 317 */     if (localComponentIdentifier == null) throw new StdQTException(-50);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void addedTo(Object paramObject)
/*     */   {
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void removedFrom(Object paramObject)
/*     */   {
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void setGWorld(QDGraphics paramQDGraphics)
/*     */     throws QTException
/*     */   {
/* 350 */     this.mDestPort = paramQDGraphics;
/* 351 */     if (QDGraphics.scratch.equals(paramQDGraphics))
/* 352 */       this.effectSequence = null;
/*     */     else
/* 354 */       setUpSequence();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized QDGraphics getGWorld()
/*     */     throws QTException
/*     */   {
/* 363 */     return this.mDestPort;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void setDisplayBounds(QDRect paramQDRect)
/*     */     throws QTException
/*     */   {
/* 374 */     this.mDisplayBounds = paramQDRect;
/* 375 */     this.effectDesc.setHeight(paramQDRect.getHeight());
/* 376 */     this.effectDesc.setWidth(paramQDRect.getWidth());
/* 377 */     this.mat.setTx(paramQDRect.getX());
/* 378 */     this.mat.setTy(paramQDRect.getY());
/* 379 */     setUpSequence();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setLocation(int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 389 */     QDRect localQDRect = getDisplayBounds();
/* 390 */     localQDRect.setX(paramInt1);
/* 391 */     localQDRect.setY(paramInt2);
/* 392 */     setDisplayBounds(localQDRect);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDRect getDisplayBounds()
/*     */     throws QTException
/*     */   {
/* 403 */     return this.mDisplayBounds == null ? new QDRect(this.initSize.getWidth(), this.initSize.getHeight()) : this.mDisplayBounds;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public DSequence getDSequence()
/*     */   {
/* 416 */     return this.effectSequence;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public EncodedImage getImage()
/*     */   {
/* 425 */     return this.effectSamplePtr;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public ImageDescription getDescription()
/*     */     throws QTException
/*     */   {
/* 435 */     return this.effectDesc;
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Dimension getInitialSize()
/*     */     throws QTException
/*     */   {
/* 446 */     QDDimension localQDDimension = getOriginalSize();
/* 447 */     return new Dimension(localQDDimension.getWidth(), localQDDimension.getHeight());
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public QDDimension getOriginalSize()
/*     */     throws QTException
/*     */   {
/* 457 */     return this.initSize.copy();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public Matrix getMatrix()
/*     */     throws QTException
/*     */   {
/* 467 */     return this.mat.copy();
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public void setMatrix(Matrix paramMatrix)
/*     */     throws QTException
/*     */   {
/* 476 */     this.mat = paramMatrix.copy();
/* 477 */     if (this.effectSequence != null) this.effectSequence.setMatrix(this.mat);
/*     */   }
/*     */
/*     */   /** @deprecated */
/*     */   public synchronized void redraw(Region paramRegion)
/*     */     throws QTException
/*     */   {
/* 490 */     if (this.effectSequence != null) {
/* 491 */       this.tb.setValue(this.currentFrame, this.mNumberOfFrames);
/* 492 */       this.ft.setValue(this.currentFrame);
/* 493 */       if (paramRegion != null) {
/* 494 */         if (getClip() == null)
/* 495 */           this.effectSequence.setMask(paramRegion);
/*     */         else
/* 497 */           this.effectSequence.invalidate(paramRegion);
/*     */       }
/* 499 */       this.effectSequence.decompressFrameWhen(this.effectSamplePtr, 0, this.ft);
/* 500 */       if ((paramRegion != null) && (getClip() == null))
/* 501 */         this.effectSequence.setMask(getClip());
/*     */     }
/*     */   }
/*     */
/*     */   static
/*     */   {
/*  40 */     if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/*  41 */       throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/*     */   }
/*     */ }

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

Related Classes of quicktime.app.image.QTEffect

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.