예제 #1
0
CNetStreamToTapeFS::CNetStreamToTapeFS(MWContext* pContext, ITapeFileSystem *tapeFS ){
    NET_StreamClass *stream = NULL;

    if(!stream){
        XP_ASSERT( FALSE );
    }
    else {
	SetStream(stream);
    }
}
예제 #2
0
//-----------------------------------------------------------------------------
// GenNetStream
//
// This is what NetStream out should have been! A generalized net function.
// 
//-----------------------------------------------------------------------------
CStreamOutAnyNet::CStreamOutAnyNet(MWContext* pContext, URL_Struct *URL_s, FO_Present_Types type ){
    NET_StreamClass *stream;
    //URL_s->content_type = XP_STRDUP(TEXT_PLAIN);

    stream = NET_StreamBuilder(type, URL_s, pContext);

    if(!stream){
        XP_ASSERT( FALSE );
    }
    else {
	SetStream(stream);
    }
}
예제 #3
0
파일: Image.cpp 프로젝트: ONLYOFFICE/core
	void CImageDict::LoadRaw(const BYTE* pBuffer, unsigned int unSize, unsigned int unWidth, unsigned int unHeight)
	{
		CMemoryStream* pStream = new CMemoryStream(unSize);
		if (!pStream)
			return;
		pStream->Write(pBuffer, unSize);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("ColorSpace", "DeviceRGB");
		Add("Width", unWidth);
		Add("Height", unHeight);
		Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_FLATE_DECODE);
	}
예제 #4
0
파일: Image.cpp 프로젝트: ONLYOFFICE/core
	void CImageDict::LoadJb2(const wchar_t* wsFilePath, unsigned int unWidth, unsigned int unHeight)
	{
		CImageFileStream* pStream = new CImageFileStream();
		if (!pStream)
			return;

		pStream->OpenFile(wsFilePath);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);
		Add("ColorSpace", "DeviceGray");
		Add("BitsPerComponent", 1);
		SetFilter(STREAM_FILTER_JBIG2_DECODE);
	}
예제 #5
0
bool CMeshObject::SetStreamData( void *pIn, int numElements,  CHANNELDESCRIPTORLIST &flagArray )
{
	//for each stream channel, set the data
	int totalstride =0;
	list< int > CurOffsets;

	for( int i = 0; i < (int)flagArray.size(); i++ )
	{
		ChannelDesc * curStream = &flagArray[ i ];		
		CurOffsets.push_back( totalstride );
		totalstride += curStream->Stride;
	}
	list< int >::iterator iter = CurOffsets.begin();
	for( int i = 0; i < (int)flagArray.size(); i++, iter++ )
	{
		ChannelDesc * curStream = &flagArray[ i ];
		SetStream( curStream->ChannelHash,  pIn, numElements, curStream->Stride, (*iter), totalstride  );
	}
	return false;
}
예제 #6
0
파일: Image.cpp 프로젝트: ONLYOFFICE/core
    void CImageDict::LoadBW(NSImages::CPixJbig2* pPix, unsigned int unWidth, unsigned int unHeight)
	{
		SetStream(m_pXref, new CMemoryStream());
		CJbig2Global* pJbig2Global = m_pDocument->GetJbig2Global();
		pJbig2Global->AddImage(pPix, GetStream());

		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);
		Add("ColorSpace", "DeviceGray");
		Add("BitsPerComponent", 1);
		SetFilter(STREAM_FILTER_JBIG2_DECODE);

		CArrayObject* pDecodeParams = new CArrayObject();
		CDictObject* pParams = new CDictObject();
		pDecodeParams->Add(pParams);
		pParams->Add("JBIG2Globals", pJbig2Global);
		Add("DecodeParms", pDecodeParams);
	}
예제 #7
0
파일: Image.cpp 프로젝트: ONLYOFFICE/core
	void CImageDict::LoadRaw(const BYTE* pBgra, unsigned int unWidth, unsigned int unHeight)
	{
		CMemoryStream* pStream = new CMemoryStream(3 * unWidth * unHeight);
		if (!pStream)
			return;

		for (unsigned int unIndex = 0, unSize = 4 * unWidth * unHeight; unIndex < unSize; unIndex += 4)
		{
			pStream->Write(pBgra + unIndex, 3);
		}

		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("ColorSpace", "DeviceRGB");
		Add("Width", unWidth);
		Add("Height", unHeight);
		Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_FLATE_DECODE);
	}
예제 #8
0
파일: Image.cpp 프로젝트: ONLYOFFICE/core
    void CImageDict::LoadJpeg(BYTE* pBuffer, int nBufferSize, unsigned int unWidth, unsigned int unHeight, bool bGrayScale)
	{
		CMemoryStream* pStream = new CMemoryStream();
		if (!pStream)
			return;

		pStream->Write(pBuffer, nBufferSize);
		SetStream(m_pXref, pStream);
		Add("Type", "XObject");
		Add("Subtype", "Image");
		Add("Height", unHeight);
		Add("Width", unWidth);

        if (bGrayScale)
            Add("ColorSpace", "DeviceGray");
        else
            Add("ColorSpace", "DeviceRGB");

        Add("BitsPerComponent", 8);
		SetFilter(STREAM_FILTER_DCT_DECODE);
	}
예제 #9
0
//----------------------------------------------------------------------------
//! @brief	  	ストリームを開く
//! @param		stream : ストリーム
//! @return		エラーコード
//----------------------------------------------------------------------------
HRESULT CWMReader::OpenStream( IStream *stream )
{
	HRESULT		hr = S_OK;
	if( stream == NULL )
		return E_INVALIDARG;

	if( m_WMReader.p == NULL )
	{	// DLLからWMCreateSyncReaderを読み込んで使用する
		if( m_WmvDll.IsLoaded() == false )
			m_WmvDll.Load("wmvcore.dll");
		if( m_WmvDll.IsLoaded() == false )
			return m_WmvDll.GetLastError();

		typedef HRESULT (*FuncWMCreateSyncReader)( IUnknown *pUnkCert, DWORD dwRights, IWMSyncReader **ppSyncReader );
		FuncWMCreateSyncReader pWMCreateSyncReader = (FuncWMCreateSyncReader)m_WmvDll.GetProcAddress("WMCreateSyncReader");
		if( pWMCreateSyncReader == NULL )
			return m_WmvDll.GetLastError();
		if( FAILED(hr = pWMCreateSyncReader(  NULL, 0, &m_WMReader ) ))
			return hr;
	}

	if( FAILED( hr = Reader()->OpenStream( stream ) ) )
		return hr;

	CComPtr<IWMProfile>	pProfile;
	if( FAILED(hr = Reader()->QueryInterface( &pProfile ) ) )
		return hr;

	if( FAILED(hr = GetStreamNumbers( pProfile ) ) )
		return hr;

	if( FAILED(hr = Reader()->QueryInterface( &m_HeaderInfo ) ) )
		return hr;

	if( FAILED(hr = SetStream() ) )
		return hr;

//	hr = SetRange();
	return hr;
}
예제 #10
0
파일: LogStream.cpp 프로젝트: opatut/chars
LogStream::LogStream(const std::string& name) {
    SetName(name);
    SetStream(std::cout);
    SetFormat("[%1$s | %2$s] %3$s"); // [default | WARNING] This is a warning!
}
예제 #11
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *word - 
//-----------------------------------------------------------------------------
CCloseCaptionPhrase::CCloseCaptionPhrase( const wchar_t *phrase )
{
	Init();
	SetStream( phrase );
}
예제 #12
0
 SocketMessage_(const char *c):SocketMessage_(){
     SetStream((char *)c);
 }
예제 #13
0
// Built-in test routine.
void FormatSource::Test() {
    unsigned int i;
    Setk(0);
    SetStream("ben");
    printf("\n<-----     Begin Testing FormatSource    ----->\nstream:\n");
    printf("              b               e               n\n"); 
    printf("             %2x              %2x              %2x\n", 'b', 'e', 'n'); 
    printf("\nk=0, should map to k=1\n"); 
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("%d ", m);
    }
    Setk(1);
    printf("\nk=1\n"); 
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("%d ", m);
    }
    printf("\nk=2\n"); 
    Setk(2);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("  %d ", m);
    }
    printf("\nk=3\n"); 
    Setk(3);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("    %d ", m);
    }

    printf("\nk=4\n"); 
    Setk(4);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("     %2x ", m);
    }

    printf("\nk=5\n"); 
    Setk(5);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("       %2x ", m);
    }

    printf("\nk=6\n"); 
    Setk(6);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("         %2x ", m);
    }

    printf("\nk=7\n"); 
    Setk(7);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("           %2x ", m);
    }

    printf("\nk=8\n"); 
    Setk(8);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("             %2x ", m);
    }
    printf("\nk=9, should map to k=8\n"); 
    Setk(9);
    for (i = 0; i < GetMessageSymbolCount(); i++) {
        unsigned m = GetMessageSymbol(i);
        printf("             %2x ", m);
    }
    printf("\n<-----      End Testing FormatSource     ----->\n");
} // FormatSource::Test()
예제 #14
0
//------------------------------------------------------------------------------
//!	Summary:	Called to make a copy of the specified source object
//!
//!	Parameters:	\li rSource - the object to be copied
//!
//!	Returns:	None
//------------------------------------------------------------------------------
void CMLDataStream::Copy(const CMLDataStream& rSource)
{
	m_bRead = rSource.m_bRead;
	SetStream(rSource.m_pBuffer, rSource.m_ulSize);
}