| 1 | module vx11 |
| 2 | |
| 3 | // Xutil exposes these as macros invoking XImage's function table. |
| 4 | fn C.XDestroyImage(&XImage) i32 |
| 5 | fn C.XGetPixel(&XImage, i32, i32) CULong |
| 6 | fn C.XPutPixel(&XImage, i32, i32, CULong) i32 |
| 7 | fn C.XSubImage(&XImage, i32, i32, u32, u32) &XImage |
| 8 | fn C.XAddPixel(&XImage, CLong) i32 |
| 9 | |
| 10 | pub fn destroy_image(image &XImage) i32 { return C.XDestroyImage(image) } |
| 11 | |
| 12 | pub fn get_pixel(image &XImage, x i32, y i32) CULong { return C.XGetPixel(image, x, y) } |
| 13 | |
| 14 | pub fn put_pixel(image &XImage, x i32, y i32, pixel CULong) i32 { |
| 15 | return C.XPutPixel(image, x, y, pixel) |
| 16 | } |
| 17 | |
| 18 | pub fn sub_image(image &XImage, x i32, y i32, width u32, height u32) &XImage { |
| 19 | return C.XSubImage(image, x, y, width, height) |
| 20 | } |
| 21 | |
| 22 | pub fn add_pixel(image &XImage, value CLong) i32 { return C.XAddPixel(image, value) } |
| 23 | |
| 24 | // XUniqueContext is an Xutil macro backed by the resource quark allocator. |
| 25 | pub fn unique_context() XContext { return XContext(xrm_unique_quark()) } |
| 26 | |