示例#1
0
        // Returns whether or not the image is fully opaque.
        private static bool opaque(image.Image m)
        {
            {
                opaquer (o, ok) = opaquer.As(m._<opaquer>())!;

                if (ok)
                {
                    return o.Opaque();
                }

            }

            var b = m.Bounds();
            for (var y = b.Min.Y; y < b.Max.Y; y++)
            {
                for (var x = b.Min.X; x < b.Max.X; x++)
                {
                    var (_, _, _, a) = m.At(x, y).RGBA();
                    if (a != 0xffffUL)
                    {
                        return false;
                    }

                }


            }

            return true;

        }
示例#2
0
 public decoder(io.Reader r = default, image.Image img = default, hash.Hash32 crc = default, long width = default, long height = default, long depth = default, color.Palette palette = default, long cb = default, long stage = default, uint idatLength = default, array <byte> tmp = default, long interlace = default, bool useTransparent = default, array <byte> transparent = default)
 {
     this.r              = r;
     this.img            = img;
     this.crc            = crc;
     this.width          = width;
     this.height         = height;
     this.depth          = depth;
     this.palette        = palette;
     this.cb             = cb;
     this.stage          = stage;
     this.idatLength     = idatLength;
     this.tmp            = tmp;
     this.interlace      = interlace;
     this.useTransparent = useTransparent;
     this.transparent    = transparent;
 }
示例#3
0
文件: draw.cs 项目: zjmit/go2cs
 // clip clips r against each image's bounds (after translating into the
 // destination image's coordinate space) and shifts the points sp and mp by
 // the same amount as the change in r.Min.
 private static void clip(Image dst, ptr<image.Rectangle> _addr_r, image.Image src, ptr<image.Point> _addr_sp, image.Image mask, ptr<image.Point> _addr_mp)
 {
     ref image.Rectangle r = ref _addr_r.val;
示例#4
0
文件: draw.cs 项目: zjmit/go2cs
        private static void Draw(this floydSteinberg _p0, Image dst, image.Rectangle r, image.Image src, image.Point sp)
        {
            clip(dst, _addr_r, src, _addr_sp, null, _addr_null);
            if (r.Empty())
            {
                return ;
            }

            drawPaletted(dst, r, src, sp, true);

        }
示例#5
0
文件: draw.cs 项目: zjmit/go2cs
 // Draw implements the Drawer interface by calling the Draw function with this
 // Op.
 public static void Draw(this Op op, Image dst, image.Rectangle r, image.Image src, image.Point sp)
 {
     DrawMask(dst, r, src, sp, null, new image.Point(), op);
 }
示例#6
0
 public encoder(ref ptr <Encoder> enc = default, io.Writer w = default, image.Image m = default, long cb = default, error err = default, array <byte> header = default, array <byte> footer = default, array <byte> tmp = default, array <slice <byte> > cr = default, slice <byte> pr = default, ref ptr <zlib.Writer> zw = default, long zwLevel = default, ref ptr <bufio.Writer> bw = default)
 {
     this.enc     = enc;
     this.w       = w;
     this.m       = m;
     this.cb      = cb;
     this.err     = err;
     this.header  = header;
     this.footer  = footer;
     this.tmp     = tmp;
     this.cr      = cr;
     this.pr      = pr;
     this.zw      = zw;
     this.zwLevel = zwLevel;
     this.bw      = bw;
 }