Exemplo n.º 1
0
        public void Ycc2RgbTest002()
        {
            int   width  = 32;
            int   height = 32;
            sbyte color  = -1;

            var map = BitmapTests.CreateIntiFillVerifyBitmap(width, height, 0, color);
            var pix = map.CreateGPixelReference(0);

            Assert.Throws <DjvuInvalidOperationException>(() => pix.Ycc2Rgb(width * height));
        }
Exemplo n.º 2
0
        public void StencilTest001()
        {
            int       width  = 128;
            int       height = 128;
            Pixel     color  = Pixel.WhitePixel;
            Rectangle rect   = new Rectangle {
                Left = -10, Bottom = -10, Right = 200, Top = 200
            };

            IBitmap   bmp  = BitmapTests.CreateIntiFillVerifyBitmap(width, height, 0, -1);
            IPixelMap map  = CreateInitVerifyPixelMap(width, height, color);
            IPixelMap map2 = CreateInitVerifyPixelMap(width, height, Pixel.BlackPixel);

            Assert.Throws <DjvuArgumentOutOfRangeException>("bounds", () => map.Stencil(bmp, map2, 1, 1, rect, 2.2));
        }
Exemplo n.º 3
0
        public void StencilTest003()
        {
            int       width  = 128;
            int       height = 128;
            Pixel     color  = new Pixel(107, 125, 93);
            Pixel     color2 = new Pixel(-77, -77, -77);
            Rectangle rect   = new Rectangle {
                Left = 100, Bottom = 0, Right = 0, Top = 100
            };

            IBitmap bmp = BitmapTests.CreateIntiFillVerifyBitmap(width / 2, height / 2, 0, 127);

            bmp.Grays = 256;
            IPixelMap map  = CreateInitVerifyPixelMap(width, height, color);
            IPixelMap map2 = CreateInitVerifyPixelMap(width, height, color2);

            map.Stencil(bmp, map2, 1, 1, rect, 2.2);
        }