From: msweet Date: Fri, 26 Feb 2016 20:39:11 +0000 (+0000) Subject: Add PWG Raster field definitions. X-Git-Tag: v2.2b1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e679a296806e87fc3a19b2aef809487d3d184a6;p=thirdparty%2Fcups.git Add PWG Raster field definitions. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13110 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/cups/raster.h b/cups/raster.h index a5aff2e048..cfd5be7293 100644 --- a/cups/raster.h +++ b/cups/raster.h @@ -1,9 +1,7 @@ /* - * "$Id$" - * * Raster file definitions for CUPS. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * This file is part of the CUPS Imaging library. @@ -56,7 +54,6 @@ extern "C" { # define CUPS_RASTER_SYNC_PWG CUPS_RASTER_SYNCv2 - /* * The following definition can be used to determine if the * colorimetric colorspaces (CIEXYZ, CIELAB, and ICCn) are @@ -78,6 +75,25 @@ extern "C" { # define CUPS_RASTER_HAVE_PWGRASTER 1 +/* + * The following PWG 5102.4 definitions specify indices into the + * cupsInteger[] array in the raster header. + */ + +# define CUPS_RASTER_PWG_TotalPageCount 0 +# define CUPS_RASTER_PWG_CrossFeedTransform 1 +# define CUPS_RASTER_PWG_FeedTransform 2 +# define CUPS_RASTER_PWG_ImageBoxLeft 3 +# define CUPS_RASTER_PWG_ImageBoxTop 4 +# define CUPS_RASTER_PWG_ImageBoxRight 5 +# define CUPS_RASTER_PWG_ImageBoxBottom 6 +# define CUPS_RASTER_PWG_AlternatePrimary 7 +# define CUPS_RASTER_PWG_PrintQuality 8 +# define CUPS_RASTER_PWG_VendorIdentifier 14 +# define CUPS_RASTER_PWG_VendorLength 15 + + + /* * Types... @@ -396,7 +412,3 @@ extern int cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, # endif /* __cplusplus */ #endif /* !_CUPS_RASTER_H_ */ - -/* - * End of "$Id$". - */ diff --git a/filter/raster.c b/filter/raster.c index ead19c0b10..0eef0ccf04 100644 --- a/filter/raster.c +++ b/filter/raster.c @@ -154,8 +154,8 @@ cupsRasterInitPWGHeader( return (0); } - h->cupsInteger[5] = h->cupsWidth; - h->cupsInteger[6] = h->cupsHeight; + h->cupsInteger[CUPS_RASTER_PWG_ImageBoxRight] = h->cupsWidth; + h->cupsInteger[CUPS_RASTER_PWG_ImageBoxBottom] = h->cupsHeight; /* * Colorspace and bytes per line... @@ -274,8 +274,8 @@ cupsRasterInitPWGHeader( * Duplex support... */ - h->cupsInteger[1] = 1; /* CrossFeedTransform */ - h->cupsInteger[2] = 1; /* FeedTransform */ + h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 1; + h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 1; if (sides) { @@ -299,30 +299,24 @@ cupsRasterInitPWGHeader( if (!strcmp(sheet_back, "flipped")) { if (h->Tumble) - { - h->cupsInteger[1] = 0xffffffffU; - h->cupsInteger[2] = 1; - } + h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; else - { - h->cupsInteger[1] = 1; - h->cupsInteger[2] = 0xffffffffU; - } + h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } else if (!strcmp(sheet_back, "manual-tumble")) { if (h->Tumble) { - h->cupsInteger[1] = 0xffffffffU; - h->cupsInteger[2] = 0xffffffffU; + h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; + h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } } else if (!strcmp(sheet_back, "rotated")) { if (!h->Tumble) { - h->cupsInteger[1] = 0xffffffffU; - h->cupsInteger[2] = 0xffffffffU; + h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; + h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } } else if (strcmp(sheet_back, "normal"))