Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    救命啊,谁能帮帮我D1-H 的G2D Alpha混合不起作用????

    MR Series
    1
    1
    992
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      zxdplay LV 4 last edited by

      尝试了很多次,不管使用 G2D_CMD_BITBLT_H 还是 G2D_CMD_BLD_H
      像素格式src和dst页面都使用相同格式 G2D_FORMAT_ARGB8888
      不管怎么设置, G2D_PIXEL_ALPHA都不起作用,也就是说像素的ALPHA通道没排上用场
      甚至画一个空页面到目标页面,整个源页面像素值都为0,,都能得到一个黑框,正常情况下因为alpha为0,根本就画不出来,
      给我的感觉就是,d1-h的像素alpha用不了,没有这个功能??!!!
      还有G2D_CMD_BLD_H的关键色也不起作用??!!!
      谁能帮帮我,到底是哪里的问题??

      layerbuf src_buf,src_buf2;
      make_a_argb_buf(&src_buf, 512,512,512,512,0);
      make_a_argb_buf(&src_buf2, 512,512,512,512,0);
      
      g2d_blt_h blh;
      memset(&blh, 0, sizeof(blh));
      
      blh.flag_h = G2D_BLT_NONE_H;
      //blh.flag_h = G2D_BLT_MERGEPEN;
      
      blh.src_image_h.format = G2D_FORMAT_ARGB8888;
      blh.src_image_h.width = src_buf.width;
      blh.src_image_h.height = src_buf.height;
      blh.src_image_h.align[0] = 0;
      blh.src_image_h.align[1] = 0;
      blh.src_image_h.align[2] = 0;
      blh.src_image_h.clip_rect.x = 0;
      blh.src_image_h.clip_rect.y = 0;
      blh.src_image_h.clip_rect.w = src_buf.width;
      blh.src_image_h.clip_rect.h = src_buf.height;
      blh.src_image_h.mode = G2D_PIXEL_ALPHA;
      //blh.src_image_h.use_phy_addr = 1;
      //blh.src_image_h.haddr[0] = src_buf.phy_addr>>32;
      //blh.src_image_h.laddr[0] = src_buf.phy_addr;
      blh.src_image_h.fd = src_buf.fd;
      //blh.src_image_h.alpha = 0xFF;
      
      blh.dst_image_h.format = G2D_FORMAT_ARGB8888;
      blh.dst_image_h.width = src_buf2.width;
      blh.dst_image_h.height = src_buf2.height;
      blh.dst_image_h.align[0] = 0;
      blh.dst_image_h.clip_rect.x = 0;
      blh.dst_image_h.clip_rect.y = 0;
      blh.dst_image_h.clip_rect.w = src_buf2.width;
      blh.dst_image_h.clip_rect.h = src_buf2.height;
      blh.dst_image_h.mode = G2D_PIXEL_ALPHA;// G2D_PIXEL_ALPHA G2D_GLOBAL_ALPHA
      //blh.dst_image_h.use_phy_addr = 1;
      //blh.dst_image_h.haddr[0] = src_buf2.phy_addr>>32;
      //blh.dst_image_h.laddr[0] = src_buf2.phy_addr;
      blh.dst_image_h.fd = src_buf2.fd;
      //blh.dst_image_h.alpha = 0xFF;
      

      //ret = ioctl(g2d_fd, G2D_CMD_BITBLT_H, &blh);
      //if(ret){
      // printf("ioctl G2D_CMD_BITBLT_H fail ret = %d\n",ret);
      // }

      g2d_bld blend;
      memset(&blend, 0,sizeof(blend));
      blend.bld_cmd = G2D_BLD_SRCOVER;
      blend.ck_para.match_rule = 0;
      blend.ck_para.max_color = 5; //关键色就算把范围设置为0-0xFFFFFFFF 都不起作用
      blend.ck_para.min_color = 0;
      memcpy(&blend.src_image[0],&blh.src_image_h,sizeof(g2d_image_enh));
      memcpy(&blend.src_image[1],&blh.src_image_h,sizeof(g2d_image_enh));
      memcpy(&blend.dst_image,&blh.dst_image_h,sizeof(g2d_image_enh));
      ret = ioctl(g2d_fd, G2D_CMD_BLD_H, &blend);
      if(ret)
      {
      	printf("ioctl G2D_CMD_BLD_H fail ret = %d\n",ret);
      }
      

      微信图片_20241004151249.jpg

      1 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策