C++ WICConvertBitmapSource()为GUID_WICPixelFormat16bppCbCr引发错误
我需要将rgb转换为YCBCR像素格式。我使用了WICConvertBitmapSource。我的源像素格式是GUID_WICPixelFormat24bppBGR。我想把它转换成GUID_WICPixelFormat16bppCbCr 当我试图将其传递给函数时,其返回HRESULT为0x88982F50。 如果我传递GUID_WICPixelFormat32bppBGRA,则函数不会返回任何错误 我的问题是 为什么我的转换失败了 如何将RGB转换为YCbCr 正确地 0x88982F50实际上意味着什么 我就是这样尝试的C++ WICConvertBitmapSource()为GUID_WICPixelFormat16bppCbCr引发错误,c++,image,wic,C++,Image,Wic,我需要将rgb转换为YCBCR像素格式。我使用了WICConvertBitmapSource。我的源像素格式是GUID_WICPixelFormat24bppBGR。我想把它转换成GUID_WICPixelFormat16bppCbCr 当我试图将其传递给函数时,其返回HRESULT为0x88982F50。 如果我传递GUID_WICPixelFormat32bppBGRA,则函数不会返回任何错误 我的问题是 为什么我的转换失败了 如何将RGB转换为YCbCr 正确地 0x88982F50实际上
int mwic_bitmap_converter
(
REFWICPixelFormatGUID dstPixelFormt, /* [in] Pixel format to be converted */
IWICBitmapSource* piBitmapSource, /* [in] Image Data */
IWICBitmapSource** ppiBitmapDst /* [out]converted image data */
)
{
WICPixelFormatGUID srcPixelFormat = { 0 }; /* Pixel format of the source */
UINT iWidth = 0, iHeight = 0; /* Size of the source */
UINT cbStride; /* Stride of the bitmap */
UINT cbBufferSize; /* Size of the buffer */
float* pixels; /* Pixel buffer */
piBitmapSource->GetSize(&iWidth,&iHeight);
piBitmapSource->GetPixelFormat(&srcPixelFormat);
if (!IsEqualGUID(srcPixelFormat, dstPixelFormt))
{
//this line gives the error
hr = WICConvertBitmapSource(dstPixelFormt, piBitmapSource, ppiBitmapDst);
}
.
.
.
.
.
}
可能的副本:@PaulMcKenzie谢谢。但我在那里找不到答案:/Visual Studio在“工具”>“错误查找”下的内置错误查找工具应该告诉您:0x88982F50是找不到的组件。@ChuckWalbourn非常感谢您。