#pragma once #include #include #include namespace NVJpegDecoder { class JpegImage { public: JpegImage() noexcept : mNvImage(nullptr) {} virtual ~JpegImage(); JpegImage(const JpegImage&) = delete; JpegImage& operator=(const JpegImage&) = delete; JpegImage(JpegImage&& rhs); JpegImage& operator=(JpegImage&& rhs); bool Init(int width, int height, int channels); nvjpegImage_t* GetImagePoint() { return mNvImage.get(); } const std::vector Dims() { return std::vector{mHeight, mWidth, mChannels}; } unsigned char* Cpu(); private: int mWidth = 0; int mHeight = 0; int mChannels = 0; nvjpegChromaSubsampling_t mSubsampling; std::unique_ptr mNvImage; }; } // namespace NVJpegDecoder