类 Input::Frames::FrameFormat

表示图像格式属性 (的集合,例如 FOURCC、宽度、高度、步幅...)

成员

属性

语法: public FrameFormatProperties & Properties;

获取其他 FrameFormat 属性的集合。

~FrameFormat

语法: public inline virtual ~FrameFormat ( );

析构 FrameFormat 类的实例。

GetFourCC

语法: public inline std::string GetFourCC ( ) const;

获取图像格式的 FOURCC 值。

返回

字符串格式的 FOURCC 格式代码

GetFourCC

语法: public inline void GetFourCC ( char * ch1 , char * ch2 , char * ch3 , char * ch4 ) const;

获取图像格式的 FOURCC 值。

参数

  • ch1 指向用于接收 FOURCC 字符 1 的字符的指针

  • ch2 指向用于接收 FOURCC 字符 2 的字符的指针

  • ch3 指向用于接收 FOURCC 字符 3 的字符的指针

  • ch4 指向用于接收 FOURCC 字符 4 的 char 的指针

GetWidth

语法: public inline int GetWidth ( ) const;

获取图像格式的像素宽度。

返回

图像像素宽度。

GetHeight

语法: public inline int GetHeight ( ) const;

获取图像格式的像素高度。

返回

图像像素高度。

GetStride

语法: public inline int GetStride ( ) const;

获取图像格式的像素步幅。

返回

图像像素步幅。

SetBitsPerPixel

语法: public inline void SetBitsPerPixel ( int bitsPerPixel );

设置图像格式的每像素位数值。

参数

  • bitsPerPixel 图像的每像素位数值。

GetBitsPerPixel

语法: public inline int GetBitsPerPixel ( ) const;

获取图像格式的每像素位数值。

返回

图像的每像素位数值。

CreateFourCCFormat

语法: public inline static std::shared_ptr< FrameFormat > CreateFourCCFormat ( char ch1 , char ch2 , char ch3 , char ch4 , int width , int height , int stride );

基于 FourCC 值初始化 FrameFormat 类的新实例。

参数

  • ch1 FOURCC 字符 1

  • ch2 FOURCC 字符 2

  • ch3 FOURCC 字符 3

  • ch4 FOURCC 字符 4

  • width 图像格式的像素宽度

  • height 图像格式的像素高度

  • stride 图像格式的像素步幅

返回

包装在 std::shared_ptr 中的新创建的 FrameFormat

CreateRGBFormat

语法: public inline static std::shared_ptr< FrameFormat > CreateRGBFormat ( int bitsPerPixel , int width , int height , int stride );

为未压缩的 32 位 ARGB 图像初始化 FrameFormat 类的新实例。

参数

  • bitsPerPixel 图像格式的每像素位数 (,例如 8、16、24、32...)

  • width 图像格式的像素宽度 (例如 640)

  • height 图像格式的像素高度 (,例如 480)

  • stride 图像格式的像素步幅

返回

包装在 std::shared_ptr 中的新创建的 FrameFormat

CreateGreyFormat

语法: public inline static std::shared_ptr< FrameFormat > CreateGreyFormat ( int bitsPerPixel , int width , int height , int stride );

为未压缩的灰色图像初始化 FrameFormat 类的新实例。

参数

  • bitsPerPixel 图像格式的每像素位数 (,例如 8、16、24、32...)

  • width 图像格式的像素宽度 (例如 640)

  • height 图像格式的像素高度 (,例如 480)

  • stride 图像格式的像素步幅

返回

包装在 std::shared_ptr 中的新创建的 FrameFormat

CreateBGRFormat

语法: public inline static std::shared_ptr< FrameFormat > CreateBGRFormat ( int bitsPerPixel , int width , int height , int stride );

为未压缩的 BGR 图像初始化 FrameFormat 类的新实例。

参数

  • bitsPerPixel 图像格式的每像素位数 (,例如 8、16、24、32...)

  • width 图像格式的像素宽度 (例如 640)

  • height 图像格式的像素高度 (,例如 480)

  • stride 图像格式的像素步幅

返回

包装在 std::shared_ptr 中的新创建的 FrameFormat

CreateBGRAFormat

语法: public inline static std::shared_ptr< FrameFormat > CreateBGRAFormat ( int bitsPerPixel , int width , int height , int stride );

为未压缩的 BGRA 图像初始化 FrameFormat 类的新实例。

参数

  • bitsPerPixel 图像格式的每像素位数 (,例如 8、16、24、32...)

  • width 图像格式的像素宽度 (例如 640)

  • height 图像格式的像素高度 (,例如 480)

  • stride 图像格式的像素步幅

返回

新创建的 FrameFormat 包装在 std::shared_ptr