Exemplo n.º 1
0
        // Token: 0x06001E8D RID: 7821 RVA: 0x0006354C File Offset: 0x0006174C
        public Rectangle[] method_8(Bitmap bmp, Size minimum_size, Size maximum_size, CancellationToken token)
        {
            Class95 <ColorType> .Class297 @class = new Class95 <ColorType> .Class297();

            @class.bitmap_0            = bmp;
            @class.size_0              = minimum_size;
            @class.size_1              = maximum_size;
            @class.cancellationToken_0 = token;
            @class.class95_0           = this;
            @class.cancellationToken_0.ThrowIfCancellationRequested();
            @class.list_0 = new List <Rectangle>();
            int maxStackSize = 1048576 + this.rectangle_0.Height * this.rectangle_0.Width * 2;

            @class.exception_0 = null;
            Thread thread = new Thread(new ThreadStart(@class.method_0), maxStackSize);

            thread.IsBackground = true;
            thread.Start();
            thread.Join();
            if (@class.exception_0 != null)
            {
                throw @class.exception_0;
            }
            @class.cancellationToken_0.ThrowIfCancellationRequested();
            return(@class.list_0.ToArray());
        }
Exemplo n.º 2
0
        // Token: 0x06001E88 RID: 7816 RVA: 0x000631E0 File Offset: 0x000613E0
        private void method_6(Class125 alpha_bitmap, Class125 color_bitmap = null)
        {
            Struct33[,] colors     = alpha_bitmap.Colors;
            Struct33[,] color_data = (color_bitmap == null) ? colors : color_bitmap.Colors;
            this.int_0             = 0;
            short left;
            short num;
            short num2;
            short num3;

            if (Class95 <ColorType> .smethod_2(colors, this.size_0, FlowDirection.LeftToRight, out left) && Class95 <ColorType> .smethod_2(colors, this.size_0, FlowDirection.TopDown, out num) && Class95 <ColorType> .smethod_2(colors, this.size_0, FlowDirection.RightToLeft, out num2) && Class95 <ColorType> .smethod_2(colors, this.size_0, FlowDirection.BottomUp, out num3))
            {
                this.rectangle_0 = Rectangle.FromLTRB((int)left, (int)num, (int)(num2 + 1), (int)(num3 + 1));
                this.array_0     = Array.CreateInstance(typeof(Array[]), new int[]
                {
                    this.rectangle_0.Height
                }, new int[]
                {
                    this.rectangle_0.Top
                });
                short num4 = num;
                while ((int)num4 < this.rectangle_0.Bottom)
                {
                    this.array_0.SetValue(this.method_7(colors, color_data, left, num2, num4), (int)num4);
                    num4 += 1;
                }
                return;
            }
            this.array_0 = null;
        }
Exemplo n.º 3
0
        // 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());
        }
Exemplo n.º 4
0
        // Token: 0x06001E84 RID: 7812 RVA: 0x00062BC0 File Offset: 0x00060DC0
        private void method_4()
        {
            Class95 <ColorType> .Class296 @class = new Class95 <ColorType> .Class296();

            @class.class95_0 = this;
            this.int_1       = new int[this.rectangle_0.Height][];
            int maxStackSize = 1048576 + this.rectangle_0.Height * this.rectangle_0.Width;

            @class.exception_0 = null;
            Thread thread = new Thread(new ThreadStart(@class.method_0), maxStackSize);

            thread.IsBackground = true;
            thread.Start();
            thread.Join();
            if (@class.exception_0 != null)
            {
                throw @class.exception_0;
            }
        }
Exemplo n.º 5
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);
        }