Monday 15 July 2013

xlib - Does XGetImage ever return a 32-bit depth XImage? -



xlib - Does XGetImage ever return a 32-bit depth XImage? -

i using xgetimage read pixels of opengl window. ximage returned shows depth of 24-bits, opengl context has alpha values returned. there way 32-bit ximage xgetimage, or x flatten image 24-bits?

function call:

::ximage *winimage = xgetimage(dpy_i->dpy, wnd_i->wnd, x, y, width, height, 0xffffffff, zpixmap);

gdb output:

(gdb) print *winimage $2 = {width = 640, height = 512, xoffset = 0, format = 2, info = 0x7fffe72fd010 "\377\377\377", byte_order = 0, bitmap_unit = 32, bitmap_bit_order = 0, bitmap_pad = 32, depth = 24, bytes_per_line = 2560, bits_per_pixel = 32, red_mask = 16711680, green_mask = 65280, blue_mask = 255, obdata = 0x0, f = {create_image = 0x7ffff4b67810 <xcreateimage>, destroy_image = 0x7ffff4b665b0, get_pixel = 0x7ffff4b67520, put_pixel = 0x7ffff4b67450, sub_image = 0x7ffff4b67170, add_pixel = 0x7ffff4b66650}}

i seem 32bit image. code, js-ctypes, take screenshot of monitors.

https://github.com/noitidart/_scratchpad/blob/c41012b16842f0769595033bd51a3801451319be/x11%20new%20way%20skel%20non%20jsm.js

this ximage struct after xgetimage:

"width:" "1280" "height:" "919" "xoffset:" "0" "format:" "2" "data:" "ctypes.char.ptr(ctypes.uint64("0x7f850fe00000"))" "byte_order:" "0" "bitmap_unit:" "32" "bitmap_bit_order:" "0" "bitmap_pad:" "32" "depth:" "24" "bytes_per_line:" "5120" "bits_per_pixel:" "32" "red_mask:" "16711680" "green_mask:" "65280" "blue_mask:" "255" "_end_"

xlib

No comments:

Post a Comment