예제 #1
0
 public virtual void setCapacity(int capacity)
 {
     unchecked
     {
         global::haxe.io.Bytes newData = global::haxe.io.Bytes.alloc(capacity);
         newData.blit(0, this._data, 0, this._data.length);
         this._data = newData;
     }
 }
예제 #2
0
 public virtual global::haxe.io.Bytes getBytes(global::haxe.lang.Null <int> offset)
 {
     unchecked
     {
         int __temp_offset68        = ((global::haxe.lang.Runtime.eq((offset).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (offset.@value));
         global::haxe.io.Bytes copy = global::haxe.io.Bytes.alloc(this.length);
         copy.blit(0, this._data, __temp_offset68, (this.length - __temp_offset68));
         return(copy);
     }
 }
예제 #3
0
파일: Reader.cs 프로젝트: Yanrishatum/UGif
        public virtual int deinterlace(global::haxe.io.Bytes input, global::haxe.io.Bytes output, int step, int y, int offset, int width, int height)
        {
            while ((y < height))
            {
                output.blit((y * width), input, offset, width);
                offset += width;
                y      += step;
            }

            return(offset);
        }
예제 #4
0
        public static global::ugiflib.UGifFile read(global::haxe.io.Bytes source)
        {
            unchecked {
                object data      = new global::format.gif.Reader(((global::haxe.io.Input)(new global::ugiflib.CSInput(((global::haxe.io.Bytes)(source)))))).read();
                int    fc        = global::format.gif.Tools.framesCount(data);
                int    width     = ((int)(global::haxe.lang.Runtime.getField_f(global::haxe.lang.Runtime.getField(data, "logicalScreenDescriptor", 2032764644, true), "width", 1247983110, true)));
                int    lineWidth = ((width * fc) * 4);
                int    height    = ((int)(global::haxe.lang.Runtime.getField_f(global::haxe.lang.Runtime.getField(data, "logicalScreenDescriptor", 2032764644, true), "height", 38537191, true)));
                global::haxe.io.Bytes    outBytes = global::haxe.io.Bytes.alloc((((fc * width) * height) * 4));
                global::ugiflib.UGifFile file     = new global::ugiflib.UGifFile(outBytes, width, height, fc);
                {
                    int _g1 = 0;
                    int _g  = fc;
                    while ((_g1 < _g))
                    {
                        int    i   = _g1++;
                        object gce = global::format.gif.Tools.graphicControl(data, i);
                        global::haxe.io.Bytes frameData = global::format.gif.Tools.extractFullRGBA(data, i);
                        {
                            int _g3 = 0;
                            int _g2 = height;
                            while ((_g3 < _g2))
                            {
                                int j = _g3++;
                                outBytes.blit(((lineWidth * (((height - j) - 1))) + ((width * i) * 4)), frameData, ((j * width) * 4), (width * 4));
                            }
                        }

                        if ((gce == null))
                        {
                            file.frames[i] = 1;
                        }
                        else
                        {
                            file.frames[i] = ((int)(global::haxe.lang.Runtime.getField_f(gce, "delay", 1462163331, true)));
                        }
                    }
                }

                return(file);
            }
        }