예제 #1
0
 protected static void __hx_ctor_ugiflib_UGifFile(global::ugiflib.UGifFile __hx_this, global::haxe.io.Bytes data, int w, int h, int fc)
 {
     __hx_this.width   = w;
     __hx_this.height  = h;
     __hx_this.picture = data;
     __hx_this.frames  = new int[fc];
 }
예제 #2
0
파일: Test.cs 프로젝트: Yanrishatum/UGif
 public static void main()
 {
     unchecked {
         global::haxe.io.Bytes    io   = global::sys.io.File.getBytes("jump_fall.gif");
         global::ugiflib.UGifFile file = global::ugiflib.UGifLib.read(io);
         global::haxe.Log.trace.__hx_invoke2_o(((double)(file.width)), global::haxe.lang.Runtime.undefined, default(double), new global::haxe.lang.DynamicObject(new int[] { 302979532, 1547539107, 1648581351, 1830310359 }, new object[] { "main", "ugiflib.Test", "Test.hx", new global::haxe.root.Array <object>(new object[] { file.height, file.frames }) }, new int[] { 1981972957 }, new double[] { ((double)(9)) }));
         global::sys.io.FileOutput @out = global::sys.io.File.write("jump_fall.edit.gif", default(global::haxe.lang.Null <bool>));
         new global::format.png.Writer(((global::haxe.io.Output)(@out))).write(global::format.png.Tools.build32BGRA((file.width * (file.frames as global::System.Array).Length), file.height, file.picture, default(global::haxe.lang.Null <int>)));
         @out.close();
     }
 }
예제 #3
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);
            }
        }