// Token: 0x060016B1 RID: 5809 RVA: 0x00036B40 File Offset: 0x00034D40 public unsafe void method_6(Rectangle bounds, out Class125 result) { if (bounds.Width > 0 && bounds.Height > 0) { if (this.Width >= bounds.Right && this.Height >= bounds.Bottom) { result = new Class125(new Size(bounds.Width, bounds.Height)); using (new Class125.Class153(this)) { using (new Class125.Class153(result)) { Struct33 *ptr = result.pStruct33_0; for (int i = bounds.Top; i < bounds.Bottom; i++) { Struct33 *ptr2 = this.pStruct33_0 + i * this.rectangle_0.Width + bounds.Left; for (int j = 0; j < bounds.Width; j++) { *ptr = *ptr2; ptr++; ptr2++; } } } return; } } throw new ArgumentOutOfRangeException("bounds", "width or height too large"); } throw new ArgumentOutOfRangeException("bounds", "width or height too small"); }
// Token: 0x06002B5B RID: 11099 RVA: 0x000A8DA4 File Offset: 0x000A6FA4 private unsafe static void smethod_3(Bitmap bmp, Struct33[,] data) { using (Class125 @class = new Class125(bmp)) { using (new Class125.Class153(@class)) { try { Struct33 *ptr; if (data != null && data.Length != 0) { fixed(Struct33 *ptr = &data[0, 0]) { } } else { ptr = null; } Struct33 *ptr2 = ptr; Struct33 *ptr3 = @class.pBase; for (int i = 0; i < bmp.Width * bmp.Height; i++) { *ptr3 = *ptr2; ptr3++; ptr2++; } } finally { Struct33 *ptr = null; } } } }
// Token: 0x06002D1B RID: 11547 RVA: 0x000ADAC0 File Offset: 0x000ABCC0 public unsafe Class150(Struct54[] pixels, Size sz) : this() { if (pixels == null) { throw new ArgumentNullException("pixels"); } this.size_0 = sz; this.class125_0 = new Class125(sz); this.class125_0.method_4(); Struct33 *ptr = this.class125_0.pBase; Struct54 *ptr2; if (pixels != null && pixels.Length != 0) { fixed(Struct54 *ptr2 = &pixels[0]) { } } else { ptr2 = null; } Struct54 *ptr3 = ptr2; for (int i = 0; i < sz.Width * sz.Height; i++) { *ptr = Struct33.smethod_2(*ptr3); ptr++; ptr3++; } ptr2 = null; }
// Token: 0x06002D1E RID: 11550 RVA: 0x000AE098 File Offset: 0x000AC298 public unsafe static int smethod_2(Class150 left, Class150 right, int x_pixel_offset, int y_pixel_offset) { int result; lock (right.object_0) { lock (left.object_0) { uint num = 0U; Size size = left.size_0; Struct33 *pBase = left.class125_0.pBase; Struct33 *pBase2 = right.class125_0.pBase; int num2; int num3; if (x_pixel_offset > 0) { num2 = x_pixel_offset; num3 = 0; } else { x_pixel_offset = Math.Abs(x_pixel_offset); num3 = x_pixel_offset; num2 = 0; } int num4; int num5; if (y_pixel_offset > 0) { num4 = y_pixel_offset; num5 = 0; } else { y_pixel_offset = Math.Abs(y_pixel_offset); num5 = y_pixel_offset; num4 = 0; } int i = y_pixel_offset; while (i < size.Height) { Struct33 *ptr = pBase + num4 * size.Width + num2; Struct33 *ptr2 = pBase2 + num5 * size.Width + num3; for (int j = x_pixel_offset; j < size.Width; j++) { num = num + Class477.smethod_8((int)ptr->R, (int)ptr2->R) + Class477.smethod_8((int)ptr->G, (int)ptr2->G) + Class477.smethod_8((int)ptr->B, (int)ptr2->B); ptr++; ptr2++; } i++; num4++; num5++; } result = (int)(num / ((size.Width - x_pixel_offset) * (size.Height - y_pixel_offset) * 3m)); } } return(result); }
// Token: 0x060016B2 RID: 5810 RVA: 0x00036C90 File Offset: 0x00034E90 public unsafe static void smethod_1(Bitmap original) { using (Class125 @class = new Class125(original)) { using (new Class125.Class153(@class)) { Struct33 *ptr = @class.pStruct33_0; int num = original.Height * original.Width; for (int i = 0; i < num; i++) { byte b = (byte)((double)ptr->R * 0.3 + (double)ptr->G * 0.59 + (double)ptr->B * 0.11); * ptr = new Struct33(b, b, b, ptr->A); ptr++; } } } }
// Token: 0x060017A1 RID: 6049 RVA: 0x0003DFE0 File Offset: 0x0003C1E0 protected unsafe bool method_21(ManualResetEventSlim waitHandle = null) { int num = 0; do { Size size = new Size(20, 20); using (Bitmap bitmap = Class364.smethod_3(this.intptr_0, new Rectangle(Point.Empty, size))) { using (Class125 @class = new Class125(bitmap, false)) { using (new Class125.Class153(@class)) { Struct33 *ptr = @class.pBase; Struct33 right = new Struct33(0, 0, 0, byte.MaxValue); for (int i = 0; i < base.Size.Height; i++) { for (int j = 0; j < base.Size.Width; j++) { if (Struct33.smethod_4(*ptr, right)) { return(true); } ptr++; } } } } } if (waitHandle != null) { waitHandle.Wait(100); } else { Thread.Sleep(100); } num++; }while (num < 100 && (waitHandle == null || !waitHandle.IsSet)); return(false); }
// Token: 0x06002B5D RID: 11101 RVA: 0x000A8F14 File Offset: 0x000A7114 private unsafe static void smethod_5(Bitmap original, Color[,] data) { int width = original.Width; int height = original.Height; using (Class125 @class = new Class125(original)) { using (new Class125.Class153(@class)) { Struct33 *ptr = @class.pBase; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { data[j, i] = Struct33.smethod_0(*ptr); ptr++; } } } } }
// Token: 0x060016B3 RID: 5811 RVA: 0x00036D5C File Offset: 0x00034F5C public unsafe static Class125 smethod_2(Bitmap[] bitmaps) { if (bitmaps == null) { throw new ArgumentNullException("bitmaps"); } if (bitmaps.Length != 0 && bitmaps.Length <= 255) { Size size = bitmaps[0].Size; for (int i = 1; i < bitmaps.Length; i++) { if (bitmaps[i].Size != size) { IL_28C: throw new ArgumentException("To mode bitmaps, all must have same size."); } } Class125 @class = null; try { @class = new Class125(size); using (Class125.Class155 class2 = new Class125.Class155(bitmaps)) { using (new Class125.Class154(class2)) { using (new Class125.Class153(@class)) { int num = bitmaps.Length; int num2 = Class227.smethod_0(num); byte b = 0; Struct33 * ptr = @class.pStruct33_0; Struct33 ** ptr2; Struct33 ** ptr3; int * ptr4; int * ptr5; Class125.Struct18 *ptr6; int num3; checked { ptr2 = stackalloc Struct33 *[unchecked ((UIntPtr)num) * (UIntPtr)sizeof(Struct33 *)];
// Token: 0x06002D1C RID: 11548 RVA: 0x000ADB68 File Offset: 0x000ABD68 public unsafe static bool smethod_0(Class150 source, Struct46 sourceRatio, Class150 value, Struct46 valueRatio, int max_diff, out Point location) { int num = (int)((double)source.size_0.Width / sourceRatio.double_2); int num2 = (int)((double)source.size_0.Height / sourceRatio.double_3); int num3 = (int)((double)value.size_0.Width / valueRatio.double_2); int num4 = (int)((double)value.size_0.Height / valueRatio.double_3); int num5; if (num > num3) { num5 = num3; } else { num5 = num; } int num6; if (num2 > num4) { num6 = num4; } else { num6 = num2; } Size sz = new Size((int)Math.Round(sourceRatio.double_2 * (double)num5), (int)Math.Round(sourceRatio.double_3 * (double)num6)); Size sz2 = new Size((int)Math.Round(valueRatio.double_2 * (double)num5), (int)Math.Round(valueRatio.double_3 * (double)num6)); if (sz2.Width <= sz.Width && sz2.Height <= sz.Height) { Class150 @class = source.method_5(sz); Class150 class2 = value.method_5(sz2); lock (@class.object_0) { lock (class2.object_0) { Struct33 *pBase = @class.class125_0.pBase; Struct33 *pBase2 = class2.class125_0.pBase; decimal d = sz2.Width * sz2.Height * 3m; for (int i = 0; i < sz.Height - sz2.Height; i++) { for (int j = 0; j < sz.Width - sz2.Width; j++) { Struct33 *ptr = pBase2; uint num7 = 0U; int num8 = j + sz2.Width; for (int k = i; k < i + sz2.Height; k++) { Struct33 *ptr2 = pBase + k * sz.Width + j; for (int l = j; l < num8; l++) { num7 = num7 + Class477.smethod_8((int)ptr2->R, (int)ptr->R) + Class477.smethod_8((int)ptr2->G, (int)ptr->G) + Class477.smethod_8((int)ptr2->B, (int)ptr->B); ptr2++; ptr++; } if (num7 / d > max_diff) { break; } } if (num7 / d < max_diff) { location = new Point((int)Math.Round((double)j / (double)sz.Width * (double)source.size_0.Width), (int)Math.Round((double)i / (double)sz.Height * (double)source.size_0.Height)); return(true); } } } } } location = Point.Empty; return(false); } location = Point.Empty; return(false); }
// 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); }
// Token: 0x06001E87 RID: 7815 RVA: 0x00062FB8 File Offset: 0x000611B8 public unsafe Bitmap method_5(Color?replaceColor = null) { Bitmap bitmap = null; Bitmap result; try { bitmap = new Bitmap(this.size_0.Width, this.size_0.Height); if (this.array_0 != null) { using (Class125 @class = new Class125(bitmap)) { using (new Class125.Class153(@class)) { for (int i = this.rectangle_0.Top; i < this.rectangle_0.Bottom; i++) { Array[] array = (Array[])this.array_0.GetValue(i); short num = 0; while ((int)num < array.Length) { Array array2 = (Array)array.GetValue((int)num); int lowerBound = array2.GetLowerBound(0); int num2 = lowerBound + array2.Length - 1; Struct33 *ptr = @class.pBase + i * this.size_0.Width + lowerBound + this.rectangle_0.Left; if (replaceColor != null) { Struct33 @struct = Struct33.smethod_1(replaceColor.Value); for (int j = lowerBound; j <= num2; j++) { *ptr = @struct; ptr++; } } else if (this.bool_0) { for (int k = lowerBound; k <= num2; k++) { *ptr = (Struct33)array2.GetValue(k); ptr++; } } else { for (int l = lowerBound; l <= num2; l++) { *ptr = Struct33.smethod_2((Struct54)array2.GetValue(l)); ptr++; } } num += 1; } } } } } result = bitmap; } catch { if (bitmap != null) { bitmap.Dispose(); } throw; } return(result); }