/* Class137 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

public abstract class Class137 implements Interface19
{
    static int[] anIntArray1572;
    static double aDouble1573 = -1.0;
    static Class211 aClass211_1574;
    static int anInt1575;
    
    public int[] method89(Class558 class558, int i, float f, int i_0_,
			  int i_1_, boolean bool, int i_2_) {
	return method1887(class558, i, (double) f);
    }
    
    abstract byte[] method1886(Class558 class558, int i, byte i_3_);
    
    int[] method1887(Class558 class558, int i, double d) {
	int[] is = method1889(class558, i, d);
	if (null == is)
	    return null;
	for (int i_4_ = 0; i_4_ < is.length; i_4_++) {
	    if ((is[i_4_] & 0xffffff) != 0)
		is[i_4_] = is[i_4_] | ~0xffffff;
	    else
		is[i_4_] = is[i_4_] & 0xffffff;
	}
	return is;
    }
    
    public void method86(int i) {
	/* empty */
    }
    
    float[] method1888(Class558 class558, int i, double d) {
	if (class558 != Class558.aClass558_7536)
	    return null;
	int[] is = method1889(class558, i, d);
	if (is == null)
	    return null;
	int[] is_5_ = null;
	byte[] is_6_ = method1886(Class558.aClass558_7535, i, (byte) 74);
	if (null != is_6_) {
	    try {
		byte i_7_ = (byte) (is_6_[0] & 0xff);
		if (1 != i_7_)
		    return null;
		byte[] is_8_ = new byte[is_6_.length - 5];
		System.arraycopy(is_6_, 5, is_8_, 0, is_6_.length - 5);
		is_5_ = method1890(is_8_, false, (byte) 54);
		for (int i_9_ = 0; i_9_ < is_5_.length; i_9_++)
		    is_5_[i_9_] = is_5_[i_9_] & 0xff;
	    } catch (IOException ioexception) {
		/* empty */
	    }
	}
	if (is_5_ == null)
	    is_5_ = new int[is.length];
	float[] fs = new float[is.length * 4];
	int i_10_ = 0;
	for (int i_11_ = 0; i_11_ < is.length; i_11_++) {
	    int i_12_ = is[i_11_];
	    int i_13_ = i_12_ >>> 24;
	    int i_14_ = (i_12_ & 0xff0000) >> 16;
	    int i_15_ = (i_12_ & 0xff00) >> 8;
	    int i_16_ = i_12_ & 0xff;
	    float f = (float) is_5_[i_11_] * 31.0F / 255.0F + 1.0F;
	    fs[i_10_++] = f * (float) i_14_ / 255.0F;
	    fs[i_10_++] = (float) i_15_ * f / 255.0F;
	    fs[i_10_++] = f * (float) i_16_ / 255.0F;
	    fs[i_10_++] = (float) i_13_ / 255.0F;
	}
	return fs;
    }
    
    Class137() {
	/* empty */
    }
    
    int[] method1889(Class558 class558, int i, double d) {
	byte[] is = method1886(class558, i, (byte) 30);
	if (is == null)
	    return null;
	int[] is_17_;
	try {
	    byte i_18_ = (byte) (is[0] & 0xff);
	    if (Class558.aClass558_7537 == class558) {
		if (i_18_ != 6)
		    return null;
		int[] is_19_ = null;
		int i_20_ = 1;
		for (int i_21_ = 0; i_21_ < 6; i_21_++) {
		    int i_22_ = ((is[i_20_] & 0xff) << 24
				 | (is[1 + i_20_] & 0xff) << 16
				 | (is[i_20_ + 2] & 0xff) << 8
				 | is[3 + i_20_] & 0xff);
		    byte[] is_23_ = new byte[i_22_];
		    System.arraycopy(is, i_20_ + 4, is_23_, 0, i_22_);
		    int[] is_24_ = method1890(is_23_, false, (byte) 74);
		    if (i_21_ == 0)
			is_19_ = new int[is_24_.length * 6];
		    System.arraycopy(is_24_, 0, is_19_, is_24_.length * i_21_,
				     is_24_.length);
		    i_20_ += 4 + i_22_;
		}
		if (d != 1.0)
		    Class487.method6004(is_19_, d);
		return is_19_;
	    }
	    if (1 != i_18_)
		return null;
	    byte[] is_25_ = new byte[is.length - 5];
	    System.arraycopy(is, 5, is_25_, 0, is.length - 5);
	    int[] is_26_ = method1890(is_25_, false, (byte) 70);
	    if (is_26_ == null)
		return null;
	    if (d != 1.0)
		Class487.method6004(is_26_, d);
	    is_17_ = is_26_;
	} catch (IOException ioexception) {
	    return null;
	}
	return is_17_;
    }
    
    public int[] method84(Class558 class558, int i, float f, int i_27_,
			  int i_28_, boolean bool, int i_29_) {
	return method1889(class558, i, (double) f);
    }
    
    int[] method1890(byte[] is, boolean bool, byte i) throws IOException {
	BufferedImage bufferedimage
	    = ImageIO.read(new ByteArrayInputStream(is));
	if (null == bufferedimage)
	    return null;
	int[] is_30_ = Class79.method1217(bufferedimage, (byte) 78);
	if (bool) {
	    for (int i_31_ = bufferedimage.getHeight() - 1; i_31_ >= 0;
		 i_31_--) {
		int i_32_ = i_31_ * bufferedimage.getWidth();
		for (int i_33_ = (1 + i_31_) * bufferedimage.getWidth();
		     i_32_ < i_33_; i_32_++) {
		    i_33_--;
		    int i_34_ = is_30_[i_32_];
		    is_30_[i_32_] = is_30_[i_33_];
		    is_30_[i_33_] = i_34_;
		}
	    }
	}
	return is_30_;
    }
    
    static {
	anIntArray1572 = new int[256];
    }
    
    public int[] method96(Class558 class558, int i, float f, int i_35_,
			  int i_36_, boolean bool) {
	return method1889(class558, i, (double) f);
    }
    
    abstract byte[] method1891(Class558 class558, int i);
    
    abstract byte[] method1892(Class558 class558, int i);
    
    public abstract boolean method87(Class558 class558, int i,
				     Class550 class550, float f, int i_37_,
				     int i_38_, boolean bool);
    
    public abstract boolean method88(Class558 class558, int i,
				     Class550 class550, float f, int i_39_,
				     int i_40_, boolean bool);
    
    public float[] method85(Class558 class558, int i, float f, int i_41_,
			    int i_42_, boolean bool, int i_43_) {
	return method1888(class558, i, (double) f);
    }
    
    public float[] method95(Class558 class558, int i, float f, int i_44_,
			    int i_45_, boolean bool) {
	return method1888(class558, i, (double) f);
    }
    
    public void method90() {
	/* empty */
    }
    
    public int[] method91(Class558 class558, int i, float f, int i_46_,
			  int i_47_, boolean bool) {
	return method1887(class558, i, (double) f);
    }
    
    public int[] method93(Class558 class558, int i, float f, int i_48_,
			  int i_49_, boolean bool) {
	return method1887(class558, i, (double) f);
    }
    
    public float[] method94(Class558 class558, int i, float f, int i_50_,
			    int i_51_, boolean bool) {
	return method1888(class558, i, (double) f);
    }
    
    abstract byte[] method1893(Class558 class558, int i);
    
    public abstract boolean method83(Class558 class558, int i,
				     Class550 class550, float f, int i_52_,
				     int i_53_, boolean bool);
    
    public int[] method92(Class558 class558, int i, float f, int i_54_,
			  int i_55_, boolean bool) {
	return method1887(class558, i, (double) f);
    }
    
    public abstract boolean method82(Class558 class558, int i,
				     Class550 class550, float f, int i_56_,
				     int i_57_, boolean bool, int i_58_);
    
    static final void method1894(Class612 class612, byte i) {
	int i_59_
	    = (((Class612) class612).anIntArray8021
	       [(((Class612) class612).anInt8022 -= 201091009) * -40654783]);
	Class211 class211 = Class156.method2513(i_59_, (short) -12326);
	((Class612) class612).anIntArray8021
	    [(((Class612) class612).anInt8022 += 201091009) * -40654783 - 1]
	    = class211.anInt2277 * 1699366771;
    }
}
