跳转至内容
  • 社区首页
  • 版块
  • 最新
  • 标签
  • 热门
折叠

GitHub中文论坛

  1. 主页
  2. 版块
  3. 技术交流
  4. 使用 turbojpeg 报错 请问是什么原因

使用 turbojpeg 报错 请问是什么原因

已定时 已固定 已锁定 已移动 技术交流
1 帖子 1 发布者 168 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • xiaowen0407X 离线
    xiaowen0407X 离线
    xiaowen0407
    写于 最后由 编辑
    #1

    报错原因: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;
    m_decompressor = tjInitCompress();
    const int decompressStatus = 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);
    if (decompressStatus != 0)
    {
    	printf("解压失败:\n");
    	printf("原因是:%s", tjGetErrorStr());
    }
    (void)tjDestroy(m_decompressor);
    return true;
    

    }

    1 条回复 最后回复
    0
    回复
    • 在新帖中回复
    登录后回复
    • 从旧到新
    • 从新到旧
    • 最多赞同


    • 登录

    • 第一个帖子
      最后一个帖子
    0
    • 社区首页
    • 版块
    • 最新
    • 标签
    • 热门