/* */ package quicktime.app.image;
/* */
/* */ import java.awt.Dimension;
/* */ import java.util.Vector;
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.actions.Invalidator;
/* */ import quicktime.app.anim.SWCompositor;
/* */ import quicktime.app.anim.TwoDSprite;
/* */ import quicktime.app.display.QTDrawable;
/* */ import quicktime.app.spaces.Sequencer;
/* */ import quicktime.qd.QDDimension;
/* */ import quicktime.qd.QDGraphics;
/* */ import quicktime.qd.QDRect;
/* */ import quicktime.qd.Region;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.image.CodecComponent;
/* */ import quicktime.std.image.DSequence;
/* */ import quicktime.std.image.GraphicsImporter;
/* */ import quicktime.std.image.GraphicsMode;
/* */ import quicktime.std.image.ImageDescription;
/* */ import quicktime.std.image.Matrix;
/* */ import quicktime.util.EncodedImage;
/* */ import quicktime.util.RawEncodedImage;
/* */
/* */ /** @deprecated */
/* */ public class DSequenceFromMemory extends Sequencer
/* */ implements QTDrawable, DynamicImage
/* */ {
/* */ private DSequence seq;
/* */ private Vector frames;
/* */ private int initialNumElements;
/* 127 */ private int currentFrame = 1;
/* 128 */ private QDGraphics port = QDGraphics.scratch;
/* */ private int mWidth;
/* */ private int mHeight;
/* */ private ImageDescription mDesc;
/* 131 */ private Matrix mat = new Matrix();
/* */ private QDRect bnds;
/* 133 */ private Region clip = null;
/* */ private GraphicsMode gMode;
/* 138 */ public int flags = 0;
/* */
/* */ private static RawEncodedImage privateGetData(GraphicsImporter paramGraphicsImporter)
/* */ throws QTException
/* */ {
/* 50 */ int i = paramGraphicsImporter.getDataSize();
/* 51 */ RawEncodedImage localRawEncodedImage = new RawEncodedImage(i, true);
/* 52 */ paramGraphicsImporter.readData(localRawEncodedImage, paramGraphicsImporter.getDataOffset(), i);
/* 53 */ return localRawEncodedImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public DSequenceFromMemory(GraphicsImporter paramGraphicsImporter)
/* */ throws QTException
/* */ {
/* 64 */ this(privateGetData(paramGraphicsImporter), paramGraphicsImporter.getImageDescription());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public DSequenceFromMemory(EncodedImage paramEncodedImage, ImageDescription paramImageDescription)
/* */ throws QTException
/* */ {
/* 75 */ this.initialNumElements = 1;
/* 76 */ this.frames = new Vector(this.initialNumElements, this.initialNumElements);
/* 77 */ this.frames.addElement(paramEncodedImage);
/* 78 */ this.mDesc = paramImageDescription;
/* 79 */ this.bnds = new QDRect(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public DSequenceFromMemory(CSequenceToMemory paramCSequenceToMemory)
/* */ throws QTException
/* */ {
/* 92 */ this.mDesc = paramCSequenceToMemory.getDescription();
/* 93 */ this.frames = paramCSequenceToMemory.getFrames();
/* 94 */ this.bnds = new QDRect(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public DSequenceFromMemory(ImageSpec paramImageSpec)
/* */ throws QTException
/* */ {
/* 105 */ if ((paramImageSpec instanceof ImageDataSequence)) {
/* 106 */ ImageDataSequence localImageDataSequence = (ImageDataSequence)paramImageSpec;
/* 107 */ this.initialNumElements = localImageDataSequence.size();
/* 108 */ this.frames = new Vector(this.initialNumElements, this.initialNumElements);
/* 109 */ for (int i = 1; i <= localImageDataSequence.size(); i++) {
/* 110 */ this.frames.addElement(localImageDataSequence.getImage(i));
/* */ }
/* 112 */ this.mDesc = localImageDataSequence.getDescription();
/* 113 */ this.bnds = new QDRect(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ } else {
/* 115 */ this.initialNumElements = 1;
/* 116 */ this.frames = new Vector();
/* 117 */ this.frames.addElement(paramImageSpec.getImage());
/* 118 */ this.mDesc = paramImageSpec.getDescription();
/* 119 */ this.bnds = new QDRect(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addedTo(Object paramObject)
/* */ {
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFrom(Object paramObject)
/* */ {
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDGraphics getGWorld()
/* */ {
/* 167 */ return this.port;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setGWorld(QDGraphics paramQDGraphics)
/* */ throws QTException
/* */ {
/* 180 */ this.port = paramQDGraphics;
/* 181 */ if (!QDGraphics.scratch.equals(paramQDGraphics)) {
/* 182 */ this.seq = new DSequence(this.mDesc, this.port, null, getMatrix(), null, this.flags, 768, CodecComponent.bestSpeedCodec);
/* */
/* 190 */ if (this.gMode != null) setGraphicsMode(this.gMode);
/* 191 */ if (this.clip != null) setClip(this.clip);
/* */ }
/* 193 */ else { this.seq = null; }
/* */
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setMatrix(Matrix paramMatrix)
/* */ throws StdQTException
/* */ {
/* 201 */ if (this.seq != null) this.seq.setMatrix(paramMatrix);
/* 202 */ this.mat = paramMatrix;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Matrix getMatrix()
/* */ throws StdQTException
/* */ {
/* 212 */ return this.seq != null ? this.seq.getMatrix() : this.mat;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Dimension getInitialSize()
/* */ throws QTException
/* */ {
/* 225 */ return new Dimension(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDDimension getOriginalSize()
/* */ throws QTException
/* */ {
/* 235 */ return new QDDimension(this.mDesc.getWidth(), this.mDesc.getHeight());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setDisplayBounds(QDRect paramQDRect)
/* */ throws StdQTException
/* */ {
/* 246 */ Matrix localMatrix = new Matrix();
/* 247 */ localMatrix.setTx(paramQDRect.getX());
/* 248 */ localMatrix.setTy(paramQDRect.getY());
/* 249 */ localMatrix.setSx(paramQDRect.getWidth() / this.mDesc.getWidth());
/* 250 */ localMatrix.setSy(paramQDRect.getHeight() / this.mDesc.getHeight());
/* 251 */ this.mWidth = paramQDRect.getWidth();
/* 252 */ this.mHeight = paramQDRect.getHeight();
/* */
/* 254 */ if (this.seq != null) this.seq.setMatrix(localMatrix);
/* 255 */ this.bnds = paramQDRect;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setLocation(int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 265 */ this.bnds.setX(paramInt1);
/* 266 */ this.bnds.setY(paramInt2);
/* 267 */ setDisplayBounds(this.bnds);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QDRect getDisplayBounds()
/* */ {
/* 278 */ return this.bnds;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public final synchronized void redraw(Region paramRegion)
/* */ throws StdQTException
/* */ {
/* 291 */ if (this.seq == null) return;
/* 292 */ if (paramRegion != null) {
/* 293 */ this.seq.setMask(paramRegion);
/* 294 */ drawCurrentFrame(this.flags);
/* 295 */ this.seq.setMask(this.clip);
/* */ } else {
/* 297 */ drawCurrentFrame(this.flags);
/* */ }
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Region getClip()
/* */ throws StdQTException
/* */ {
/* 306 */ return this.clip;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setClip(Region paramRegion)
/* */ throws StdQTException
/* */ {
/* 315 */ if (this.seq != null) this.seq.setMask(paramRegion);
/* 316 */ this.clip = paramRegion;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageDescription getDescription()
/* */ throws QTException
/* */ {
/* 326 */ return this.mDesc;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public EncodedImage getImage()
/* */ throws StdQTException
/* */ {
/* 336 */ if (this.frames != null) {
/* 337 */ return (EncodedImage)this.frames.elementAt(getCurrentFrame() - 1);
/* */ }
/* 339 */ return null;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int size()
/* */ {
/* 348 */ return this.frames != null ? this.frames.size() : 0;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int drawCurrentFrame(int paramInt)
/* */ throws StdQTException
/* */ {
/* 361 */ if (this.seq == null) return 0;
/* 362 */ EncodedImage localEncodedImage = getImage();
/* 363 */ return this.seq.decompressFrameS(localEncodedImage, paramInt);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setGraphicsMode(GraphicsMode paramGraphicsMode)
/* */ throws QTException
/* */ {
/* 372 */ if (this.seq != null) this.seq.setGraphicsMode(paramGraphicsMode);
/* 373 */ this.gMode = paramGraphicsMode;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public GraphicsMode getGraphicsMode()
/* */ {
/* 381 */ return this.gMode;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Invalidator addedToCompositor(SWCompositor paramSWCompositor, TwoDSprite paramTwoDSprite)
/* */ {
/* 405 */ return new SeqInvalidator(paramTwoDSprite, getCurrentFrame());
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removedFromCompositor(SWCompositor paramSWCompositor)
/* */ {
/* */ }
/* */
/* */ /** @deprecated */
/* */ public DSequence getSequence()
/* */ {
/* 441 */ return this.seq;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public String toString()
/* */ {
/* 448 */ return getClass().getName() + "[size=" + size() + "]";
/* */ }
/* */
/* */ static
/* */ {
/* 43 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 44 */ throw new QTRuntimeException("Unsupported on Mac OS X and Java 1.4 and higher.");
/* */ }
/* */
/* */ class SeqInvalidator extends Invalidator
/* */ {
/* */ private int lastFrame;
/* */
/* */ SeqInvalidator(TwoDSprite paramInt, int arg3)
/* */ {
/* 419 */ super();
/* */ int i;
/* 420 */ this.lastFrame = i;
/* */ }
/* */
/* */ public boolean tickle(float paramFloat, int paramInt)
/* */ throws QTException
/* */ {
/* 426 */ if (this.lastFrame != DSequenceFromMemory.this.getCurrentFrame()) {
/* 427 */ DSequenceFromMemory.this.redraw(null);
/* 428 */ this.s.invalidate();
/* 429 */ this.lastFrame = DSequenceFromMemory.this.getCurrentFrame();
/* */ }
/* 431 */ return true;
/* */ }
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.app.image.DSequenceFromMemory
* JD-Core Version: 0.6.2
*/