Example #1
0
  public static boolean areEquivalentImages(ImageDescriptor id1, ImageDescriptor id2) {
    boolean equal = true;
    if (id1 == null || id2 == null) {
      return false;
    }
    if (id1.getNumberOfColumns() != id2.getNumberOfColumns()) {
      return false;
    }
    if (id1.getNumberOfRows() != id2.getNumberOfRows()) {
      return false;
    }

    /*
     float ar1      =    ImageDescriptor.computeImageAspectRatio(id1);
     float ar2      =    ImageDescriptor.computeImageAspectRatio(id2);
     if (ar1 != ar2) {return false;}
    */

    return equal;
  }
Example #2
0
  public void Write(OutputStream output) throws IOException {
    BitUtils.WriteString(output, "GIF87a");

    ScreenDescriptor sd = new ScreenDescriptor(this.width_, this.height_, this.numColors_);
    sd.Write(output);

    output.write(this.colors_, 0, this.colors_.length);

    ImageDescriptor id = new ImageDescriptor(this.width_, this.height_, ',');
    id.Write(output);

    byte codesize = BitUtils.BitsNeeded(this.numColors_);
    if (codesize == 1) codesize = (byte) (codesize + 1);
    output.write(codesize);

    LZWCompressor.LZWCompress(output, codesize, this.pixels_);
    output.write(0);

    id = new ImageDescriptor((short) 0, (short) 0, ';');
    id.Write(output);
    output.flush();
  }
Example #3
0
 protected void putImageInRegistry(
     ImageRegistry imageRegistry, String strKey, String relativePath) {
   URL url = TerminalPlugin.getDefault().getBundle().getEntry(relativePath);
   ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url);
   imageRegistry.put(strKey, imageDescriptor);
 }