예제 #1
0
            // 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;
                }
            }
예제 #2
0
        // Token: 0x06001E8E RID: 7822 RVA: 0x0006360C File Offset: 0x0006180C
        private unsafe Struct24 method_9(bool *start_pixel, int x_start, int y_start)
        {
            Struct24 result = new Struct24(x_start, y_start, x_start, y_start);

            Class95 <ColorType> .Enum60 @enum = Class95 <ColorType> .Enum60.const_0;
            Class95 <ColorType> .Enum60 enum2 = Class95 <ColorType> .Enum60.const_0;
            int       num  = x_start;
            int       num2 = y_start;
            bool *    ptr  = start_pixel;
            Struct24 *ptr2 = &result;

            for (;;)
            {
IL_279:
                if (num2 > 0 && *(ptr - this.rectangle_0.Width))
                {
                    num2--;
                    ptr  -= this.rectangle_0.Width;
                    enum2 = Class95 <ColorType> .Enum60.const_3;
                    if (ptr2->int_1 > num2)
                    {
                        ptr2->int_1 = num2;
                    }
                }
                else if (num + 1 < this.rectangle_0.Width && ptr[1])
                {
                    num++;
                    ptr++;
                    if (ptr2->int_2 < num)
                    {
                        ptr2->int_2 = num;
                    }
                }
                else
                {
                    enum2 = Class95 <ColorType> .Enum60.const_2;
                }
                while (@enum != enum2 || start_pixel != ptr)
                {
                    switch (enum2)
                    {
                    case Class95 <ColorType> .Enum60.const_0:
                        goto IL_279;

                    case Class95 <ColorType> .Enum60.const_1:
                        if (num2 + 1 < this.rectangle_0.Height && ptr[this.rectangle_0.Width])
                        {
                            num2++;
                            ptr  += this.rectangle_0.Width;
                            enum2 = Class95 <ColorType> .Enum60.const_2;
                            if (ptr2->int_3 < num2)
                            {
                                ptr2->int_3 = num2;
                            }
                        }
                        else if (num > 0 && *(ptr - 1))
                        {
                            num--;
                            ptr--;
                            if (ptr2->int_0 > num)
                            {
                                ptr2->int_0 = num;
                            }
                        }
                        else
                        {
                            enum2 = Class95 <ColorType> .Enum60.const_3;
                        }
                        break;

                    case Class95 <ColorType> .Enum60.const_2:
                        if (num + 1 < this.rectangle_0.Width && ptr[1])
                        {
                            num++;
                            ptr++;
                            enum2 = Class95 <ColorType> .Enum60.const_0;
                            if (ptr2->int_2 < num)
                            {
                                ptr2->int_2 = num;
                            }
                        }
                        else if (num2 + 1 < this.rectangle_0.Height && ptr[this.rectangle_0.Width])
                        {
                            num2++;
                            ptr += this.rectangle_0.Width;
                            if (ptr2->int_3 < num2)
                            {
                                ptr2->int_3 = num2;
                            }
                        }
                        else
                        {
                            enum2 = Class95 <ColorType> .Enum60.const_1;
                        }
                        break;

                    case Class95 <ColorType> .Enum60.const_3:
                        if (num > 0 && *(ptr - 1))
                        {
                            num--;
                            ptr--;
                            enum2 = Class95 <ColorType> .Enum60.const_1;
                            if (ptr2->int_0 > num)
                            {
                                ptr2->int_0 = num;
                            }
                        }
                        else if (num2 > 0 && *(ptr - this.rectangle_0.Width))
                        {
                            num2--;
                            ptr -= this.rectangle_0.Width;
                            if (ptr2->int_1 > num2)
                            {
                                ptr2->int_1 = num2;
                            }
                        }
                        else
                        {
                            enum2 = Class95 <ColorType> .Enum60.const_0;
                        }
                        break;
                    }
                }
                break;
            }
            return(result);
        }