Ejemplo n.º 1
0
BOOL PrintComponent::ExportImagesetting(BaseCamelotFilter *pFilter)
{
	BOOL ok = TRUE;

#if !defined(EXCLUDE_FROM_RALPH)

	TypesetInfo *TInfo = GetPrintControl()->GetTypesetInfo();
	if (TInfo == NULL)
		return(TRUE);		// If we can't find imagesetting info, don't sweat it

	CXaraFileRecord Rec(TAG_IMAGESETTING, TAG_IMAGESETTING_SIZE);
	if (ok)  ok = Rec.Init();

	if (ok)  ok = Rec.WriteINT32(TInfo->GetPrintResolution());
	if (ok)  ok = Rec.WriteDOUBLE(TInfo->GetDefaultScreenFrequency());

	if (ok)
	{
		UINT16 Func = 0;
		switch(TInfo->GetScreenFunction())
		{
			case SCRTYPE_SPOT1:			Func = 1;	break;
			case SCRTYPE_SPOT2:			Func = 2;	break;
			case SCRTYPE_TRIPLESPOT1:	Func = 3;	break;
			case SCRTYPE_TRIPLESPOT2:	Func = 4;	break;
			case SCRTYPE_ELLIPTICAL:	Func = 5;	break;
			case SCRTYPE_LINE:			Func = 6;	break;
			case SCRTYPE_CROSSHATCH:	Func = 7;	break;
			case SCRTYPE_MEZZOTINT:		Func = 8;	break;
			case SCRTYPE_SQUARE:		Func = 9;	break;
			case SCRTYPE_DITHER:		Func = 10;	break;
			default:
				break;
		}
		ok = Rec.WriteUINT16(Func);
	}

	if (ok)
	{
	  	BYTE Flags = 0x00;
		if (TInfo->AreSeparating())			Flags |= 0x01;
		if (TInfo->AreScreening())			Flags |= 0x02;
		if (TInfo->PrintEmulsionDown())		Flags |= 0x04;
		if (TInfo->PrintPhotoNegative())	Flags |= 0x08;
		if (TInfo->AlwaysOverprintBlack())	Flags |= 0x10;

		ok = Rec.WriteBYTE(Flags);
	}

	if (ok)
		pFilter->Write(&Rec);

#endif // EXCLUDE_FROM_RALPH
	return(ok);
}
Ejemplo n.º 2
0
void PrintComponent::ImportImagesetting(CXaraFileRecord* Rec)
{
#if !defined(EXCLUDE_FROM_RALPH)
	PORTNOTETRACE("print","PrintComponent::ImportImagesetting - do nothing");
	TypesetInfo *TInfo = GetPrintControl()->GetTypesetInfo();
	if (TInfo == NULL)
		return;

	// Vape any colour plates already resident in the typeset info
	TInfo->DestroyPlateList();

	BOOL ok = TRUE;

	if (ok)
	{
		INT32 Res;
		ok = Rec->ReadINT32(&Res);
		if (ok)  TInfo->SetPrintResolution(Res);
	}

	if (ok)
	{
		double Freq;
		ok = Rec->ReadDOUBLE(&Freq);
		if (ok)  TInfo->SetDefaultScreenFrequency(Freq);
	}

	if (ok)
	{
		UINT16 Func;
		ok = Rec->ReadUINT16(&Func);

		if (ok)
		{
			ScreenType Screen = SCRTYPE_NONE;
			switch(Func)
			{
				case 1: Screen = SCRTYPE_SPOT1;			break;
				case 2: Screen = SCRTYPE_SPOT2;			break;
				case 3: Screen = SCRTYPE_TRIPLESPOT1;	break;
				case 4: Screen = SCRTYPE_TRIPLESPOT2;	break;
				case 5: Screen = SCRTYPE_ELLIPTICAL;	break;
				case 6: Screen = SCRTYPE_LINE;			break;
				case 7: Screen = SCRTYPE_CROSSHATCH;	break;
				case 8: Screen = SCRTYPE_MEZZOTINT;		break;
				case 9: Screen = SCRTYPE_SQUARE;		break;
				case 0: Screen = SCRTYPE_DITHER;		break;
			}
			TInfo->SetScreenFunction(Screen, TRUE);
		}
	}

	if (ok)
	{
	  	BYTE Flags;
		ok = Rec->ReadBYTE(&Flags);

		TInfo->SetSeparations(	(Flags & 0x01) != 0);
		TInfo->SetOutputPrintersMarks(TInfo->AreSeparating());	// Slave Printers Marks off the Seps flag

		TInfo->SetScreening(	(Flags & 0x02) != 0);
		TInfo->SetEmulsionDown(	(Flags & 0x04) != 0);
		TInfo->SetPhotoNegative((Flags & 0x08) != 0);
		TInfo->SetOverprintBlack((Flags & 0x10) != 0);
	} 
#endif
}
Ejemplo n.º 3
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;
}