saveToFileTIFF Method

This function saves the contents of an image buffer to a TIFF file.
Syntax:
Error saveToFileTIFF( const IFrame& buf, const std::string& filename );
Error saveToFileTIFF( const IFrame& buf, const std::wstring& filename );
Error saveToFileTIFF( const IFrame& buf, const wchar_t* pFilename );

Parameter Description
buf

The buffer that is to be saved.

filename

Specifies the filename of the TIFF file.

pFilename

Specifies the filename of the TIFF file.

Return value:

This method returns an error object. If successful, it is set to eNOERROR. If the format of the image buffer can not be converted to TIFF, eINVALID_PARAM_VAL is returned. If the file can not be written, the error status is eWRITE_ERROR.

Remarks:

This method only supports image buffer formats Y800, Y16, RGB24, RGB32 and RGB64.

Information:

Namespace: DShowLib
Introduced in version 3.3

Sample:

The following sample shows how to snap an image and save it to a TIFF file.

if( m_Grabber.isLive())
{
    // This cast is only valid, if we have previously assigned a FrameHandlerSink to the grabber.
    tFrameHandlerSinkPtr pSink = static_smart_ptr_cast<FrameHandlerSink>(m_Grabber.getSinkTypePtr() );
    Error err = pSink->snapImages( 1 );
    if( !err.isError() )
    {
        DShowLib::saveToFileTIFF( *pSink->getLastAcqMemBuffer(), "Testimage.tiff" );
    }
}

See also: IFrame, MemBuffer, saveToFileBMP, saveToFileJPEG

<< Functions