Exemple #1
0
BOOL PrintPSRenderRegion::WriteRenderPaper(KernelDC *pDC)
{
/*
	ColourPlate* pSeparation;
	GetOutputColourPlate(COLOURMODEL_CMYK, NULL, &pSeparation);

	// do nothing if we are not separating
	if (pSeparation==NULL)
		return TRUE;

	// if this plate says negative lets do it
	if (pSeparation->IsEPSNegative())
		return WriteFillPaper(pDC);
*/
	// Find the print control structure.
	PrintControl *pControl = GetRenderView()->GetPrintControl();
	if (pControl)
	{
		TypesetInfo *pTypeset = pControl->GetTypesetInfo();
		if (pTypeset && pTypeset->PrintPhotoNegative())
			return WriteFillPaper(pDC);
	}

	return TRUE;
}
Exemple #2
0
bool CScene::AddCameraToView( RenderViewID id, CBaseCamera& camera )
{
	CBaseRenderView* rv = GetRenderView(id);
	if(rv)
	{
		rv->AddCamara(camera);
		return true;
	}

	return false;
}
Exemple #3
0
BOOL PrintPSRenderRegion::WriteSepFunctions(KernelDC *pDC)
{
	PrintControl *pPrintCtl=NULL;
	View *pView = GetRenderView();
	if (pView) pPrintCtl = pView->GetPrintControl();
	if (!pPrintCtl)
		return TRUE;

	// Get a pointer to the typeset info structure
	TypesetInfo *pInfo = pPrintCtl->GetTypesetInfo();
	// Is screening off?
	if (!pInfo->AreScreening())
		return TRUE;

	// Get hold of our PostScript prolog resource...
	CCResTextFile ScreenFile;

	// Open the file
	if (!ScreenFile.open(_R(IDM_PS_SPOTFUNCS), _R(IDT_PS_RES)))
	{
		// Failed to open the file...
		ERROR2(FALSE, "Could not get at PostScript resource!");
	} 

	// Read each line from the file and output it to the DC.
	String_256 LineBuf;
	TCHAR *pBuf = (TCHAR *) LineBuf;
	
	while (!ScreenFile.eof())
	{
		// Copy this line to output.
		ScreenFile.read(&LineBuf);
		pDC->OutputTCHARAsChar(pBuf, LineBuf.Length());
		pDC->OutputNewLine();
	}
	
	// All done
	ScreenFile.close();

	return TRUE;
}
Exemple #4
0
BOOL PrintPSRenderRegion::WritePlateScreen(KernelDC *pDC)
{
	PrintControl *pPrintCtl=NULL;
	View *pView = GetRenderView();
	if (pView) pPrintCtl = pView->GetPrintControl();
	if (!pPrintCtl)
		return TRUE;

	// Get a pointer to the typeset info structure
	TypesetInfo *pInfo = pPrintCtl->GetTypesetInfo();
	
	double ang,freq;
	String_256 ScreenName;
	ScreenType scrtype;

	// If separating then interogate the current plate
	if (pInfo->AreSeparating())
	{
		ColourPlate* pSeparation;
		GetOutputColourPlate(COLOURMODEL_CMYK, NULL, &pSeparation);
		
		// do nothing if we are not separating
		if (pSeparation==NULL)
			return TRUE;

		// Make sure screening is on in this plate
		if (!pSeparation->ActiveScreening())
			return TRUE;

		// Get the screen type if enabled.
		scrtype = pSeparation->GetScreenFunction();
		if (scrtype==SCRTYPE_NONE)
			return TRUE;

		// ok we can get the angle and frequency
		ang = pSeparation->GetScreenAngle();
		freq = pSeparation->GetScreenFrequency();
	}
	else
	{
		// Is screening off?
		if (!pInfo->AreScreening())
			return TRUE;

		scrtype = pInfo->GetScreenFunction();
		if (scrtype==SCRTYPE_NONE)
			return TRUE;

		ang = 45.0;
		freq = pInfo->GetDefaultScreenFrequency();
	}

	// read the name of this screen
	pInfo->GetScreenName(scrtype, &ScreenName);
		
	String_256 fred;
	fred += String_8(_T("{"));
	fred += ScreenName;
	fred += String_8(_T("}"));

	// ok output 'freq ang screenfunc setscreen'
	BOOL ok = pDC->OutputFloat(freq, 4);
	ok = ok && pDC->OutputFloat(ang, 4);
	ok = ok && pDC->OutputToken(fred);
	ok = ok && pDC->OutputToken(_T("setscreen"));
	ok = ok && pDC->OutputNewLine();

	return ok;
}