com.objectplanet.image.PngEncoder

16:34:31.664 INFO  jd.cli.Main - Decompiling com.objectplanet.image.PngEncoder.jar
package com.objectplanet.image;

import java.awt.Image;
import java.awt.image.ColorModel;
import java.awt.image.ImageConsumer;
import java.awt.image.ImageProducer;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Hashtable;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;

abstract class b
  implements ImageConsumer
{
  private ImageProducer jdField_case;
  protected ByteArrayOutputStream jdField_try;
  protected ByteArrayOutputStream jdField_do;
  protected DeflaterOutputStream jdField_if;
  protected Deflater jdField_new;
  private CRC32 jdField_for;
  protected int jdField_int;
  protected byte[] jdField_byte;
  private boolean a;
  
  b(int paramInt)
  {
    if ((paramInt < -1) || (paramInt > 9)) {
      throw new IllegalArgumentException("Invalid compression: " + paramInt);
    }
    jdField_try = new ByteArrayOutputStream();
    jdField_do = new ByteArrayOutputStream();
    jdField_new = new Deflater(paramInt);
    jdField_for = new CRC32();
  }
  
  void a(int paramInt)
  {
    jdField_new.setLevel(paramInt);
  }
  
  synchronized void a(Image paramImage, DataOutputStream paramDataOutputStream)
    throws IOException
  {
    if ((paramImage == null) || (paramDataOutputStream == null)) {
      return;
    }
    jdField_do.reset();
    jdField_do.write("IDAT".getBytes());
    jdField_new.reset();
    jdField_if = new DeflaterOutputStream(jdField_do, jdField_new);
    a = true;
    jdField_case = paramImage.getSource();
    jdField_case.startProduction(this);
    while (a) {
      try
      {
        wait();
      }
      catch (InterruptedException localInterruptedException)
      {
        localInterruptedException.printStackTrace();
      }
    }
    a();
    a(paramDataOutputStream);
  }
  
  protected void a()
  {
    try
    {
      jdField_if.finish();
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
  
  public void setDimensions(int paramInt1, int paramInt2)
  {
    jdField_try.reset();
    try
    {
      DataOutputStream localDataOutputStream = new DataOutputStream(jdField_try);
      localDataOutputStream.write("IHDR".getBytes());
      localDataOutputStream.writeInt(paramInt1);
      localDataOutputStream.writeInt(paramInt2);
      localDataOutputStream.write(8);
      localDataOutputStream.write(jdField_int);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
    }
    catch (IOException localIOException) {}
  }
  
  public void setColorModel(ColorModel paramColorModel) {}
  
  public abstract void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6);
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, byte[] paramArrayOfByte, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfByte == null)) {
      return;
    }
    int[] arrayOfInt = new int[paramArrayOfByte.length];
    for (int i = 0; i < paramArrayOfByte.length; i++) {
      paramArrayOfByte[i] &= 0xFF;
    }
    setPixels(paramInt1, paramInt2, paramInt3, paramInt4, paramColorModel, arrayOfInt, paramInt5, paramInt6);
  }
  
  public synchronized void imageComplete(int paramInt)
  {
    jdField_case.removeConsumer(this);
    a = false;
    notifyAll();
  }
  
  protected void a(DataOutputStream paramDataOutputStream)
    throws IOException
  {
    a(jdField_try, paramDataOutputStream);
    a(jdField_do, paramDataOutputStream);
  }
  
  protected void a(ByteArrayOutputStream paramByteArrayOutputStream, DataOutputStream paramDataOutputStream)
    throws IOException
  {
    if ((paramByteArrayOutputStream != null) && (paramDataOutputStream != null))
    {
      paramDataOutputStream.writeInt(paramByteArrayOutputStream.size() - 4);
      byte[] arrayOfByte = paramByteArrayOutputStream.toByteArray();
      paramDataOutputStream.write(arrayOfByte);
      jdField_for.reset();
      jdField_for.update(arrayOfByte);
      paramDataOutputStream.writeInt((int)jdField_for.getValue());
    }
  }
  
  public void setProperties(Hashtable paramHashtable) {}
  
  public void setHints(int paramInt) {}
}

/* Location:
 * Qualified Name:     com.objectplanet.image.b
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.image.ColorModel;
import java.io.IOException;
import java.util.zip.DeflaterOutputStream;

public class f
  extends d
{
  f(int paramInt)
  {
    super(paramInt);
    jdField_int = 4;
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((jdField_byte == null) || (jdField_byte.length < paramInt6 * 2 + 1)) {
      jdField_byte = new byte[paramInt6 * 4 + 1];
    }
    int j = 0;
    for (int k = 0; k < paramInt4; k++)
    {
      jdField_byte[0] = 0;
      int m = 0;
      int n = 1;
      while (m < paramInt6)
      {
        int i1 = paramArrayOfInt[j] >> 24 & 0xFF;
        int i2 = paramArrayOfInt[j] >> 16 & 0xFF;
        int i3 = paramArrayOfInt[j] >> 8 & 0xFF;
        int i4 = paramArrayOfInt[j] & 0xFF;
        if ((i2 != i3) || (i2 != i4))
        {
          int i = (int)(i2 * 0.3D + i3 * 0.59D + i4 * 0.11D);
          jdField_byte[n] = ((byte)i);
        }
        else
        {
          jdField_byte[n] = ((byte)i2);
        }
        jdField_byte[(n + 2)] = ((byte)(i1 % 256));
        jdField_byte[(n + 3)] = ((byte)(i1 / 256));
        n += 4;
        j++;
        m++;
      }
      try
      {
        jdField_if.write(jdField_byte, 0, paramInt6 * 4 + 1);
      }
      catch (IOException localIOException) {}
    }
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.f
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.image.ColorModel;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.util.zip.DeflaterOutputStream;

public class d
  extends b
{
  d(int paramInt)
  {
    super(paramInt);
    jdField_int = 0;
  }
  
  public void setDimensions(int paramInt1, int paramInt2)
  {
    jdField_try.reset();
    try
    {
      DataOutputStream localDataOutputStream = new DataOutputStream(jdField_try);
      localDataOutputStream.write("IHDR".getBytes());
      localDataOutputStream.writeInt(paramInt1);
      localDataOutputStream.writeInt(paramInt2);
      localDataOutputStream.write(16);
      localDataOutputStream.write(jdField_int);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
    }
    catch (IOException localIOException) {}
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((jdField_byte == null) || (jdField_byte.length < paramInt6 * 2 + 1)) {
      jdField_byte = new byte[paramInt6 * 2 + 1];
    }
    int j = 0;
    for (int k = 0; k < paramInt4; k++)
    {
      jdField_byte[0] = 0;
      int m = 0;
      int n = 1;
      while (m < paramInt6)
      {
        int i1 = paramArrayOfInt[j] >> 16 & 0xFF;
        int i2 = paramArrayOfInt[j] >> 8 & 0xFF;
        int i3 = paramArrayOfInt[j] & 0xFF;
        if ((i1 != i2) || (i1 != i3))
        {
          int i = (int)(i1 * 0.3D + i2 * 0.59D + i3 * 0.11D);
          jdField_byte[n] = ((byte)i);
        }
        else
        {
          jdField_byte[n] = ((byte)i1);
        }
        n += 2;
        j++;
        m++;
      }
      try
      {
        jdField_if.write(jdField_byte, 0, paramInt6 * 2 + 1);
      }
      catch (IOException localIOException) {}
    }
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.d
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.Image;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.DeflaterOutputStream;

public class a
  extends e
{
  protected ByteArrayOutputStream j = new ByteArrayOutputStream();
  protected ByteArrayOutputStream h = new ByteArrayOutputStream();
  private boolean i;
  
  a(int paramInt)
  {
    super(paramInt);
    jdField_int = 5;
  }
  
  synchronized void a(Image paramImage, DataOutputStream paramDataOutputStream)
    throws IOException
  {
    j.reset();
    j.write("tRNS".getBytes());
    h.reset();
    h.write("tRNS".getBytes());
    i = false;
    super.a(paramImage, paramDataOutputStream);
  }
  
  protected void a(DataOutputStream paramDataOutputStream)
    throws IOException
  {
    a(jdField_try, paramDataOutputStream);
    if (!d)
    {
      a(jdField_void, paramDataOutputStream);
      a(j, paramDataOutputStream);
    }
    else
    {
      a(b, paramDataOutputStream);
      a(h, paramDataOutputStream);
    }
    a(jdField_do, paramDataOutputStream);
  }
  
  public void setDimensions(int paramInt1, int paramInt2)
  {
    jdField_try.reset();
    try
    {
      DataOutputStream localDataOutputStream = new DataOutputStream(jdField_try);
      localDataOutputStream.write("IHDR".getBytes());
      localDataOutputStream.writeInt(paramInt1);
      localDataOutputStream.writeInt(paramInt2);
      localDataOutputStream.write(8);
      localDataOutputStream.write(3);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
      localDataOutputStream.write(0);
    }
    catch (IOException localIOException) {}
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((!jdField_char) && ((e == 1) || (e == 0)))
    {
      jdMethod_if();
      jdField_char = true;
    }
    if (!i)
    {
      h.write(0);
      i = true;
    }
    int k = 0;
    jdField_long = (jdField_void.size() - 4);
    for (int m = 0; m < paramInt4; m++)
    {
      jdField_else[jdField_goto] = 0;
      jdField_byte[jdField_goto] = 0;
      jdField_goto += 1;
      for (int n = 0; n < paramInt6; n++)
      {
        if ((e == 1) || (e == 0)) {
          if (paramColorModel.getAlpha(paramArrayOfInt[k]) == 0) {
            jdField_else[(n + 1)] = 0;
          } else {
            jdMethod_do(paramArrayOfInt[k]);
          }
        }
        if ((e == 2) || (e == 0))
        {
          int i1 = c.a(paramArrayOfInt[k]);
          if ((i1 == -1) && (jdField_long < 768))
          {
            jdField_void.write((byte)paramColorModel.getRed(paramArrayOfInt[k]));
            jdField_void.write((byte)paramColorModel.getGreen(paramArrayOfInt[k]));
            jdField_void.write((byte)paramColorModel.getBlue(paramArrayOfInt[k]));
            j.write((byte)paramColorModel.getAlpha(paramArrayOfInt[k]));
            i1 = jdField_long / 3;
            c.a(paramArrayOfInt[k], i1);
            jdField_long += 3;
          }
          if (i1 >= 0) {
            jdField_byte[jdField_goto] = ((byte)i1);
          } else {
            jdField_byte[jdField_goto] = 0;
          }
        }
        jdField_goto += 1;
        k++;
      }
      if ((e == 1) || ((e == 0) && (jdField_long >= 768))) {
        d = true;
      }
    }
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, byte[] paramArrayOfByte, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfByte == null)) {
      return;
    }
    if (!jdField_char)
    {
      byte[] arrayOfByte1 = new byte['?'];
      byte[] arrayOfByte2 = new byte['?'];
      byte[] arrayOfByte3 = new byte['?'];
      byte[] arrayOfByte4 = new byte['?'];
      ((IndexColorModel)paramColorModel).getAlphas(arrayOfByte1);
      ((IndexColorModel)paramColorModel).getReds(arrayOfByte2);
      ((IndexColorModel)paramColorModel).getGreens(arrayOfByte3);
      ((IndexColorModel)paramColorModel).getBlues(arrayOfByte4);
      for (int k = 0; k < 256; k++)
      {
        jdField_void.write(arrayOfByte2[k]);
        jdField_void.write(arrayOfByte3[k]);
        jdField_void.write(arrayOfByte4[k]);
        j.write(arrayOfByte1[k]);
      }
      jdField_char = true;
    }
    try
    {
      jdField_if.write(0);
      jdField_if.write(paramArrayOfByte, 0, paramArrayOfByte.length);
    }
    catch (IOException localIOException) {}
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.a
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

class e$a$a
{
  int a;
  int jdField_do;
  a jdField_if;
  private final e.a this$1;
  
  e$a$a(e.a parama)
  {
    this$1 = parama;
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.e.a.a
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

class e$a
{
  a[] a;
  private final e this$0;
  
  e$a(e parame)
  {
    this$0 = parame;
    a = new a[101];
  }
  
  void a(int paramInt1, int paramInt2)
  {
    int i = (paramInt1 & 0x7FFFFFFF) % a.length;
    for (a locala = a[i]; locala != null; locala = jdField_if) {
      if (a == paramInt1)
      {
        jdField_do = paramInt2;
        return;
      }
    }
    locala = new a();
    a = paramInt1;
    jdField_do = paramInt2;
    jdField_if = a[i];
    a[i] = locala;
  }
  
  int a(int paramInt)
  {
    int i = (paramInt & 0x7FFFFFFF) % a.length;
    for (a locala = a[i]; locala != null; locala = jdField_if) {
      if (a == paramInt) {
        return jdField_do;
      }
    }
    return -1;
  }
  
  void a()
  {
    for (int i = 0; i < a.length; i++) {
      a[i] = null;
    }
  }
  
  class a
  {
    int a;
    int jdField_do;
    a jdField_if;
    
    a() {}
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.e.a
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.Image;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.DeflaterOutputStream;

public class e
  extends b
{
  protected a c = new a();
  protected a g = new a();
  protected ByteArrayOutputStream jdField_void = new ByteArrayOutputStream();
  protected ByteArrayOutputStream b = new ByteArrayOutputStream();
  protected boolean jdField_char;
  protected byte[] jdField_else;
  protected int jdField_goto;
  protected int f;
  protected int jdField_long;
  protected int e;
  protected boolean d;
  
  e(int paramInt)
  {
    super(paramInt);
    jdField_int = 3;
  }
  
  synchronized void a(Image paramImage, DataOutputStream paramDataOutputStream)
    throws IOException
  {
    jdField_void.reset();
    jdField_void.write("PLTE".getBytes());
    b.reset();
    b.write("PLTE".getBytes());
    if ((e == 2) || (e == 0)) {
      c.a();
    }
    jdField_char = false;
    f = ((paramImage.getWidth(null) + 1) * paramImage.getHeight(null));
    jdField_byte = new byte[f];
    jdField_else = new byte[f];
    jdField_goto = 0;
    super.a(paramImage, paramDataOutputStream);
  }
  
  protected void a()
  {
    try
    {
      if (!d) {
        jdField_if.write(jdField_byte, 0, f);
      } else {
        jdField_if.write(jdField_else, 0, f);
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    super.a();
  }
  
  protected void a(DataOutputStream paramDataOutputStream)
    throws IOException
  {
    a(jdField_try, paramDataOutputStream);
    if (!d) {
      a(jdField_void, paramDataOutputStream);
    } else {
      a(b, paramDataOutputStream);
    }
    a(jdField_do, paramDataOutputStream);
  }
  
  protected void jdMethod_if()
  {
    int i = 0;
    int j = 16777215;
    while (i < 3)
    {
      b.write(-1);
      b.write(-1);
      b.write(-1);
      g.a(j, i);
      i++;
    }
    for (int k = 50; k <= 255; k += 41) {
      for (int m = 50; m <= 255; m += 41) {
        for (int n = 50; n <= 255; n += 41) {
          if ((k != m) || (k != n))
          {
            j = k << 16 | m << 8 | n;
            b.write((byte)k);
            b.write((byte)m);
            b.write((byte)n);
            g.a(j, i);
            i++;
          }
        }
      }
    }
    for (k = 0; k <= 252; k += 6)
    {
      j = k << 16 | k << 8 | k;
      b.write(k);
      b.write(k);
      b.write(k);
      g.a(j, i);
      i++;
    }
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((!jdField_char) && ((e == 1) || (e == 0)))
    {
      jdMethod_if();
      jdField_char = true;
    }
    int i = 0;
    jdField_long = (jdField_void.size() - 4);
    for (int j = 0; j < paramInt4; j++)
    {
      jdField_else[jdField_goto] = 0;
      jdField_byte[jdField_goto] = 0;
      jdField_goto += 1;
      for (int k = 0; k < paramInt6; k++)
      {
        if ((e == 1) || (e == 0)) {
          jdMethod_do(paramArrayOfInt[i]);
        }
        if ((e == 2) || (e == 0))
        {
          int m = c.a(paramArrayOfInt[i]);
          if ((m == -1) && (jdField_long < 768))
          {
            jdField_void.write((byte)paramColorModel.getRed(paramArrayOfInt[i]));
            jdField_void.write((byte)paramColorModel.getGreen(paramArrayOfInt[i]));
            jdField_void.write((byte)paramColorModel.getBlue(paramArrayOfInt[i]));
            m = jdField_long / 3;
            c.a(paramArrayOfInt[i], m);
            jdField_long += 3;
          }
          if (m >= 0) {
            jdField_byte[jdField_goto] = ((byte)m);
          } else {
            jdField_byte[jdField_goto] = 0;
          }
        }
        jdField_goto += 1;
        i++;
      }
      if ((e == 1) || ((e == 0) && (jdField_long >= 768))) {
        d = true;
      }
    }
  }
  
  void jdMethod_do(int paramInt)
  {
    int j = paramInt >> 16 & 0xFF;
    int k = paramInt >> 8 & 0xFF;
    int m = paramInt & 0xFF;
    float f1 = Math.abs(j - k);
    f1 = Math.max(f1, Math.abs(j - m));
    f1 = Math.max(f1, Math.abs(m - k));
    int i;
    if ((f1 < 24.0F) || ((j < 50) && (k < 50) && (m < 50)))
    {
      n = (int)(j * 0.3D + k * 0.59D + m * 0.11D);
      n = (int)Math.round(n / 6.0D) * 6;
      n = Math.max(n, 6);
      n = Math.min(n, 252);
      i = n << 16 | n << 8 | n;
    }
    else
    {
      n = (int)Math.round((j - 50) / 41.0D) * 41 + 50;
      int i1 = (int)Math.round((k - 50) / 41.0D) * 41 + 50;
      int i2 = (int)Math.round((m - 50) / 41.0D) * 41 + 50;
      n = Math.max(n, 50);
      i1 = Math.max(i1, 50);
      i2 = Math.max(i2, 50);
      if ((n == i1) && (i1 == i2))
      {
        n = (int)Math.round(n / 6.0D) * 6;
        i1 = i2 = n;
      }
      i = n << 16 | i1 << 8 | i2;
    }
    int n = g.a(i);
    if (n >= 0) {
      jdField_else[jdField_goto] = ((byte)n);
    } else {
      jdField_else[jdField_goto] = 0;
    }
  }
  
  public synchronized void jdMethod_if(int paramInt)
  {
    c.a();
    jdField_char = false;
    e = paramInt;
  }
  
  public synchronized int jdMethod_do()
  {
    return e;
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, byte[] paramArrayOfByte, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfByte == null)) {
      return;
    }
    if (!jdField_char)
    {
      byte[] arrayOfByte1 = new byte['?'];
      byte[] arrayOfByte2 = new byte['?'];
      byte[] arrayOfByte3 = new byte['?'];
      ((IndexColorModel)paramColorModel).getReds(arrayOfByte1);
      ((IndexColorModel)paramColorModel).getGreens(arrayOfByte2);
      ((IndexColorModel)paramColorModel).getBlues(arrayOfByte3);
      for (int i = 0; i < 256; i++)
      {
        jdField_void.write(arrayOfByte1[i]);
        jdField_void.write(arrayOfByte2[i]);
        jdField_void.write(arrayOfByte3[i]);
      }
      jdField_char = true;
    }
    try
    {
      jdField_if.write(0);
      jdField_if.write(paramArrayOfByte, 0, paramArrayOfByte.length);
    }
    catch (IOException localIOException) {}
  }
  
  class a
  {
    a[] a = new a[101];
    
    a() {}
    
    void a(int paramInt1, int paramInt2)
    {
      int i = (paramInt1 & 0x7FFFFFFF) % a.length;
      for (a locala = a[i]; locala != null; locala = jdField_if) {
        if (a == paramInt1)
        {
          jdField_do = paramInt2;
          return;
        }
      }
      locala = new a();
      a = paramInt1;
      jdField_do = paramInt2;
      jdField_if = a[i];
      a[i] = locala;
    }
    
    int a(int paramInt)
    {
      int i = (paramInt & 0x7FFFFFFF) % a.length;
      for (a locala = a[i]; locala != null; locala = jdField_if) {
        if (a == paramInt) {
          return jdField_do;
        }
      }
      return -1;
    }
    
    void a()
    {
      for (int i = 0; i < a.length; i++) {
        a[i] = null;
      }
    }
    
    class a
    {
      int a;
      int jdField_do;
      a jdField_if;
      
      a() {}
    }
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.e
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.Image;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;

public class PngEncoder
{
  public static final int COLOR_GRAYSCALE = 0;
  public static final int COLOR_TRUECOLOR = 2;
  public static final int COLOR_INDEXED = 3;
  public static final int COLOR_GRAYSCALE_ALPHA = 4;
  public static final int COLOR_INDEXED_ALPHA = 5;
  public static final int COLOR_TRUECOLOR_ALPHA = 6;
  public static final int INDEXED_COLORS_AUTO = 0;
  public static final int INDEXED_COLORS_CONVERT = 1;
  public static final int INDEXED_COLORS_ORIGINAL = 2;
  public static final int DEFAULT_COMPRESSION = -1;
  public static final int BEST_SPEED = 1;
  public static final int BEST_COMPRESSION = 9;
  private static final byte[] jdField_if = { -119, 80, 78, 71, 13, 10, 26, 10 };
  private static final byte[] a = { 0, 0, 0, 0, 73, 69, 78, 68, -82, 66, 96, -126 };
  private int jdField_do;
  private int jdField_int;
  private b jdField_for;
  
  public PngEncoder()
  {
    this(2);
  }
  
  public PngEncoder(int paramInt)
  {
    this(paramInt, -1);
  }
  
  public PngEncoder(int paramInt1, int paramInt2)
  {
    jdField_int = paramInt2;
    a(paramInt1, paramInt2);
  }
  
  private void a(int paramInt1, int paramInt2)
  {
    jdField_do = paramInt1;
    switch (paramInt1)
    {
    case 3: 
      jdField_for = new e(paramInt2);
      break;
    case 5: 
      jdField_for = new a(paramInt2);
      break;
    case 2: 
      jdField_for = new c(paramInt2);
      break;
    case 6: 
      jdField_for = new g(paramInt2);
      break;
    case 0: 
      jdField_for = new d(paramInt2);
      break;
    case 4: 
      jdField_for = new f(paramInt2);
      break;
    case 1: 
    default: 
      throw new IllegalArgumentException("Invalid colorType, must be COLOR_INDEXED, COLOR_TRUECOLOR, COLOR_GRAYSCALE, COLOR_INDEXED_ALPHA, COLOR_TRUECOLOR_ALPHA or COLOR_GRAYSCALE_ALPHA");
    }
  }
  
  public synchronized void setColorType(int paramInt)
  {
    a(paramInt, jdField_int);
  }
  
  public synchronized int getColorType()
  {
    return jdField_do;
  }
  
  public synchronized void setIndexedColorMode(int paramInt)
  {
    if ((jdField_for instanceof e)) {
      ((e)jdField_for).jdMethod_if(paramInt);
    }
  }
  
  public synchronized int getIndexedColorMode()
  {
    if ((jdField_for instanceof e)) {
      return ((e)jdField_for).jdMethod_do();
    }
    return -1;
  }
  
  public synchronized void setCompression(int paramInt)
  {
    jdField_int = paramInt;
    jdField_for.a(paramInt);
  }
  
  public static String getVersion()
  {
    return "2.0.2";
  }
  
  public static void main(String[] paramArrayOfString)
  {
    System.out.println("Java PngEncoder " + getVersion());
    System.out.println("Copyright 2003-2006, ObjectPlanet, Inc.");
  }
  
  public synchronized void encode(Image paramImage, OutputStream paramOutputStream)
    throws IOException
  {
    if ((paramImage == null) || (paramImage.getSource() == null) || (paramOutputStream == null)) {
      return;
    }
    paramOutputStream.write(if);
    jdField_for.a(paramImage, new DataOutputStream(paramOutputStream));
    paramOutputStream.write(a);
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.PngEncoder
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.image.ColorModel;
import java.io.IOException;
import java.util.zip.DeflaterOutputStream;

public class g
  extends c
{
  g(int paramInt)
  {
    super(paramInt);
    jdField_int = 6;
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((jdField_byte == null) || (jdField_byte.length < paramInt6 * 4 + 1)) {
      jdField_byte = new byte[paramInt6 * 4 + 1];
    }
    int i = 0;
    for (int j = 0; j < paramInt4; j++)
    {
      jdField_byte[0] = 0;
      int k = 0;
      int m = 1;
      while (k < paramInt6)
      {
        jdField_byte[m] = ((byte)(paramArrayOfInt[i] >> 16 & 0xFF));
        jdField_byte[(m + 1)] = ((byte)(paramArrayOfInt[i] >> 8 & 0xFF));
        jdField_byte[(m + 2)] = ((byte)(paramArrayOfInt[i] & 0xFF));
        jdField_byte[(m + 3)] = ((byte)(paramArrayOfInt[i] >> 24 & 0xFF));
        m += 4;
        i++;
        k++;
      }
      try
      {
        jdField_if.write(jdField_byte, 0, paramInt6 * 4 + 1);
      }
      catch (IOException localIOException) {}
    }
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.g
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package com.objectplanet.image;

import java.awt.image.ColorModel;
import java.io.IOException;
import java.util.zip.DeflaterOutputStream;

public class c
  extends b
{
  c(int paramInt)
  {
    super(paramInt);
    jdField_int = 2;
  }
  
  public void setPixels(int paramInt1, int paramInt2, int paramInt3, int paramInt4, ColorModel paramColorModel, int[] paramArrayOfInt, int paramInt5, int paramInt6)
  {
    if ((paramColorModel == null) || (paramArrayOfInt == null)) {
      return;
    }
    if ((jdField_byte == null) || (jdField_byte.length < paramInt6 * 3 + 1)) {
      jdField_byte = new byte[paramInt6 * 3 + 1];
    }
    int i = 0;
    for (int j = 0; j < paramInt4; j++)
    {
      jdField_byte[0] = 0;
      int k = 0;
      int m = 1;
      while (k < paramInt6)
      {
        jdField_byte[m] = ((byte)(paramArrayOfInt[i] >> 16 & 0xFF));
        jdField_byte[(m + 1)] = ((byte)(paramArrayOfInt[i] >> 8 & 0xFF));
        jdField_byte[(m + 2)] = ((byte)(paramArrayOfInt[i] & 0xFF));
        m += 3;
        i++;
        k++;
      }
      try
      {
        jdField_if.write(jdField_byte, 0, paramInt6 * 3 + 1);
      }
      catch (IOException localIOException) {}
    }
  }
}

/* Location:
 * Qualified Name:     com.objectplanet.image.c
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd