// Token: 0x06001E86 RID: 7814 RVA: 0x00062E04 File Offset: 0x00061004 protected override void vmethod_0(BinaryWriter writer) { writer.smethod_15(this.size_0); if (this.array_0 == null) { writer.Write(false); } else { writer.Write(true); writer.Write((short)this.rectangle_0.Left); writer.Write((short)this.rectangle_0.Top); writer.Write((short)this.rectangle_0.Right); writer.Write((short)this.rectangle_0.Bottom); foreach (Array[] array in this.array_0) { writer.Write((short)array.Length); Array[] array2 = array; int i = 0; while (i < array2.Length) { Array array3 = array2[i]; writer.Write((short)array3.GetLowerBound(0)); writer.Write((short)array3.Length); if (this.bool_0) { using (IEnumerator enumerator2 = array3.GetEnumerator()) { while (enumerator2.MoveNext()) { object obj = enumerator2.Current; Struct33 color = (Struct33)obj; writer.smethod_19(color); } goto IL_155; } goto IL_116; } goto IL_116; IL_155: i++; continue; IL_116: foreach (object obj2 in array3) { Struct54 color2 = (Struct54)obj2; writer.smethod_17(color2); } goto IL_155; } } } base.vmethod_0(writer); }
// Token: 0x06001E89 RID: 7817 RVA: 0x000632F4 File Offset: 0x000614F4 private Array[] method_7(Struct33[,] pixels, Struct33[,] color_data, short left, short right, short y) { List <Array> list = new List <Array>(); short num = left; while (num <= right && Class95 <ColorType> .smethod_0(pixels, ref num, right, (int)y)) { int i = (int)num; num += 1; Class95 <ColorType> .smethod_1(pixels, ref num, right, y); int num2 = (int)num; num += 1; if (i > num2) { break; } int num3 = num2 - i + 1; int num4 = i - (int)left; Array array = Array.CreateInstance(this.type_0, new int[] { num3 }, new int[] { num4 }); if (this.bool_0) { while (i <= num2) { array.SetValue(color_data[i, (int)y], num4); i++; num4++; } } else { while (i <= num2) { array.SetValue(Struct54.smethod_2(color_data[i, (int)y]), num4); i++; num4++; } } this.int_0 += array.Length; list.Add(array); } return(list.ToArray()); }
// Token: 0x0600214C RID: 8524 RVA: 0x0006FE6C File Offset: 0x0006E06C public unsafe static Class150 smethod_4(this BinaryReader reader) { if (reader.ReadBoolean()) { Size sz = new Size(reader.ReadInt32(), reader.ReadInt32()); byte[] array = reader.smethod_7(); if (array != null) { Struct54[] array2 = new Struct54[sz.Width * sz.Height]; byte[] array3; byte * ptr; if ((array3 = array) != null && array3.Length != 0) { fixed(byte *ptr = &array3[0]) { } } else { ptr = null; } Struct54[] array4; Struct54 * ptr2; if ((array4 = array2) != null && array4.Length != 0) { fixed(Struct54 *ptr2 = &array4[0]) { } } else { ptr2 = null; } Struct54 *ptr3 = ptr2; Struct54 *ptr4 = (Struct54 *)ptr; for (int i = 0; i < sz.Width * sz.Height; i++) { *ptr3 = *ptr4; ptr3++; ptr4++; } ptr2 = null; ptr = null; return(new Class150(array2, sz)); } } return(null); }
// Token: 0x0600223F RID: 8767 RVA: 0x0000E5DD File Offset: 0x0000C7DD public static Struct33 smethod_2(Struct54 c) { return(new Struct33(c.R, c.G, c.B, byte.MaxValue)); }
// Token: 0x06002159 RID: 8537 RVA: 0x0000DA85 File Offset: 0x0000BC85 public static void smethod_17(this BinaryWriter writer, Struct54 color) { writer.Write(color.R); writer.Write(color.G); writer.Write(color.B); }
// Token: 0x06001E94 RID: 7828 RVA: 0x00063DB8 File Offset: 0x00061FB8 public unsafe void method_0() { try { Struct24 @struct = new Struct24(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); Struct24 struct2 = new Struct24(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); bool * ptr = stackalloc bool[(UIntPtr)(this.class95_0.rectangle_0.Height * this.class95_0.rectangle_0.Width)]; bool * ptr2 = stackalloc bool[(UIntPtr)(this.class95_0.rectangle_0.Height * this.class95_0.rectangle_0.Width)]; Struct24 *ptr3 = &@struct; Struct24 *ptr4 = &struct2; using (Class125 @class = new Class125(this.bitmap_0)) { using (new Class125.Class153(@class)) { Array[][] array = new Array[this.class95_0.array_0.Length][]; this.class95_0.array_0.CopyTo(array, 0); for (int i = 0; i < this.class95_0.rectangle_0.Height; i++) { Array[] array2 = array[i]; Array[] array3 = array2; int j = 0; while (j < array3.Length) { Array array4 = array3[j]; int k = array4.GetLowerBound(0); int length = array4.GetLength(0); int num = k + length - 1; bool flag = false; if (this.class95_0.bool_0) { Struct33[] array5 = new Struct33[length]; array4.CopyTo(array5, 0); try { Struct33[] array6; Struct33 * ptr5; if ((array6 = array5) != null && array6.Length != 0) { fixed(Struct33 *ptr5 = &array6[0]) { } } else { ptr5 = null; } Struct33 *ptr6 = ptr5; Struct33 *ptr7 = @class.pBase + @class.Width * i + k; bool * ptr8 = ptr + k + (IntPtr)this.class95_0.rectangle_0.Width * (IntPtr)i; while (k <= num) { if (ptr7->A != ptr6->A || ptr7->R != ptr6->R || ptr7->G != ptr6->G || ptr7->B != ptr6->B) { *ptr8 = true; flag = true; if (ptr3->int_0 > k) { ptr3->int_0 = k; } if (ptr3->int_2 < k) { ptr3->int_2 = k; } } ptr7++; ptr6++; ptr8++; k++; } goto IL_3B8; } finally { Struct33 *ptr5 = null; } goto IL_25F; } goto IL_25F; IL_395: j++; continue; IL_36D: if (ptr3->int_1 > i) { ptr3->int_1 = i; } if (ptr3->int_3 < i) { ptr3->int_3 = i; goto IL_395; } goto IL_395; IL_25F: Struct54[] array7 = new Struct54[length]; array4.CopyTo(array7, 0); try { Struct54[] array8; Struct54 * ptr9; if ((array8 = array7) != null && array8.Length != 0) { fixed(Struct54 *ptr9 = &array8[0]) { } } else { ptr9 = null; } Struct54 *ptr10 = ptr9; Struct33 *ptr11 = @class.pBase + @class.Width * i + k; bool * ptr12 = ptr + k + (IntPtr)this.class95_0.rectangle_0.Width * (IntPtr)i; while (k <= num) { if (ptr11->R != ptr10->R || ptr11->G != ptr10->G || ptr11->B != ptr10->B) { *ptr12 = true; flag = true; if (ptr3->int_0 > k) { ptr3->int_0 = k; } if (ptr3->int_2 < k) { ptr3->int_2 = k; } } ptr11++; ptr10++; ptr12++; k++; } goto IL_3B8; } finally { Struct54 *ptr9 = null; } goto IL_36D; IL_3B8: if (flag) { goto IL_36D; } goto IL_395; } if (this.cancellationToken_0.IsCancellationRequested) { return; } } } } for (int l = ptr3->int_1; l < ptr3->int_3; l++) { bool flag2 = false; bool *ptr13 = ptr + ptr3->int_0 + (IntPtr)l * (IntPtr)this.class95_0.rectangle_0.Width; bool *ptr14 = ptr2 + ptr3->int_0 + (IntPtr)l * (IntPtr)this.class95_0.rectangle_0.Width; for (int m = ptr3->int_0; m < ptr3->int_2; m++) { if (*ptr13 && (m + 1 == this.class95_0.rectangle_0.Width || ptr13[1]) && (m == 0 || *(ptr13 - 1)) && (l + 1 == this.class95_0.rectangle_0.Height || ptr13[this.class95_0.rectangle_0.Width]) && (l == 0 || *(ptr13 - this.class95_0.rectangle_0.Width))) { *ptr14 = true; flag2 = true; if (ptr4->int_0 > m) { ptr4->int_0 = m; } if (ptr4->int_2 < m) { ptr4->int_2 = m; } } ptr13++; ptr14++; } if (flag2) { if (ptr4->int_1 > l) { ptr4->int_1 = l; } if (ptr4->int_3 < l) { ptr4->int_3 = l; } } if (this.cancellationToken_0.IsCancellationRequested) { return; } } for (int n = ptr4->int_1; n < ptr4->int_3; n++) { bool *ptr15 = ptr2 + ptr4->int_0 + (IntPtr)n * (IntPtr)this.class95_0.rectangle_0.Width; for (int num2 = ptr4->int_0; num2 < ptr4->int_2; num2++) { if (*ptr15) { Struct24 struct3 = this.class95_0.method_9(ptr15, num2, n); struct3.int_2++; struct3.int_3++; Rectangle rectangle = struct3.method_0(); Size size = rectangle.Size; Class335.smethod_3(Class95 <ColorType> .string_1, new object[] { rectangle }); if (size.Width > this.size_0.Width && size.Height > this.size_0.Height && size.Width < this.size_1.Width && size.Height < this.size_1.Height) { bool flag3 = true; for (int num3 = rectangle.Y; num3 < rectangle.Bottom; num3++) { int[] array9 = this.class95_0.int_1[num3]; if (array9.Length > 0) { foreach (int num5 in array9) { if (num5 >= rectangle.Left && num5 <= rectangle.Right) { flag3 = false; break; } } } else { flag3 = false; } if (!flag3) { break; } if (this.cancellationToken_0.IsCancellationRequested) { return; } } if (flag3) { Rectangle rectangle2 = rectangle.smethod_4(this.class95_0.rectangle_0.X, this.class95_0.rectangle_0.Y); Class335.smethod_3(Class95 <ColorType> .string_0, new object[] { rectangle2 }); this.list_0.Add(rectangle2); } } for (int num6 = struct3.int_1; num6 < struct3.int_3; num6++) { bool *ptr16 = ptr2 + struct3.int_0 + (IntPtr)num6 * (IntPtr)this.class95_0.rectangle_0.Width; for (int num7 = struct3.int_0; num7 < struct3.int_2; num7++) { *ptr16 = false; ptr16++; } } } ptr15++; } if (this.cancellationToken_0.IsCancellationRequested) { break; } } } catch (Exception ex) { this.exception_0 = ex; } }
// Token: 0x06001E8F RID: 7823 RVA: 0x000638A0 File Offset: 0x00061AA0 public unsafe bool method_10(Bitmap bmp, float minimum_percent) { int num = this.int_0 - (int)Math.Ceiling((double)(minimum_percent * (float)this.int_0)); Size size = bmp.Size; bool result; using (Class125 @class = new Class125(bmp)) { using (new Class125.Class153(@class)) { int num2 = 0; Array[][] array = new Array[this.array_0.Length][]; this.array_0.CopyTo(array, 0); int i = 0; int num3 = this.rectangle_0.Y; while (i < this.rectangle_0.Height) { Array[] array2 = array[i]; Array[] array3 = array2; int j = 0; while (j < array3.Length) { Array array4 = array3[j]; int k = array4.GetLowerBound(0) + this.rectangle_0.Left; int length = array4.GetLength(0); int num4 = k + length; Struct33 *ptr = @class.pBase + k + num3 * size.Width; if (this.bool_0) { Struct33[] array5 = new Struct33[length]; array4.CopyTo(array5, 0); try { Struct33[] array6; Struct33 * ptr2; if ((array6 = array5) != null && array6.Length != 0) { fixed(Struct33 *ptr2 = &array6[0]) { } } else { ptr2 = null; } Struct33 *ptr3 = ptr2; while (k < num4) { if (ptr->R != ptr3->R || ptr->G != ptr3->G || ptr->B != ptr3->B || ptr->A != ptr3->A) { num2++; } ptr3++; ptr++; k++; } goto IL_23F; } finally { Struct33 *ptr2 = null; } goto IL_193; } goto IL_193; IL_23F: j++; continue; IL_193: Struct54[] array7 = new Struct54[length]; array4.CopyTo(array7, 0); try { Struct54[] array8; Struct54 * ptr4; if ((array8 = array7) != null && array8.Length != 0) { fixed(Struct54 *ptr4 = &array8[0]) { } } else { ptr4 = null; } Struct54 *ptr5 = ptr4; while (k < num4) { if (ptr->R != ptr5->R || ptr->G != ptr5->G || ptr->B != ptr5->B) { num2++; } ptr5++; ptr++; k++; } goto IL_23F; } finally { Struct54 *ptr4 = null; } break; } if (num2 > num) { break; } i++; num3++; } result = (num2 <= num); } } return(result); }