#ifndef _FRAMEFORMAT_H_ #define _FRAMEFORMAT_H_ #include struct Image_YUV420P; /** * @brief 支持的帧格式枚举 * */ enum class EFrameFormat { Frame_YUV420P = 0, /* YUV420P格式 */ Frame_RGBA8888, /* RGBA格式 */ }; /** * @brief 帧数据基础类 * */ struct FrameBase { protected: EFrameFormat format; /* 帧格式 */ public: FrameBase(EFrameFormat fmt = EFrameFormat::Frame_YUV420P) : format(fmt) { } virtual ~FrameBase() { } /* 虚析构函数,确保派生类的析构函数被调用 */ EFrameFormat frameFormat() const { return format; } /* 获取帧格式 */ }; /** * @brief YUV420P格式的帧数据结构 * */ struct Frame_YUV420P : public FrameBase { Image_YUV420P* frameData = nullptr; /* YUV420P格式的图像数据 */ Frame_YUV420P(); ~Frame_YUV420P() override; }; struct Frame_RGBA8888 : public FrameBase { QImage* frameData = nullptr; /* RGBA格式的图像数据 */ Frame_RGBA8888(); ~Frame_RGBA8888() override; }; /* 删除一个图片 */ bool deleteOneFrame(FrameBase* frame); #endif /* _FRAMEFORMAT_H_ */