// render opcode 17 - create glyph set /** * @see <a href="XRenderCreateGlyphSet.html">XRenderCreateGlyphSet</a> */ public GlyphSet(Render render, Picture.Format format) : base(render.display) { this.render = render; Request request = new Request (display, render.major_opcode, 17, 3); request.write4 (id); request.write4 (format.id ()); display.send_request (request); }
//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); }
/** * @param p possible: * {@link Picture#NONE} (default) */ public void set_alpha_map(Picture p) { set (1, p.id); }
// render opcode 8 - scale public void scale(int color_scale, int alpha_scale, Picture src, int src_x, int src_y, int dst_x, int dst_y, int width, int height) { Request request = new Request (display, render.major_opcode, 9, 8); request.write4 (src.id); request.write4 (id); request.write4 (color_scale); request.write4 (alpha_scale); request.write2 (src_x); request.write2 (src_y); request.write2 (dst_x); request.write2 (dst_y); request.write2 (width); request.write2 (height); display.send_request (request); }
/** * @see <a href="XRenderFindFormat.html">XRenderFindFormat</a> */ public Picture.Format picture_format(Picture.Format template, bool must) { Picture.Format [] pfs = picture_formats (); for (int i=0; i<pfs.Length; i++) if (pfs [i].match (template)) return pfs [i]; if (!must) return null; throw new Error ("No matching: " + template); }
/** * @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); }
// render opcode 8 - composite /** * @param operation * {@link #CLEAR} * {@link #SRC} * {@link #DST} * {@link #OVER} * {@link #OVER_REVERSE} * {@link #IN} * {@link #IN_REVERSE} * {@link #OUT} * {@link #OUT_REVERSE} * {@link #ATOP} * {@link #ATOP_REVERSE} * {@link #XOR} * {@link #ADD} * {@link #SATURATE} * {@link #MAXIMUM} * * @see <a href="XRenderComposite.html">XRenderComposite</a> */ public void composite(int op, Picture src, Picture mask, Picture dst, int src_x, int src_y, int mask_x, int mask_y, int dst_x, int dst_y, int width, int height) { Request request = new Request (display, major_opcode, 8, 9); request.write1 (op); request.write3_unused (); request.write4 (src.id); request.write4 (mask.id); request.write4 (dst.id); request.write2 (src_x); request.write2 (src_y); request.write2 (mask_x); request.write2 (mask_y); request.write2 (dst_x); request.write2 (dst_y); request.write2 (width); request.write2 (height); display.send_request (request); }