c++ - WIC use specific codec -


I am working to convert cuff files from cameras to WIF format such as canyon and nickon in the form of a quarrel. I found an example using a file name to create a WIC factory object.

  // Create a WIC decoder ////////////////////////////////// //////////////////////////////////// IWICImagingFactory * piFactory = NULL; IWIC bitmapdicoder * piedecoder = faucet; // COM Imaging Factory. HRESULT hours = CoCreateInstance (CLSID_WICImagingFactory, Zero, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID *) & amp; piFactory); // Create decoder if (SUCCEEDED (hour)) {hours = piFactory-> JPEG Lossless Decoding / Encoding & amp; piDecoder for CreateDecoderFromFilename (L "test_raw.cr2", Zero, GENERIC_READ, WICDecodeMetadataCacheOnDemand,); }  

The file has the ".cr2" extension for Canon, as I know there are at least 2 different codecs for CR2 files, one from Canon and one from Microsoft This is to ensure that a specific codec is used. How can I do this?

Thanks

To ensure that you have a specific codec, It will need to create itself, such as:

  IWICBitmapDecoder * decoder; IWICStream * stream; Factory & gt; CreateStream (& amp; Section); Stream-> Early form filename (L "filename page", GENERIC_READ); CoCreateInstance (CLSID_WICPngDecoder, Zero, CLSCTX_INPROC_SERVER, IID_IWICBitmapDecoder, (Zero **) & Decoder); Decoder-> Start (Stream, WICDecodeMetadataCacheOnDemand);  

To obtain information about the CLSID, installed by the codec, use the IWICImagingFactory :: CreateComponentEnumerator.

You can also specify a vendor to create a codec while using IWICBitmapFactory, but it is not a guarantee that you will receive specific specification.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -