QVideoFrameFormat Class
QVideoFrameFormat クラスは、ビデオ・プレゼンテーション・サーフェスのストリーム形式を指定します。詳細...
ヘッダ | #include <QVideoFrameFormat> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Multimedia) target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
qmake: | QT += multimedia |
パブリックな型
enum | ColorRange { ColorRange_Unknown, ColorRange_Video, ColorRange_Full } |
enum | ColorSpace { ColorSpace_Undefined, ColorSpace_BT601, ColorSpace_BT709, ColorSpace_AdobeRgb, ColorSpace_BT2020 } |
enum | ColorTransfer { ColorTransfer_Unknown, ColorTransfer_BT709, ColorTransfer_BT601, ColorTransfer_Linear, ColorTransfer_Gamma22, …, ColorTransfer_STD_B67 } |
enum | Direction { TopToBottom, BottomToTop } |
enum | PixelFormat { Format_Invalid, Format_ARGB8888, Format_ARGB8888_Premultiplied, Format_XRGB8888, Format_BGRA8888, …, Format_YUV420P10 } |
パブリック関数
QVideoFrameFormat() | |
QVideoFrameFormat(const QSize &size, QVideoFrameFormat::PixelFormat format) | |
QVideoFrameFormat(const QVideoFrameFormat &other) | |
QVideoFrameFormat(QVideoFrameFormat &&other) | |
~QVideoFrameFormat() | |
QVideoFrameFormat::ColorRange | colorRange() const |
QVideoFrameFormat::ColorSpace | colorSpace() const |
QVideoFrameFormat::ColorTransfer | colorTransfer() const |
int | frameHeight() const |
qreal | frameRate() const |
QSize | frameSize() const |
int | frameWidth() const |
bool | isMirrored() const |
bool | isValid() const |
QVideoFrameFormat::PixelFormat | pixelFormat() const |
int | planeCount() const |
QtVideo::Rotation | rotation() const |
QVideoFrameFormat::Direction | scanLineDirection() const |
void | setColorRange(QVideoFrameFormat::ColorRange range) |
void | setColorSpace(QVideoFrameFormat::ColorSpace colorSpace) |
void | setColorTransfer(QVideoFrameFormat::ColorTransfer colorTransfer) |
void | setFrameRate(qreal rate) |
void | setFrameSize(const QSize &size) |
void | setFrameSize(int width, int height) |
void | setMaxLuminance(float lum) |
void | setMirrored(bool mirrored) |
void | setRotation(QtVideo::Rotation angle) |
void | setScanLineDirection(QVideoFrameFormat::Direction direction) |
void | setStreamFrameRate(qreal rate) |
void | setViewport(const QRect &viewport) |
qreal | streamFrameRate() const |
void | swap(QVideoFrameFormat &other) |
QRect | viewport() const |
bool | operator!=(const QVideoFrameFormat &other) const |
QVideoFrameFormat & | operator=(QVideoFrameFormat &&other) |
QVideoFrameFormat & | operator=(const QVideoFrameFormat &other) |
bool | operator==(const QVideoFrameFormat &other) const |
静的パブリックメンバ
QImage::Format | imageFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format) |
QVideoFrameFormat::PixelFormat | pixelFormatFromImageFormat(QImage::Format format) |
QString | pixelFormatToString(QVideoFrameFormat::PixelFormat pixelFormat) |
詳細説明
ビデオシンクは、ビデオフレームのストリームを表示します。QVideoFrameFormat は、フレームのタイプを記述し、それらがどのように表示されるかを決定します。
ビデオシンクの設定に必要なビデオストリームのコアプロパティは、pixelFormat ()で与えられるピクセル形式と、frameSize ()で与えられるフレーム寸法です。
ビデオサーフェスに実際に表示されるフレームの領域は、viewport ()で与えられる。ストリームは、ビデオフレームの最も近い最適サイズよりも小さいビデオを可能にするために、フレームの全領域よりも小さいビューポートを持つことができます。たとえば、フレームの幅は、各スキャンラインの開始が8バイトに整列するように拡張されることがあります。
その他の一般的なプロパティとして、scanLineDirection ()、frameRate ()、yCrCbColorSpace()がある。
メンバ型ドキュメント
enum QVideoFrameFormat::ColorRange
ビデオデータで使用される色範囲を表す。ビデオデータは通常、すべての値が使用されるフルカラー範囲と、YUVビデオフォーマットで伝統的に使用されている、すべての値のサブセットが使用される、より限定された範囲のいずれかで提供されます。
定数 | 値 | 説明 |
---|---|---|
QVideoFrameFormat::ColorRange_Unknown | 0 | ビデオの色範囲は不明です。 |
QVideoFrameFormat::ColorRange_Video | 1 |
ほとんどの YUV ビデオフォーマットで伝統的に使用されている色範囲。8ビットフォーマットの場合、Y成分は16~235の値に制限される。U成分とV成分は16~240の値に制限される。
より高いビット深度では、これらの値に2^(深度-8)を乗算する。
定数 | 値 |
---|---|
QVideoFrameFormat::ColorRange_Full | 2 |
フルカラーレンジ。0 から 2^depth - 1 までのすべての値が有効。
enum QVideoFrameFormat::ColorSpace
ビデオフレームの色空間を列挙する。
定数 | 値 | 説明 |
---|---|---|
QVideoFrameFormat::ColorSpace_Undefined | 0 | 色空間は指定されない。 |
QVideoFrameFormat::ColorSpace_BT601 | 1 | ITU-R 勧告 BT.601 で定義された色空間で、Y 値の範囲は 16 から 235、Cb/Cr の範囲は 16 から 240。主にCRTディスプレイをターゲットとした古い映像で使用される。 |
QVideoFrameFormat::ColorSpace_BT709 | 2 | ITU-R BT.709で定義された色空間で、ColorSpace_BT601と同じ値域を持つ。現在最も一般的に使用されている色空間。 |
QVideoFrameFormat::ColorSpace_AdobeRgb | 5 | ほとんどのJPEGファイルで使われているフルレンジのYUV色空間。 |
QVideoFrameFormat::ColorSpace_BT2020 | 6 | ITU-R BT.2020で定義された色空間。主にHDRビデオに使用される。 |
enum QVideoFrameFormat::ColorTransfer
定数 | 値 | 説明 |
---|---|---|
QVideoFrameFormat::ColorTransfer_Unknown | 0 | 色伝達関数が不明。 |
QVideoFrameFormat::ColorTransfer_BT709 | 1 | 色値は BT709 に従ってエンコードされる。https://www.itu.int/rec/R-REC-BT.709/en も参照。これはガンマカーブ2.2に近いが同一ではなく、sRGBで使われているのと同じ伝達カーブである。 |
QVideoFrameFormat::ColorTransfer_BT601 | 2 | カラー値はBT601に従ってエンコードされます。https://www.itu.int/rec/R-REC-BT.601/en。 |
QVideoFrameFormat::ColorTransfer_Linear | 3 | 色値は線形 |
QVideoFrameFormat::ColorTransfer_Gamma22 | 4 | 色値はガンマ2.2でエンコードされます。 |
QVideoFrameFormat::ColorTransfer_Gamma28 | 5 | 色値はガンマ2.8でエンコードされる。 |
QVideoFrameFormat::ColorTransfer_ST2084 | 6 | 色値はSTME ST 2084を使用してエンコードされる。この伝達関数は最も一般的なHDR伝達関数であり、しばしば「知覚的量子化器」と呼ばれる。https://www.itu.int/rec/R-REC-BT.2100 および https://en.wikipedia.org/wiki/Perceptual_quantizer も参照。 |
QVideoFrameFormat::ColorTransfer_STD_B67 | 7 | カラー値はARIB STD B67を用いてエンコードされる。この伝達関数は、しばしば「ハイブリッドログガンマ」とも呼ばれる。https://www.itu.int/rec/R-REC-BT.2100 および https://en.wikipedia.org/wiki/Hybrid_log-gamma も参照。 |
enum QVideoFrameFormat::Direction
ビデオ走査線のレイアウト方向を列挙する。
定数 | 値 | 説明 |
---|---|---|
QVideoFrameFormat::TopToBottom | 0 | 走査線はフレームの上から下に向かって配置される。 |
QVideoFrameFormat::BottomToTop | 1 | 走査線はフレームの下から上に向かって配置される。 |
enum QVideoFrameFormat::PixelFormat
ビデオデータ型を列挙する。
定数 | 値 | 説明 |
---|---|---|
QVideoFrameFormat::Format_Invalid | 0 | フレームは無効です。 |
QVideoFrameFormat::Format_ARGB8888 | 1 | フレームは、コンポーネントあたり8ビットのARGBフォーマットを使用して格納されています。 |
QVideoFrameFormat::Format_ARGB8888_Premultiplied | 2 | コンポーネントあたり8ビットの事前乗算されたARGBフォーマットを使用して格納されたフレーム。 |
QVideoFrameFormat::Format_XRGB8888 | 3 | フレームはピクセルあたり32ビットのRGBフォーマット(0xff, R, G, B)を使用して保存されています。 |
QVideoFrameFormat::Format_BGRA8888 | 4 | 32ビットBGRAフォーマット(0xBBGGRRAA)を用いて格納されたフレーム。 |
QVideoFrameFormat::Format_BGRA8888_Premultiplied | 5 | フレームは、事前乗算された 32 ビット BGRA フォーマットで格納される。 |
QVideoFrameFormat::Format_ABGR8888 | 7 | フレームは 32 ビット ABGR フォーマット(0xAABBGGRR)で格納される。 |
QVideoFrameFormat::Format_XBGR8888 | 8 | フレームは 32 ビット BGR フォーマット(0xffBBGGRR)で格納される。 |
QVideoFrameFormat::Format_RGBA8888 | 9 | フレームはR、G、B、A/Xバイトとしてメモリに格納され、Rが最下位アドレス、A/Xが最上位アドレスとなる。 |
QVideoFrameFormat::Format_BGRX8888 | 6 | フレームは32ビットBGRxフォーマット、[31:0] B:G:R:x 8:8:8:8リトルエンディアンで格納される。 |
QVideoFrameFormat::Format_RGBX8888 | 10 | フレームはR、G、B、A/Xのバイトとしてメモリに格納され、Rが最下位アドレス、A/Xが最上位アドレスとなる。 |
QVideoFrameFormat::Format_AYUV | 11 | フレームはパックされた32ビットAYUVフォーマット(0xAAYYUUVV)で格納される。 |
QVideoFrameFormat::Format_AYUV_Premultiplied | 12 | フレームは、packed premultiplied 32-bit AYUV フォーマット(0xAAYYUUVV)を使用して格納される。 |
QVideoFrameFormat::Format_YUV420P | 13 | フレームは、UプレーンとVプレーンが水平方向と垂直方向にサブサンプリングされた、すなわちUプレーンとVプレーンの高さと幅がYプレーンの半分である、コンポーネントあたり8ビットの平面YUVフォーマットを使用して格納される。 |
QVideoFrameFormat::Format_YUV422P | 14 | フレームは、UおよびVプレーンが水平方向にサブサンプリングされた、すなわちUおよびVプレーンの幅がYプレーンの半分であり、UおよびVプレーンの高さがYと同じである、コンポーネントあたり8ビットの平面YUVフォーマットを使用して格納される。 |
QVideoFrameFormat::Format_YV12 | 15 | フレームは、コンポーネントあたり8ビットのプレーナーYVUフォーマットを使用して格納され、VおよびUプレーンは水平および垂直方向にサブサンプリングされます。 |
QVideoFrameFormat::Format_UYVY | 16 | フレームは、UおよびVプレーンを水平方向にサブサンプリング(U-Y-V-Y)したコンポーネントごとに8ビットのパックされたYUVフォーマットを使用して格納されます。つまり、水平方向に隣接する2つのピクセルは、各ピクセルのY値と共通のUおよびV値を持つ32ビットのマクロピクセルとして格納されます。 |
QVideoFrameFormat::Format_YUYV | 17 | すなわち、水平方向に隣接する2つの画素は、各画素のY値と共通のU値とV値を持つ32ビットのマクロピクセルとして格納される。 |
QVideoFrameFormat::Format_NV12 | 18 | フレームは、Yプレーン(Y)に続いて水平および垂直方向にサブサンプリングされ、パックされたUVプレーン(U-V)を持つコンポーネントあたり8ビットの半プレーンYUVフォーマットを使用して格納されます。 |
QVideoFrameFormat::Format_NV21 | 19 | フレームは、Yプレーン(Y)に続いて水平および垂直方向にサブサンプリングされたパックドVUプレーン(V-U)を持つ8ビット/コンポーネントセミプレーナーYUVフォーマットを使用して格納される。 |
QVideoFrameFormat::Format_IMC1 | 20 | フレームは、UプレーンとVプレーンが水平方向と垂直方向にサブサンプリングされた、コンポーネントあたり8ビットのプレーナーYUVフォーマットを使用して格納されます。これは Format_YUV420P タイプと似ていますが、U と V のプレーンのラインごとのバイトが Y プレーンと同じストライドにパディングされる点が異なります。 |
QVideoFrameFormat::Format_IMC2 | 21 | フレームは、コンポーネントあたり8ビットのプレーナーYUVフォーマットを使用して、UとVプレーンが水平方向と垂直方向にサブサンプリングされて格納されます。これはFormat_YUV420P型と似ていますが、UとVプレーンのラインがインターリーブされている点が異なります。つまり、Uデータの各ラインの後にVデータのラインが続き、Yデータと同じストライドの1ラインが作成されます。 |
QVideoFrameFormat::Format_IMC3 | 22 | フレームは、コンポーネントあたり8ビットのプレーナーYVUフォーマットを使用して格納され、VおよびUプレーンは水平および垂直方向にサブサンプリングされる。これは Format_YV12 タイプに似ているが、V と U のプレーンの行ごとのバイトが Y プ レーンと同じストライドになるようにパディングされる点が異なる。 |
QVideoFrameFormat::Format_IMC4 | 23 | フレームは、コンポーネントあたり8ビットの平面 YVU フォーマットを使用して格納され、V プレーンと U プレーンは水平方向と垂直方向にサブサンプリングされます。これは、Format_YV12 タイプと似ていますが、V プレーンおよび U プレーンの行がインターリーブされる点が異なります。つまり、V データの各行の後に U データの行が続き、Y データと同じストライドの 1 行が作成されます。 |
QVideoFrameFormat::Format_P010 | 26 | フレームは、Yプレーン(Y)の後に水平および垂直方向にサブサンプリングされ、パックされたUVプレーン(U-V)が続く、コンポーネントあたり16ビットのセミプレーナーYUVフォーマットを使用して格納されます。各コンポーネントの最上位10ビットのみが使用される。 |
QVideoFrameFormat::Format_P016 | 27 | フレームは、Yプレーン(Y)に続いて水平および垂直方向にサブサンプリングされたパックドUVプレーン(U-V)を持つ、コンポーネントあたり16ビットの半プレーンYUVフォーマットを使用して格納される。 |
QVideoFrameFormat::Format_Y8 | 24 | フレームは8ビットのグレースケールフォーマットで保存される。 |
QVideoFrameFormat::Format_Y16 | 25 | フレームは16ビットのリニアグレイスケールフォーマットで保存される。リトルエンディアン。 |
QVideoFrameFormat::Format_Jpeg | 29 | フレームは圧縮Jpegフォーマットで保存される。 |
QVideoFrameFormat::Format_SamplerExternalOES | 28 | フレームは外部OESテクスチャフォーマットで保存されます。これは現在Androidでのみ使用されています。 |
QVideoFrameFormat::Format_SamplerRect | 30 | フレームは矩形テクスチャフォーマット(GL_TEXTURE_RECTANGLE)で保存されます。これは、OpenGLベースのレンダリングハードウェアインターフェースを持つmacOSでのみ使用されています。テクスチャに格納される基本的なピクセルフォーマットはFormat_BRGA8888です。 |
QVideoFrameFormat::Format_YUV420P10 | 31 | YUV420に似ていますが、コンポーネントごとに16ビットを使用します。 |
メンバー関数ドキュメント
QVideoFrameFormat::QVideoFrameFormat()
NULL ビデオ・ストリーム形式を構築する。
QVideoFrameFormat::QVideoFrameFormat(const QSize &size, QVideoFrameFormat::PixelFormat format)
与えられたフレームsize とピクセルformat でビデオストリームを構築する。
QVideoFrameFormat::QVideoFrameFormat(const QVideoFrameFormat &other)
other のコピーを作成する。
[noexcept]
QVideoFrameFormat::QVideoFrameFormat(QVideoFrameFormat &&other)
other から移動して QVideoFrameFormat を構築します。
[noexcept]
QVideoFrameFormat::~QVideoFrameFormat()
ビデオストリームの説明を破棄する。
QVideoFrameFormat::ColorRange QVideoFrameFormat::colorRange() const
ビデオストリームのレンダリングに使用する色範囲を返します。
setColorRange()も参照 。
QVideoFrameFormat::ColorSpace QVideoFrameFormat::colorSpace() const
ビデオストリームの色空間を返す。
setColorSpace()も参照 。
QVideoFrameFormat::ColorTransfer QVideoFrameFormat::colorTransfer() const
ビデオストリームのレンダリングに使用する色変換関数を返します。
setColorTransfer()も参照 。
int QVideoFrameFormat::frameHeight() const
ビデオストリームのフレームの高さを返します。
qreal QVideoFrameFormat::frameRate() const
ビデオストリームのフレームレートを 1 秒あたりのフレーム数で返す。
setFrameRate()も参照 。
QSize QVideoFrameFormat::frameSize() const
ビデオストリーム内のフレームのサイズを返す。
setFrameSize()、frameWidth() およびframeHeight()も参照 。
int QVideoFrameFormat::frameWidth() const
ビデオストリーム内のフレームの幅を返す。
frameSize() およびframeHeight()も参照 。
[static]
QImage::Format QVideoFrameFormat::imageFormatFromPixelFormat(QVideoFrameFormat::PixelFormat format)
ビデオフレームのピクセルformat と等価な画像フォーマットを返す。等価なフォーマットがない場合は、代わりにQImage::Format_Invalid が返される。
注意: 一般的にQImage は YUV フォーマットを扱わない。
bool QVideoFrameFormat::isMirrored() const
サーフェスが垂直軸を中心にミラーリングされている場合、true
を返す。
QVideoFrameFormat
の変換、特に回転とミラーリングは、カメラセンサの向き、カメラの設定、またはビデオストリームの向きによって決定されます。
ミラーリングは回転の後に適用される。
注: ここでのミラーリングはQImage::mirrored とは異なり、垂直方向にミラーリングされたQImage は、そのX軸を中心にミラーリングされる。
bool QVideoFrameFormat::isValid() const
ビデオサーフェスフォーマットが有効なピクセルフォーマットとフレームサイズを持っているかどうかを識別する。
フォーマットが有効な場合は true を返し、そうでない場合は false を返します。
QVideoFrameFormat::PixelFormat QVideoFrameFormat::pixelFormat() const
ビデオストリーム内のフレームのピクセルフォーマットを返します。
[static]
QVideoFrameFormat::PixelFormat QVideoFrameFormat::pixelFormatFromImageFormat(QImage::Format format)
画像format と等価なビデオピクセルフォーマットを返す。同等のフォーマットがない場合は、代わりにQVideoFrameFormat::Format_Invalid が返される。
注意: 一般にQImage は YUV フォーマットを扱わない。
[static]
QString QVideoFrameFormat::pixelFormatToString(QVideoFrameFormat::PixelFormat pixelFormat)
与えられたpixelFormat の文字列表現を返す。
int QVideoFrameFormat::planeCount() const
使用するプレーン数を返す。この数値はピクセルフォーマットに依存し、RGBベースのフォーマットでは1、YUVベースのフォーマットでは1から3の間の数値となる。
QtVideo::Rotation QVideoFrameFormat::rotation() const
サーフェスが時計回りに回転する角度を返す。
QVideoFrameFormat
の変換、特に回転とミラーリングは、カメラ センサーの向き、カメラの設定、またはビデオ ストリームの向きによって決定できます。
回転はミラーリングの前に適用される。
setRotation()も参照 。
QVideoFrameFormat::Direction QVideoFrameFormat::scanLineDirection() const
走査線の方向を返す。
setScanLineDirection()も参照 。
void QVideoFrameFormat::setColorRange(QVideoFrameFormat::ColorRange range)
ビデオストリームのレンダリングに使用する色転送範囲をrange に設定する。
colorRange()も参照のこと 。
void QVideoFrameFormat::setColorSpace(QVideoFrameFormat::ColorSpace colorSpace)
ビデオストリームのcolorSpace を設定する。
colorSpace()も参照のこと 。
void QVideoFrameFormat::setColorTransfer(QVideoFrameFormat::ColorTransfer colorTransfer)
ビデオストリームのレンダリングに使用する色変換関数をcolorTransfer に設定する。
colorTransfer()も参照のこと 。
void QVideoFrameFormat::setFrameRate(qreal rate)
ビデオストリームのフレームrate を秒あたりのフレーム数で設定する。
frameRate()も参照のこと 。
void QVideoFrameFormat::setFrameSize(const QSize &size)
ビデオストリームのフレームサイズをsize に設定する。
これにより、viewport() がフレーム全体を埋めるようにリセットされる。
frameSize()も参照 。
void QVideoFrameFormat::setFrameSize(int width, int height)
これはオーバーロードされた関数である。
ビデオストリーム内のフレームのwidth とheight を設定する。
これにより、viewport ()がフレーム全体を埋めるようにリセットされる。
void QVideoFrameFormat::setMaxLuminance(float lum)
最大輝度を与えられた値、lum に設定する。
void QVideoFrameFormat::setMirrored(bool mirrored)
サーフェスが垂直軸を中心にmirrored 。
QVideoFrameFormat
の変換、特に回転とミラーリングは、カメラセンサの向き、カメラの設定、またはビデオストリームの向きによって決定されます。
ミラーリングは回転の後に適用されます。
デフォルト値はfalse
。
注: ここでのミラーリングはQImage::mirrored とは異なり、垂直にミラーリングされたQImage は、そのX軸を中心にミラーリングされます。
isMirrored()も参照 。
void QVideoFrameFormat::setRotation(QtVideo::Rotation angle)
サーフェスを時計回りに回転させるangle を設定します。
QVideoFrameFormat
の変換、特に回転とミラーリングは、カメラセンサの向き、カメラの設定、またはビデオストリームの向きによって決定されます。
回転はミラーリングの前に適用されます。
デフォルト値はQtVideo::Rotation::None
。
rotation()も参照 。
void QVideoFrameFormat::setScanLineDirection(QVideoFrameFormat::Direction direction)
走査線のdirection を設定する。
scanLineDirection()も参照のこと 。
void QVideoFrameFormat::setStreamFrameRate(qreal rate)
ビデオストリームのフレームrate を秒あたりのフレーム数で設定する。
streamFrameRate()も参照のこと 。
void QVideoFrameFormat::setViewport(const QRect &viewport)
動画ストリームのビューポートをviewport に設定する。
viewport()も参照のこと 。
qreal QVideoFrameFormat::streamFrameRate() const
ビデオストリームのフレームレートを 1 秒あたりのフレーム数で返す。
setStreamFrameRate()も参照 。
[noexcept]
void QVideoFrameFormat::swap(QVideoFrameFormat &other)
現在のビデオフレームフォーマットをother と交換する。
QRect QVideoFrameFormat::viewport() const
ビデオストリームのビューポートを返す。
ビューポートとは、実際に表示される動画フレームの領域である。
デフォルトでは、ビューポートはフレーム全体をカバーする。
setViewport()も参照 。
bool QVideoFrameFormat::operator!=(const QVideoFrameFormat &other) const
other がこのビデオフォーマットと異なる場合は true、同じ場合は false を返す。
[noexcept]
QVideoFrameFormat &QVideoFrameFormat::operator=(QVideoFrameFormat &&other)
other をこのQVideoFrameFormat に移動する。
QVideoFrameFormat &QVideoFrameFormat::operator=(const QVideoFrameFormat &other)
このオブジェクトにother の値を割り当てる。
bool QVideoFrameFormat::operator==(const QVideoFrameFormat &other) const
other がこのビデオフォーマットと同じ場合は true、異なる場合は false を返す。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.