View Javadoc

1   // Copyright 2001-2003, FreeHEP.
2   package org.freehep.graphicsio.swf;
3   
4   import java.awt.Color;
5   import java.awt.Image;
6   import java.awt.image.ImageObserver;
7   import java.awt.image.RenderedImage;
8   import java.io.IOException;
9   
10  import org.freehep.util.images.ImageUtilities;
11  
12  /**
13   * DefineBitsLossless2 TAG.
14   * 
15   * @author Mark Donszelmann
16   * @author Charles Loomis
17   * @version $Id: DefineBitsLossless2.java 8584 2006-08-10 23:06:37Z duns $
18   */
19  public class DefineBitsLossless2 extends DefineBitsLossless {
20  
21      public DefineBitsLossless2(int id, Image image, Color bkg,
22              ImageObserver observer) {
23          this(id, ImageUtilities.createRenderedImage(image, observer, bkg), bkg);
24      }
25  
26      public DefineBitsLossless2(int id, RenderedImage image, Color bkg) {
27          this();
28          character = id;
29          this.image = image;
30          this.bkg = bkg;
31      }
32  
33      public DefineBitsLossless2() {
34          super(36, 3);
35      }
36  
37      public SWFTag read(int tagID, SWFInputStream swf, int len)
38              throws IOException {
39          DefineBitsLossless2 tag = new DefineBitsLossless2();
40          tag.read(tagID, swf, len, true);
41          return tag;
42      }
43  
44      public void write(int tagID, SWFOutputStream swf) throws IOException {
45  
46          write(tagID, swf, true);
47      }
48  }