Exemple #1
0
/* ---------------------------------------------------------------------------
 * writes just the elements in the buffer to file
 */
static int
WriteBuffer (FILE * FP)
{
  Cardinal i;

  WriteViaData (FP, PASTEBUFFER->Data);
  WriteElementData (FP, PASTEBUFFER->Data);
  for (i = 0; i < max_copper_layer + 2; i++)
    WriteLayerData (FP, i, &(PASTEBUFFER->Data->Layer[i]));
  return (STATUS_OK);
}
Exemple #2
0
/* ---------------------------------------------------------------------------
 * writes PCB to file
 */
static int
WritePCB (FILE * FP)
{
  Cardinal i;

  WritePCBInfoHeader (FP);
  WritePCBDataHeader (FP);
  WritePCBFontData (FP);
  WriteAttributeList (FP, &PCB->Attributes, "");
  WriteViaData (FP, PCB->Data);
  WriteElementData (FP, PCB->Data);
  WritePCBRatData (FP);
  for (i = 0; i < max_copper_layer + 2; i++)
    WriteLayerData (FP, i, &(PCB->Data->Layer[i]));
  WritePCBNetlistData (FP);

  return (STATUS_OK);
}
Exemple #3
0
/* ---------------------------------------------------------------------------
 * writes PCB to file
 */
static int
WritePCB (FILE * FP)
{
  Cardinal i;
  if (Settings.SaveMetricOnly)
    set_allow_readable (ALLOW_MM);
  else
    set_allow_readable (ALLOW_READABLE);

  WritePCBInfoHeader (FP);
  WritePCBDataHeader (FP);
  WritePCBFontData (FP);
  WriteAttributeList (FP, &PCB->Attributes, "");
  WriteViaData (FP, PCB->Data);
  WriteElementData (FP, PCB->Data);
  WritePCBRatData (FP);
  for (i = 0; i < max_copper_layer + 2; i++)
    WriteLayerData (FP, i, &(PCB->Data->Layer[i]));
  WritePCBNetlistData (FP);

  return (STATUS_OK);
}
void DoEffect(GPtr globals)
{
	// Get a buffer to hold each channel as we process
	char *pLayerData = gPSBufferSuite64->New(NULL, 
										   VSIZE * HSIZE * gXFactor * gXFactor);
	if (pLayerData == NULL)
		return;
		
	// Start with the first target composite channel
	ReadChannelDesc *pChannel = gDocDesc->targetCompositeChannels;

	// we may have a multichannel document
	if (pChannel == NULL)
		pChannel = gDocDesc->alphaChannels;
	
	// Get some information for the progress bar
	int32 done = 0;
	int32 total = NumberOfChannels(globals) + 1;
	
	// Loop through each of the channels
	while (pChannel != NULL && gResult == 0)
	{
		// Update the progress bar
		PIUpdateProgress(done++, total);
		
		// Read in this channel data, we actually don't need this data
	 	// but I will read it in anyway, it is an example you know
		ReadLayerData(globals, pChannel, pLayerData, false);
		
		// Stamp the "Hello World" into the data buffer
		HelloWorldData(globals, pLayerData);
		
		// Decide if we should blur our effect or just write out the
		// data. GaussianBlurEffect() will use a new channel port
		if (gGaussianBlurData)
			{
			Rect write_rect;
			write_rect.top = gPointV;
			write_rect.left = gPointH;
			write_rect.bottom = (short)(gPointV + VSIZE * gXFactor);
			write_rect.right = (short)(gPointH + HSIZE * gXFactor);
			GaussianBlurEffect(globals, &write_rect, pLayerData);
			}
		WriteLayerData(globals, pChannel, pLayerData);
			
		// off to the next channel
		pChannel = pChannel->next;
	}

	// Update the progress bar
	PIUpdateProgress(done++, total);
	
	// now update the transparency information
	// this will be non null for layered data
	pChannel = gDocDesc->targetTransparency;
	if (gResult == 0)
	{
		// Read in this channel data, we actually don't need this data
	 	// but I will read it in anyway, it is an example you know
		ReadLayerData(globals, pChannel, pLayerData, false);

		// Stamp the "Hello World" into the data buffer
		HelloWorldMaskData(globals, pLayerData);

		// write out the channel mask
		WriteLayerData(globals, pChannel, pLayerData);
	}

	// Update the progress bar
	PIUpdateProgress(done++, total);
	
	// dispose of that temp buffer we have been using
	gPSBufferSuite64->Dispose((char**)&pLayerData);
}