14 void main(int argc
, char **argv
)
16 RContextAttributes attr
;
18 dpy
= XOpenDisplay("");
20 puts("cant open display");
24 attr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
;
25 attr
.render_mode
= RM_DITHER
;
26 attr
.colors_per_channel
= 4;
27 ctx
= RCreateContext(dpy
, DefaultScreen(dpy
), &attr
);
30 img
= RGetImageFromXPMData(ctx
, image_name
);
32 img
= RLoadImage(ctx
, argv
[1], argc
>2 ? atol(argv
[2]) : 0);
38 if (!RConvertImage(ctx
, img
, &pix
)) {
43 win
= XCreateSimpleWindow(dpy
, DefaultRootWindow(dpy
), 10, 10, img
->width
,
44 img
->height
, 0, 0, 0);
45 XSelectInput(dpy
, win
, ExposureMask
);
48 XCopyArea(dpy
, pix
, win
, ctx
->copy_gc
, 0, 0, img
->width
, img
->height
,
56 XCopyArea(dpy
, pix
, win
, ctx
->copy_gc
, 0, 0, img
->width
, img
->height
,