/* */ package quicktime.app.image;
/* */
/* */ import java.util.Enumeration;
/* */ import java.util.Vector;
/* */ import quicktime.QTException;
/* */ import quicktime.QTRuntimeException;
/* */ import quicktime.QTSession;
/* */ import quicktime.app.spaces.Collection;
/* */ import quicktime.std.image.ImageDescription;
/* */ import quicktime.std.movies.Movie;
/* */ import quicktime.std.movies.Track;
/* */ import quicktime.std.movies.media.VideoMedia;
/* */ import quicktime.util.ByteEncodedImage;
/* */ import quicktime.util.EncodedImage;
/* */ import quicktime.util.IntEncodedImage;
/* */ import quicktime.util.QTHandle;
/* */ import quicktime.util.QTUtils;
/* */ import quicktime.util.RawEncodedImage;
/* */
/* */ /** @deprecated */
/* */ public class ImageDataSequence
/* */ implements ImageSpec, Collection
/* */ {
/* */ Vector imageDataVector;
/* */ private ImageDescription imageDescription;
/* */
/* */ /** @deprecated */
/* */ public ImageDataSequence()
/* */ {
/* 49 */ this(null);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageDataSequence(ImageDescription paramImageDescription)
/* */ {
/* 58 */ this(paramImageDescription, new Vector());
/* */ }
/* */
/* */ ImageDataSequence(ImageDescription paramImageDescription, Vector paramVector) {
/* 62 */ setDescription(paramImageDescription);
/* 63 */ this.imageDataVector = paramVector;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageDescription getDescription()
/* */ {
/* 77 */ return this.imageDescription;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void setDescription(ImageDescription paramImageDescription)
/* */ {
/* 86 */ this.imageDescription = paramImageDescription;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public EncodedImage getImage()
/* */ {
/* 95 */ return getNth(1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public EncodedImage getImage(int paramInt)
/* */ {
/* 107 */ return getNth(paramInt);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public Enumeration members()
/* */ {
/* 116 */ return this.imageDataVector.elements();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public ImageSequencer sequence()
/* */ {
/* 124 */ return new ImageSequencer(this);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean addMember(Object paramObject)
/* */ {
/* 135 */ if (!isAppropriate(paramObject)) return false;
/* 136 */ append((EncodedImage)paramObject);
/* 137 */ return true;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeMember(Object paramObject)
/* */ {
/* 146 */ this.imageDataVector.removeElement(paramObject);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isAppropriate(Object paramObject)
/* */ {
/* 165 */ return paramObject instanceof EncodedImage;
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean hasMember(Object paramObject)
/* */ {
/* 175 */ return this.imageDataVector.contains(paramObject);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void insert(EncodedImage paramEncodedImage, int paramInt)
/* */ {
/* 188 */ this.imageDataVector.insertElementAt(paramEncodedImage, paramInt - 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void prepend(EncodedImage paramEncodedImage)
/* */ {
/* 197 */ insert(paramEncodedImage, 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void append(EncodedImage paramEncodedImage)
/* */ {
/* 206 */ insert(paramEncodedImage, size() + 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void remove(int paramInt)
/* */ {
/* 215 */ this.imageDataVector.removeElementAt(paramInt - 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeFirst()
/* */ {
/* 224 */ remove(1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeLast()
/* */ {
/* 232 */ remove(size() - 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void removeAll()
/* */ {
/* 238 */ this.imageDataVector.removeAllElements();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public int size()
/* */ {
/* 245 */ return this.imageDataVector.size();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public EncodedImage getNth(int paramInt)
/* */ {
/* 255 */ return (EncodedImage)this.imageDataVector.elementAt(paramInt - 1);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public boolean isEmpty()
/* */ {
/* 264 */ return this.imageDataVector.isEmpty();
/* */ }
/* */
/* */ /** @deprecated */
/* */ public void addToMovie(Movie paramMovie, float paramFloat)
/* */ throws QTException
/* */ {
/* 274 */ int i = 0;
/* 275 */ int j = 600;
/* */
/* 277 */ Track localTrack = paramMovie.addTrack(this.imageDescription.getWidth(), this.imageDescription.getHeight(), i);
/* */
/* 280 */ VideoMedia localVideoMedia = new VideoMedia(localTrack, j);
/* */
/* 282 */ localVideoMedia.beginEdits();
/* 283 */ for (int k = 0; k < size(); k++) {
/* 284 */ EncodedImage localEncodedImage = getNth(k + 1);
/* 285 */ QTHandle localQTHandle = null;
/* 286 */ if ((localEncodedImage instanceof RawEncodedImage)) {
/* 287 */ localQTHandle = new QTHandle((RawEncodedImage)localEncodedImage, 0, localEncodedImage.getSize());
/* */ }
/* */ else
/* */ {
/* */ Object localObject;
/* 288 */ if ((localEncodedImage instanceof IntEncodedImage)) {
/* 289 */ localQTHandle = new QTHandle(localEncodedImage.getSize(), false);
/* 290 */ localObject = ((IntEncodedImage)localEncodedImage).getInts();
/* 291 */ localQTHandle.copyFromArray(0, (int[])localObject, 0, localObject.length);
/* */ } else {
/* 293 */ localQTHandle = new QTHandle(localEncodedImage.getSize(), false);
/* 294 */ localObject = ((ByteEncodedImage)localEncodedImage).getBytes();
/* 295 */ localQTHandle.copyFromArray(0, (byte[])localObject, 0, localObject.length);
/* */ }
/* */ }
/* 297 */ localVideoMedia.addSample(localQTHandle, 0, localQTHandle.getSize(), (int)(600.0F / paramFloat), this.imageDescription, 1, 0);
/* */
/* 304 */ if (k % 5 == 0)
/* 305 */ QTUtils.reclaimMemory();
/* */ }
/* 307 */ localVideoMedia.endEdits();
/* */
/* 309 */ k = 0;
/* 310 */ int m = 0;
/* 311 */ int n = 1;
/* 312 */ localTrack.insertMedia(k, m, localVideoMedia.getDuration(), n);
/* 313 */ QTUtils.reclaimMemory();
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 319 */ return getClass().getName() + "[size=" + size() + ",description=" + getDescription() + "]";
/* */ }
/* */
/* */ static
/* */ {
/* 38 */ if ((QTSession.isCurrentOS(4)) && (QTSession.getJavaVersion() >= 65540))
/* 39 */ 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.ImageDataSequence
* JD-Core Version: 0.6.2
*/