首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gdk_pixbuf_add_alpha的X11等效项

gdk_pixbuf_add_alpha的X11等效项
EN

Stack Overflow用户
提问于 2015-07-18 01:41:14
回答 1查看 93关注 0票数 0

在x11中,我通过使用XGetImage获得了二进制blob。

在GDK中,我们有这个函数可以将255的alpha加到Pixbuf中:https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-Utilities.html#gdk-pixbuf-add-alpha

我想知道在X11中是否有像这样方便的函数。

所以我有一个这样的结构:

代码语言:javascript
复制
typedef struct _XImage {
    int width, height;      /* size of image */
    int xoffset;            /* number of pixels offset in X direction */
    int format;         /* XYBitmap, XYPixmap, ZPixmap */
    char *data;         /* pointer to image data */
    int byte_order;         /* data byte order, LSBFirst, MSBFirst */
    int bitmap_unit;        /* quant. of scanline 8, 16, 32 */
    int bitmap_bit_order;       /* LSBFirst, MSBFirst */
    int bitmap_pad;         /* 8, 16, 32 either XY or ZPixmap */
    int depth;          /* depth of image */
    int bytes_per_line;     /* accelerator to next scanline */
    int bits_per_pixel;     /* bits per pixel (ZPixmap) */
    unsigned long red_mask;     /* bits in z arrangement */
    unsigned long green_mask;
    unsigned long blue_mask;
    XPointer obdata;        /* hook for the object routines to hang on */
    struct funcs {          /* image manipulation routines */
        struct _XImage *(*create_image)();
        int (*destroy_image)();
        unsigned long (*get_pixel)();
        int (*put_pixel)();
        struct _XImage *(*sub_image)();
        int (*add_pixel)();
    } f;
} XImage;

ximage.data字段中,我有RGB二进制数据。我正在帮助一个朋友,我需要创建RGBA二进制数据。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2016-01-12 20:08:28

不幸的是,没有像GDK中那样的抽象。

您必须通过迭代*char数据成员来手动完成此操作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31481664

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档