Exemple #1
0
        //throws gnu.x11.extension.NotFoundException {
        public Blend(String [] args)
            : base(args, 255, 255)
        {
            about ("0.1", "test blending in RENDER",
              "Stephen Tse <*****@*****.**>",
              "http://escher.sourceforge.net/");

            if (help_option) return;

            render = new Render (display);
            Picture.Format pf0 = new Picture.Format (), pf1;
            Picture.Format.Direct df = pf0.direct_format ();

            alpha_pixmap = new Pixmap (window, window.width, window.height, 8);
            color_pixmap = new Pixmap (window, 1, 1, 24);
            alpha_gc = new GC (alpha_pixmap);
            color_gc = new GC (color_pixmap);

            // window picture (TODO: find visual)
            pf0.clear ();
            pf0.set_depth (display.default_screen.root_depth ());
            pf1 = render.picture_format (pf0, true);

            window_picture = render.create_picture (window, pf1,
              Picture.Attributes.EMPTY);

            // alpha picture
            pf0.clear ();
            pf0.set_depth (8);
            pf0.set_type (Picture.Format.Direct.TYPE);
            df.set_alpha (0);
            df.set_alpha_mask (0xff);
            pf1 = render.picture_format (pf0, true);

            alpha_picture = render.create_picture (alpha_pixmap, pf1,
              Picture.Attributes.EMPTY);

            // color picture
            pf0.clear ();
            pf0.set_depth (24);
            pf0.set_type (Picture.Format.Direct.TYPE);
            df.set_alpha (0);
            df.set_alpha_mask (0);
            df.set_red (16);
            df.set_red_mask (0xff);
            df.set_green (8);
            df.set_green_mask (0xff);
            df.set_blue (0);
            df.set_blue_mask (0xff);
            pf1 = render.picture_format (pf0, true);

            Picture.Attributes attr = new Picture.Attributes ();
            attr.set_repeat (true);
            color_picture = render.create_picture (color_pixmap, pf1, attr);
        }
Exemple #2
0
 /**
  * @see Picture#Picture(Render, Drawable, Picture.Format, Picture.Attributes)
  */
 public Picture create_picture(Drawable drawable, Picture.Format format,
                               Picture.Attributes attr)
 {
     return(new Picture(this, drawable, format, attr));
 }