Navigation

    GitHub中文社区
    • GitHub排行榜

    论坛

    • Login
    • Categories
    • Recent
    • Tags
    • Popular

    关于turbojpeg.h中的解压函数tjDecompress2报错

    技术交流
    2
    5
    332
    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.
    • xiaowen0407
      xiaowen0407 last edited by

      用kinect sdk录制视频视频时候保存格式位jpeg 所以要解压成bgra格式但是在做图片解压时候报错 instance has not been initialized for decompression 不知道这个是什么意思
      下面是网上找的解压函数 但是不对报错就报上面那个
      bool MJPG2BGRA(const k4a::image&mjpgimage, k4a::image&bgraimage)

      {

      bgraimage = k4a::image::create(K4A_IMAGE_FORMAT_COLOR_BGRA32,

                             mjpgimage.get_width_pixels(),
      
                             mjpgimage.get_height_pixels(),
      
                             mjpgimage.get_width_pixels() * 4 * (int)sizeof(uint8_t));
      
                tjhandle m_decompressor = tjInitCompress();
      
                if (tjDecompress2(m_decompressor,
      
                             mjpgimage.get_buffer(),//输入图片的数据数组取出
      
                             static_cast<unsigned long>(mjpgimage.get_size()),
      
                             bgraimage.get_buffer(),//输入图片的数据存储在转换的图片上
      
                             mjpgimage.get_width_pixels(),
      
                             0,
      
                             mjpgimage.get_height_pixels(),
      
                             TJPF_BGRA,
      
                             TJFLAG_FASTDCT | TJFLAG_FASTUPSAMPLE)!=0)
      
                {
      
                             printf("解压失败");
      
                }
      
                (void)tjDestroy(m_decompressor);
      

      return ture;

      }

      xiaowen0407 2 Replies Last reply Reply Quote 0
      • xiaowen0407
        xiaowen0407 @xiaowen0407 last edited by

        求助啊啊啊啊啊 啊 啊

        1 Reply Last reply Reply Quote 0
        • k1995
          k1995 last edited by

          C++啊,爱莫能助啊

          xiaowen0407 1 Reply Last reply Reply Quote 0
          • xiaowen0407
            xiaowen0407 @k1995 last edited by

            @k1995 5555 好的 谢谢哈

            1 Reply Last reply Reply Quote 0
            • xiaowen0407
              xiaowen0407 @xiaowen0407 last edited by

              ddddingdingding

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