home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
-
- class MyFactorRotatie extends Applet {
- int[] point;
- // $FF: renamed from: ic int
- private int field_0;
- private int smin;
- private int smax;
- // $FF: renamed from: wh int
- private int field_1;
- private int sw2;
- private int dw2;
- // $FF: renamed from: x int
- private int field_2;
- // $FF: renamed from: y int
- private int field_3;
- // $FF: renamed from: xx int
- private int field_4;
- // $FF: renamed from: yy int
- private int field_5;
- private double cosHoek;
- private double sinHoek;
- // $FF: renamed from: f double
- private double field_6;
-
- private void go270() {
- int dm = this.dw2 / 2;
- int sm = this.sw2 / 2;
- this.field_1 = (this.dw2 - this.sw2) / 2;
-
- for(this.field_2 = 0; this.field_2 < this.dw2 * this.dw2 - 1; ++this.field_2) {
- this.point[this.field_2] = this.field_0;
- }
-
- for(this.field_2 = 0; this.field_2 < this.sw2; ++this.field_2) {
- for(this.field_3 = 0; this.field_3 < this.sw2; ++this.field_3) {
- this.field_5 = (int)(this.field_6 * (double)(this.sw2 - 1 - this.field_2 - sm)) + dm;
- this.field_4 = (int)(this.field_6 * (double)(this.field_3 - sm)) + dm;
- this.point[this.field_5 * this.dw2 + this.field_4] = this.field_3 * this.sw2 + this.field_2;
- }
- }
-
- }
-
- private void gonormal() {
- for(this.field_2 = 1; this.field_2 < this.dw2 * this.dw2 - 1; ++this.field_2) {
- this.point[this.field_2] = -1;
- }
-
- this.point[0] = this.field_0;
- this.point[this.dw2 * this.dw2 - 1] = this.field_0;
-
- for(this.field_2 = this.smin; this.field_2 < this.smax + 1; ++this.field_2) {
- for(this.field_3 = this.smin; this.field_3 < this.smax + 1; ++this.field_3) {
- this.field_4 = (int)(this.field_6 * (double)this.field_2 * this.cosHoek - this.field_6 * (double)this.field_3 * this.sinHoek) + this.field_1;
- this.field_5 = (int)(this.field_6 * (double)this.field_2 * this.sinHoek + this.field_6 * (double)this.field_3 * this.cosHoek) + this.field_1;
- this.point[this.field_5 * this.dw2 + this.field_4] = (this.field_3 - this.smin) * this.sw2 + this.field_2 - this.smin;
- }
- }
-
- for(this.field_2 = 1; this.field_2 < this.dw2 * this.dw2 - 1; ++this.field_2) {
- if (this.point[this.field_2] == -1) {
- if (this.point[this.field_2 + 1] != -1) {
- this.point[this.field_2] = this.point[this.field_2 + 1];
- } else {
- this.point[this.field_2] = this.field_0;
- }
- }
- }
-
- }
-
- MyFactorRotatie(int IndexColor, int sw, int dw, double sinusHoek, double cosinusHoek, double factor) {
- this.point = new int[dw * dw];
- this.smin = -sw / 2 + 1;
- this.smax = sw / 2;
- this.field_1 = dw / 2;
- this.field_6 = factor;
- this.sw2 = sw;
- this.dw2 = dw;
- this.cosHoek = cosinusHoek;
- this.sinHoek = sinusHoek;
- this.field_0 = IndexColor;
- if (sinusHoek == (double)1.0F) {
- this.go90();
- } else if (cosinusHoek == (double)-1.0F) {
- this.go180();
- } else if (sinusHoek == (double)-1.0F) {
- this.go270();
- } else {
- this.gonormal();
- }
-
- }
-
- private void go90() {
- int dm = this.dw2 / 2;
- int sm = this.sw2 / 2;
- this.field_1 = (this.dw2 - this.sw2) / 2;
-
- for(this.field_2 = 0; this.field_2 < this.dw2 * this.dw2 - 1; ++this.field_2) {
- this.point[this.field_2] = this.field_0;
- }
-
- for(this.field_2 = 0; this.field_2 < this.sw2; ++this.field_2) {
- for(this.field_3 = 0; this.field_3 < this.sw2; ++this.field_3) {
- this.field_5 = (int)(this.field_6 * (double)(this.field_2 - sm)) + dm;
- this.field_4 = (int)(this.field_6 * (double)(this.sw2 - 1 - this.field_3 - sm)) + dm;
- this.point[this.field_5 * this.dw2 + this.field_4] = this.field_3 * this.sw2 + this.field_2;
- }
- }
-
- }
-
- private void go180() {
- int dm = this.dw2 / 2;
- int sm = this.sw2 / 2;
- this.field_1 = (this.dw2 - this.sw2) / 2;
-
- for(this.field_2 = 0; this.field_2 < this.dw2 * this.dw2 - 1; ++this.field_2) {
- this.point[this.field_2] = this.field_0;
- }
-
- for(this.field_2 = 0; this.field_2 < this.sw2; ++this.field_2) {
- for(this.field_3 = 0; this.field_3 < this.sw2; ++this.field_3) {
- this.field_5 = (int)(this.field_6 * (double)(this.sw2 - 1 - this.field_3 - sm)) + dm;
- this.field_4 = (int)(this.field_6 * (double)(this.sw2 - 1 - this.field_2 - sm)) + dm;
- this.point[this.field_5 * this.dw2 + this.field_4] = this.field_3 * this.sw2 + this.field_2;
- }
- }
-
- }
- }
-