Index: xc/programs/Xserver/Xprint/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Imakefile,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Imakefile --- xc/programs/Xserver/Xprint/Imakefile 26 Apr 2004 11:07:03 -0000 1.3 +++ xc/programs/Xserver/Xprint/Imakefile 7 Sep 2004 10:07:22 -0000 @@ -43,41 +43,41 @@ #endif SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS_OS2) OBJS = $(OBJS1) $(OBJS_OS2) #if XpRasterDDX RASTDIR = raster RASTDEF = -DXPRASTERDDX #endif #if XpColorPclDDX PCLDIR = pcl PCLDEF = -DXPPCLDDX #endif #if XpMonoPclDDX MPCLDIR = pcl-mono MPCLDEF = -DXPMONOPCLDDX #endif #if XpPostScriptDDX PSDIR = ps -PSDEF = -DXPPSDDX +PSDEF = -DXPPSDDX -DPSOUT_USE_DEEPCOLOR=1 #endif #if HasMkstemp MKTMP_DEFINES = -DHAS_MKSTEMP #endif #if XpRasterDDX || XpColorPclDDX || XpMonoPclDDX || XpPostScriptDDX SUBDIRS = $(RASTDIR) $(PCLDIR) $(MPCLDIR) $(PSDIR) etc #define IHaveSubdirs #endif INCLUDES = -I$(XINCLUDESRC) -I. -I../mfb -I../mi -I../cfb \ -I../include -I$(TOP)/include -I$(LIBSRC) \ -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(XLIBSRC) LINTLIBS = $(TOP)/server/dix/llib-ldix.ln $(TOP)/server/os/llib-los.ln \ $(TOP)/server/ddx/mfb/llib-lmfb.ln \ Index: xc/programs/Xserver/Xprint/Init.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/Init.c,v retrieving revision 1.6 diff -u -2 -0 -r1.6 Init.c --- xc/programs/Xserver/Xprint/Init.c 24 Jun 2004 06:26:27 -0000 1.6 +++ xc/programs/Xserver/Xprint/Init.c 7 Sep 2004 10:07:24 -0000 @@ -146,40 +146,41 @@ static PixmapFormatRec MonoPclPixmapFormats[] = { { 1, 1, BITMAP_SCANLINE_PAD } }; #define NUMMPCLFORMATS (sizeof MonoPclPixmapFormats)/(sizeof MonoPclPixmapFormats[0]) #endif #if defined(XPPCLDDX) || defined(XPMONOPCLDDX) #include "pcl/Pcl.h" #endif #ifdef XPPSDDX static PixmapFormatRec PSPixmapFormats[] = { { 1, 1, BITMAP_SCANLINE_PAD }, { 8, 8, BITMAP_SCANLINE_PAD }, + { 12, 16, BITMAP_SCANLINE_PAD }, { 24, 32, BITMAP_SCANLINE_PAD } }; #define NUMPSFORMATS (sizeof PSPixmapFormats)/(sizeof PSPixmapFormats[0]) #include "ps/Ps.h" #endif /* * The driverInitArray contains an entry for each driver the * server knows about. Each element contains pointers to pixmap formats, the * driver's initialization routine, and pointers to the driver's * attribute validation rec, and/or a driver function which * returns the maximum medium width&height, and maximum resolution * given a printer name. Either the validation rec OR the dimension * function can be NULL. If the function is non-NULL then it * will be called, and will be passed the (possibly NULL) validation rec. * If the function is NULL, then XpGetMaxWidthHeightRes() is called. */ Index: xc/programs/Xserver/Xprint/ps/Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/Imakefile,v retrieving revision 1.7 diff -u -2 -0 -r1.7 Imakefile --- xc/programs/Xserver/Xprint/ps/Imakefile 30 Aug 2004 12:49:50 -0000 1.7 +++ xc/programs/Xserver/Xprint/ps/Imakefile 7 Sep 2004 10:07:24 -0000 @@ -49,38 +49,38 @@ LinkSourceFile(version.h,$(TTF2PT1OURCEDIR)/) #endif /* BuildFreeType || BuildFreetype2Library */ #ifdef XVendorString VENDORSTRING = XVendorString VENDOR_STRING = -DVENDOR_STRING=\"$(VENDORSTRING)\" #endif #ifdef XVendorRelease VENDORRELEASE = XVendorRelease VENDOR_RELEASE = -DVENDOR_RELEASE="$(VENDORRELEASE)" #endif VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) XCOMM DEFINES = -DPIXPRIV XCOMM BM_CACHE disabled because it causes PostScript errors XCOMM (see http://xprint.mozdev.org/bugs/show_bug.cgi?id=1489) XCOMM DEFINES = -DXP_PSTEXT -DBM_CACHE $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) - DEFINES = -UXFree86LOADER -DXP_PSTEXT -D_XP_PRINT_SERVER_ $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) $(EXT_DEFINES) + DEFINES = -UXFree86LOADER -DPSOUT_USE_DEEPCOLOR=1 -DXP_PSTEXT -D_XP_PRINT_SERVER_ $(VENDOR_DEFINES) $(TTF2PT1_DEFINES) $(FT_DEFINES) $(EXT_DEFINES) INCLUDES = -I. -I../../cfb -I../../mi -I../../mfb -I$(LIBSRC) \ -I$(XINCLUDESRC) -I../../include -I.. -I$(TOP)/include \ -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(FONTLIBSRC)/include \ $(FT2INCS) -I../../../../lib/font/FreeType LINTLIBS = $(TOP)/server/dix/llib-ldix.ln $(TOP)/server/os/llib-los.ln \ $(TOP)/server/ddx/mfb/llib-lmfb.ln \ $(TOP)/server/ddx/mi/llib-lmi.ln \ $(TOP)/server/ddx/cfb/llib-lcfb.ln NormalLibraryObjectRule() NormalLibraryTarget(ps,$(OBJS)) NormalLintTarget($(SRCS1) $(SRCS2)) DependTarget() Index: xc/programs/Xserver/Xprint/ps/Ps.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/Ps.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Ps.h --- xc/programs/Xserver/Xprint/ps/Ps.h 18 Jul 2004 05:21:20 -0000 1.3 +++ xc/programs/Xserver/Xprint/ps/Ps.h 7 Sep 2004 10:07:27 -0000 @@ -539,41 +539,41 @@ extern char *PsGetAttributes(XpContextPtr pCon, XPAttributes pool); extern char *PsGetOneAttribute(XpContextPtr pCon, XPAttributes pool, char *attr); extern int PsAugmentAttributes(XpContextPtr pCon, XPAttributes pool, char *attrs); extern int PsSetAttributes(XpContextPtr pCon, XPAttributes pool, char *attrs); /* * Functions in PsColor.c */ extern Bool PsCreateColormap(ColormapPtr pColor); extern void PsDestroyColormap(ColormapPtr pColor); extern void PsInstallColormap(ColormapPtr pColor); extern void PsUninstallColormap(ColormapPtr pColor); extern int PsListInstalledColormaps(ScreenPtr pScreen, XID *pCmapList); extern void PsStoreColors(ColormapPtr pColor, int ndef, xColorItem *pdefs); extern void PsResolveColor(unsigned short *pRed, unsigned short *pGreen, unsigned short *pBlue, VisualPtr pVisual); -extern int PsGetPixelColor(ColormapPtr cMap, int pixval); +extern PsOutColor PsGetPixelColor(ColormapPtr cMap, int pixval); extern void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, ColormapPtr cMap); /* * Functions in PsPixmap.c */ extern PixmapPtr PsCreatePixmap(ScreenPtr pScreen, int width, int height, int depth); extern Bool PsDestroyPixmap(PixmapPtr pPixmap); extern DisplayListPtr PsGetFreeDisplayBlock(PsPixmapPrivPtr priv); extern void PsReplayPixmap(PixmapPtr pix, DrawablePtr pDrawable); extern int PsCloneDisplayElm(PixmapPtr dst, DisplayElmPtr elm, DisplayElmPtr newElm, int xoff, int yoff); extern void PsCopyDisplayList(PixmapPtr src, PixmapPtr dst, int xoff, int yoff, int x, int y, int w, int h); extern PsElmPtr PsCreateFillElementList(PixmapPtr pix, int *nElms); extern PsElmPtr PsCloneFillElementList(int nElms, PsElmPtr elms); extern void PsDestroyFillElementList(int nElms, PsElmPtr elms); Index: xc/programs/Xserver/Xprint/ps/PsArea.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsArea.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 PsArea.c --- xc/programs/Xserver/Xprint/ps/PsArea.c 23 Apr 2004 18:57:56 -0000 1.2 +++ xc/programs/Xserver/Xprint/ps/PsArea.c 7 Sep 2004 10:07:27 -0000 @@ -157,51 +157,76 @@ int rowsiz = PixmapBytePad(w, depth); for( r=0 ; r 8) && (depth < 16) ) + { + int rowsiz = PixmapBytePad(w, depth); + PsOut_BeginImage(psOut, 0, 0, x, y, w, h, sw, sh, 3); + for( r=0 ; rbgPixel), PsGetPixelColor(cMap, pGC->fgPixel), x, y, w, h, sw, sh, 1); @@ -322,51 +347,76 @@ int rowsiz = PixmapBytePad(w, depth); for( r=0 ; r 8) && (depth < 16) ) + { + int rowsiz = PixmapBytePad(w, depth); + PsOut_BeginImageIM(psOut, 0, 0, x, y, w, h, sw, sh, 3); + for( r=0 ; rbgPixel), PsGetPixelColor(cMap, pGC->fgPixel), x, y, w, h, sw, sh, 1); Index: xc/programs/Xserver/Xprint/ps/PsColor.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsColor.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 PsColor.c --- xc/programs/Xserver/Xprint/ps/PsColor.c 18 Jul 2004 05:21:20 -0000 1.3 +++ xc/programs/Xserver/Xprint/ps/PsColor.c 7 Sep 2004 10:07:27 -0000 @@ -145,50 +145,106 @@ for( i=0 ; ired[pdefs[i].pixel].co.local.red = pdefs[i].red; if( pdefs[i].flags&DoGreen ) pColor->red[pdefs[i].pixel].co.local.green = pdefs[i].green; if( pdefs[i].flags&DoBlue ) pColor->red[pdefs[i].pixel].co.local.blue = pdefs[i].blue; } } void PsResolveColor( unsigned short *pRed, unsigned short *pGreen, unsigned short *pBlue, VisualPtr pVisual) { } -int +PsOutColor PsGetPixelColor(ColormapPtr cMap, int pixval) { - int r, g, b; - if( cMap->pVisual->class==TrueColor ) return(pixval); - if( pixval<0 || pixval>255 ) return(0); - r = cMap->red[pixval].co.local.red>>8; - g = cMap->red[pixval].co.local.green>>8; - b = cMap->red[pixval].co.local.blue>>8; - return((r<<16)|(g<<8)|b); + VisualPtr v = cMap->pVisual; + switch( v->class ) + { + case TrueColor: + { + PsOutColor p = pixval; +#ifdef PSOUT_USE_DEEPCOLOR + /* Known bugs: + * - Lower bits of R,G,B-guns should be filled with upper bits + * otherwise an attempt to define the color "white" will result + * in the color value 0xFF00FF00FF00 (= r=0xFF00,g=0xFF00,b=0xFF00) + * instead of 0xFFFFFFFFFFFF (= r=0xFFFF,g=0xFFFF,b=0xFFFF) + * - The code cannot handle anything except 24bit right now (PsArea.c + * would need major adjustments for that, too) */ + return (((p & v->redMask) >> v->offsetRed) << (32+8)) | + (((p & v->greenMask) >> v->offsetGreen) << (16+8)) | + (((p & v->blueMask) >> v->offsetBlue) << (0+8)); +#else + return (((p & v->redMask) >> v->offsetRed) << 16) | + (((p & v->greenMask) >> v->offsetGreen) << 8) | + (((p & v->blueMask) >> v->offsetBlue) << 0); +#endif /* PSOUT_USE_DEEPCOLOR */ + } + case PseudoColor: + case GrayScale: + case StaticGray: + { + PsOutColor r, g, b; + if( pixval < 0 || pixval > v->ColormapEntries) + return(0); +#ifdef PSOUT_USE_DEEPCOLOR + if( v->class == PseudoColor ) + { + r = cMap->red[pixval].co.local.red; + g = cMap->red[pixval].co.local.green; + b = cMap->red[pixval].co.local.blue; + } + else + { + r = g = b = cMap->red[pixval].co.local.red; + } + return((r<<32)|(g<<16)|b); +#else + if( v->class == PseudoColor ) + { + r = cMap->red[pixval].co.local.red>>8; + g = cMap->red[pixval].co.local.green>>8; + b = cMap->red[pixval].co.local.blue>>8; + } + else + { + r = g = b = cMap->red[pixval].co.local.red>>8; + } + return((r<<16)|(g<<8)|b); +#endif /* PSOUT_USE_DEEPCOLOR */ + } + default: + FatalError("PsGetPixelColor: Unsupported visual %x\n", + (int)cMap->pVisual->class); + break; + } + + return 0; /* NO-OP*/ } void PsSetFillColor(DrawablePtr pDrawable, GCPtr pGC, PsOutPtr psOut, ColormapPtr cMap) { switch(pGC->fillStyle) { case FillSolid: PsOut_Color(psOut, PsGetPixelColor(cMap, pGC->fgPixel)); break; case FillTiled: if( !PsOut_BeginPattern(psOut, pGC->tile.pixmap, pGC->tile.pixmap->drawable.width, pGC->tile.pixmap->drawable.height, PsTile, 0, 0) ) { PsReplayPixmap(pGC->tile.pixmap, pDrawable); PsOut_EndPattern(psOut); } PsOut_SetPattern(psOut, pGC->tile.pixmap, PsTile); Index: xc/programs/Xserver/Xprint/ps/PsInit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/PsInit.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 PsInit.c --- xc/programs/Xserver/Xprint/ps/PsInit.c 26 Apr 2004 11:07:03 -0000 1.3 +++ xc/programs/Xserver/Xprint/ps/PsInit.c 7 Sep 2004 10:07:28 -0000 @@ -162,79 +162,108 @@ /* XXX Hard routine to write! */ /* * These two are going to be VERY different... */ pScreen->CreatePixmap = PsCreatePixmap; pScreen->DestroyPixmap = PsDestroyPixmap; pScreen->RealizeFont = PsRealizeFont; pScreen->UnrealizeFont = PsUnrealizeFont; pScreen->CreateGC = PsCreateGC; pScreen->CreateColormap = PsCreateColormap; pScreen->DestroyColormap = PsDestroyColormap; pScreen->InstallColormap = PsInstallColormap; pScreen->UninstallColormap = PsUninstallColormap; pScreen->ListInstalledColormaps = PsListInstalledColormaps; pScreen->StoreColors = PsStoreColors; pScreen->ResolveColor = PsResolveColor; /* Will BitmapToRegion make any difference at all? */ pScreen->BitmapToRegion = mfbPixmapToRegion; +#ifdef PSOUT_USE_DEEPCOLOR + nVisuals = 3; + nDepths = 3; +#else nVisuals = 2; nDepths = 2; +#endif /* PSOUT_USE_DEEPCOLOR */ + visuals = (VisualPtr)xalloc(nVisuals*sizeof(VisualRec)); depths = (DepthPtr) xalloc(nDepths*sizeof(DepthRec)); visuals[0].vid = FakeClientID(0); visuals[0].class = TrueColor; visuals[0].bitsPerRGBValue = 8; visuals[0].ColormapEntries = 256; visuals[0].nplanes = 24; visuals[0].redMask = 0x00FF0000; visuals[0].greenMask = 0x0000FF00; visuals[0].blueMask = 0x000000FF; visuals[0].offsetRed = 16; visuals[0].offsetGreen = 8; visuals[0].offsetBlue = 0; visuals[1].vid = FakeClientID(0); visuals[1].class = PseudoColor; visuals[1].bitsPerRGBValue = 8; visuals[1].ColormapEntries = 256; visuals[1].nplanes = 8; visuals[1].redMask = 0x0; visuals[1].greenMask = 0x0; visuals[1].blueMask = 0x0; visuals[1].offsetRed = 0x0; visuals[1].offsetGreen = 0x0; visuals[1].offsetBlue = 0x0; +#ifdef PSOUT_USE_DEEPCOLOR + /* PostScript Level 2 and above, colors can have 12 bits per component + * (36 bit for RGB) */ + visuals[2].vid = FakeClientID(0); + visuals[2].class = GrayScale; + visuals[2].bitsPerRGBValue = 12; + visuals[2].ColormapEntries = 4096; + visuals[2].nplanes = 12; + visuals[2].redMask = 0x0; + visuals[2].greenMask = 0x0; + visuals[2].blueMask = 0x0; + visuals[2].offsetRed = 0x0; + visuals[2].offsetGreen = 0x0; + visuals[2].offsetBlue = 0x0; +#endif /* PSOUT_USE_DEEPCOLOR */ + depths[0].depth = 24; depths[0].numVids = 1; depths[0].vids = (VisualID *)xalloc(sizeof(VisualID)); depths[0].vids[0] = visuals[0].vid; depths[1].depth = 8; depths[1].numVids = 1; depths[1].vids = (VisualID *)xalloc(sizeof(VisualID)); depths[1].vids[0] = visuals[1].vid; +#ifdef PSOUT_USE_DEEPCOLOR + depths[2].depth = 12; + depths[2].numVids = 1; + depths[2].vids = (VisualID *)xalloc(sizeof(VisualID)); + depths[2].vids[0] = visuals[2].vid; +#endif /* PSOUT_USE_DEEPCOLOR */ + /* Defaul visual is 8bit PseudoColor */ defaultVisual = visuals[1].vid; rootDepth = visuals[1].nplanes; #ifdef GLXEXT { miInitVisualsProcPtr proc = NULL; GlxWrapInitVisuals(&proc); /* GlxInitVisuals ignores the last three arguments. */ proc(&visuals, &depths, &nVisuals, &nDepths, &rootDepth, &defaultVisual, 0, 0, 0); } #endif /* GLXEXT */ miScreenInit(pScreen, (pointer)0, pScreen->width, pScreen->height, (int) (pScreen->width / (pScreen->mmWidth / 25.40)), (int) (pScreen->height / (pScreen->mmHeight / 25.40)), 0, rootDepth, nDepths, Index: xc/programs/Xserver/Xprint/ps/psout.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/psout.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 psout.c --- xc/programs/Xserver/Xprint/ps/psout.c 6 May 2004 00:24:32 -0000 1.3 +++ xc/programs/Xserver/Xprint/ps/psout.c 7 Sep 2004 10:07:31 -0000 @@ -405,51 +405,53 @@ while( buf[k] != '\0' ) k++; } strcat(self->Buf, "("); i = strlen(self->Buf); memcpy(&self->Buf[i], buf, k); self->Buf[i+k] = '\0'; strcat(self->Buf, ")"); if( strlen(self->Buf)>70 ) S_Flush(self); } void S_OutTok(PsOutPtr self, char *tok, int cr) { if( self->Buf[0] ) strcat(self->Buf, " "); strcat(self->Buf, tok); if( cr ) S_Flush(self); } static void -S_Color(PsOutPtr self, int clr) +S_Color(PsOutPtr self, PsOutColor clr) { int ir, ig, ib; - ir = clr>>16; ig = (clr>>8)&0xFF; ib = clr&0xFF; + ir = PSOUTCOLOR_TO_REDBITS(clr); + ig = PSOUTCOLOR_TO_GREENBITS(clr); + ib = PSOUTCOLOR_TO_BLUEBITS(clr); if( ir==ig && ig==ib ) - { S_OutNum(self, (float)ir/255.); S_OutTok(self, "g", 1); } + { S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); S_OutTok(self, "g", 1); } else { - S_OutNum(self, (float)ir/255.); - S_OutNum(self, (float)ig/255.); - S_OutNum(self, (float)ib/255.); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); S_OutTok(self, "sc", 1); } } static void S_SetPageDevice(PsOutPtr self, int orient, int count, int plex, int res, int wd, int ht, int isPage) { float fwd = ((float)wd/(float)res)*72.; float fht = ((float)ht/(float)res)*72.; #define USE_WORKAROUND_COPY_COUNT_BUG 1 #ifdef USE_WORKAROUND_COPY_COUNT_BUG /* Workaround (see http://xprint.mozdev.org/bugs/show_bug.cgi?id=1861 - * 'Need workaround for bug 1378 ...') to avoid that we print n^2 copies * instead of n copies. * The problem is that we use both /NumCopies here but pass the * %copy-count% to the spooler, too. * But we only have to use _one_ way... @@ -619,41 +621,41 @@ sprintf(buffer, "%%%%Title: %.256s", title); S_Comment(psout, buffer); } S_Comment(psout, "%%EndComments"); S_Comment(psout, "%%BeginProlog"); S_Comment(psout, "%%BeginProcSet: XServer_PS_Functions"); S_OutDefs(psout, S_StandardDefs); S_OutDefs(psout, S_CompositeDefs); S_Comment(psout, "%%EndProcSet"); S_Comment(psout, "%%EndProlog"); S_Comment(psout, "%%BeginSetup"); /* set document level page attributes */ S_SetPageDevice(psout, orient, count, plex, res, wd, ht, 0); S_Comment(psout, "%%Pages: atend"); S_OutDefs(psout, S_SetupDefs); S_Comment(psout, "%%EndSetup"); } /* * Initialize the structure */ - psout->CurColor = 0xFFFFFFFF; + psout->CurColor = PSOUTCOLOR_NOCOLOR; psout->LineWidth = 1; psout->LineCap = PsCButt; psout->LineJoin = PsJMiter; psout->NDashes = 0; psout->Dashes = (int *)0; psout->FontName = (char *)0; psout->FontSize = 0; psout->start_image = 0; for( i=0 ; i<4 ; i++ ) psout->FontMtx[i] = 0.; psout->ImageFormat = 0; return(psout); } void PsOut_EndFile(PsOutPtr self, int closeFile) { char coms[50]; int i; if (!self) @@ -706,41 +708,41 @@ void PsOut_EndPage(PsOutPtr self) { S_OutTok(self, "gr gr sp", 1); /* did grestore: mark attributes 'dirty' so they will be re-sent */ PsOut_DirtyAttributes(self); /*** comment for pagenumbers *****/ S_Comment(self,"%%PageTrailer"); /*** end comment *****************/ } void PsOut_DirtyAttributes(PsOutPtr self) { int i; - self->CurColor = 0xFFFFFFFF; + self->CurColor = PSOUTCOLOR_NOCOLOR; self->LineWidth = -1; self->LineCap = (PsCapEnum)-1; self->LineJoin = (PsJoinEnum)-1; self->NDashes = -1; self->FontSize = -1; for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; if( self->Dashes ) { xfree(self->Dashes); self->Dashes = (int *)0; } if( self->FontName ) { xfree(self->FontName); self->FontName = (char *)0; } } void PsOut_Comment(PsOutPtr self, char *comment) { S_Comment(self, comment); } void PsOut_Offset(PsOutPtr self, int x, int y) { self->XOff = x; @@ -894,56 +896,56 @@ S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.); S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.); S_OutTok(self, "m", 0); } S_OutNum(self, (float)elm->c.arc.x+xo+(float)elm->c.arc.w/2.); S_OutNum(self, (float)elm->c.arc.y+yo+(float)elm->c.arc.h/2.); S_OutNum(self, (float)elm->c.arc.w); S_OutNum(self, (float)elm->c.arc.h); S_OutNum(self, (float)elm->c.arc.a1/64.); S_OutNum(self, (float)elm->c.arc.a1/64.+(float)elm->c.arc.a2/64.); if( elm->c.arc.a2<0 ) S_OutTok(self, "An cp", 1); else S_OutTok(self, "Ac cp", 1); break; } } S_OutTok(self, "cl n", 1); } } void -PsOut_Color(PsOutPtr self, int clr) +PsOut_Color(PsOutPtr self, PsOutColor clr) { if( clr==self->CurColor || self->InTile>=PsStip ) return; self->CurColor = clr; S_Color(self, clr); } void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule) { self->FillRule = rule; } void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join, - int nDsh, int *dsh, int dshOff, int bclr) + int nDsh, int *dsh, int dshOff, PsOutColor bclr) { int i; int same = 1; if( wd!=self->LineWidth && wd>=0 ) { if( wd==0 ) wd = 1; self->LineWidth = wd; S_OutNum(self, (float)wd); S_OutTok(self, "w", 1); } if( cap!=self->LineCap ) { self->LineCap = cap; S_OutNum(self, (float)cap); S_OutTok(self, "lc", 1); } if( join!=self->LineJoin ) { self->LineJoin = join; S_OutNum(self, (float)join); S_OutTok(self, "lj", 1); } @@ -956,41 +958,44 @@ if( iNDashes && self->Dashes ) { xfree(self->Dashes); self->Dashes = (int *)0; } self->NDashes = nDsh; self->DashOffset = dshOff; if( nDsh ) self->Dashes = (int *)xalloc(sizeof(int)*nDsh); S_OutTok(self, "[", 0); for( i=0 ; iDashes[i] = dsh[i]; S_OutNum(self, (float)dsh[i]); } S_OutTok(self, "]", 0); S_OutNum(self, (float)dshOff); S_OutTok(self, "ds", 1); } - if( nDsh ) self->LineBClr = bclr; else bclr = -1; + if( nDsh ) + self->LineBClr = bclr; + else + bclr = PSOUTCOLOR_NOCOLOR; } void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso) { int i; char buf[256]; if( self->FontName && strcmp(fnam, self->FontName)==0 && siz==self->FontSize ) return; if( self->FontName ) xfree(self->FontName); self->FontName = (char *)xalloc(strlen(fnam)+1); strcpy(self->FontName, fnam); self->FontSize = siz; for( i=0 ; i<4 ; i++ ) self->FontMtx[i] = -1.; strcpy(buf, "/"); strcat(buf, fnam); S_OutTok(self, buf, 0); S_OutNum(self, (float)siz); if( iso ) S_OutTok(self, "t", 0); else S_OutTok(self, "f", 0); S_OutTok(self, "Tf", 1); @@ -1077,310 +1082,317 @@ if( ang2<0 ) S_OutTok(self, "An cp fl", 1); else S_OutTok(self, "Ac cp fl", 1); } void PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts) { int i; int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; if( nPts<1 ) return; for( i=0 ; iLineBClr>=0 ) + if( self->LineBClr != PSOUTCOLOR_NOCOLOR ) { S_OutTok(self, "gs", 0); S_Color(self, self->LineBClr); S_OutTok(self, "[] 0 ds st gr", 0); } S_OutTok(self, "st", 1); } void PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts) { int i; int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; if( nPts<1 ) return; for( i=0 ; iXOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; S_OutNum(self, (float)x); S_OutNum(self, (float)y); S_OutNum(self, (float)w); S_OutNum(self, (float)h); S_OutTok(self, "R", 0); - if( self->LineBClr>=0 ) + if( self->LineBClr != PSOUTCOLOR_NOCOLOR ) { S_OutTok(self, "gs", 0); S_Color(self, self->LineBClr); S_OutTok(self, "[] 0 ds st gr", 0); } S_OutTok(self, "st", 1); } void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h, float ang1, float ang2) { int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; S_OutNum(self, (float)x+(float)w/2.); S_OutNum(self, (float)y+(float)h/2.); S_OutNum(self, (float)w); S_OutNum(self, (float)h); S_OutNum(self, ang1); S_OutNum(self, ang1+ang2); if( ang2<0 ) S_OutTok(self, "An", 0); else S_OutTok(self, "Ac", 0); - if( self->LineBClr>=0 ) + if( self->LineBClr != PSOUTCOLOR_NOCOLOR ) { S_OutTok(self, "gs", 0); S_Color(self, self->LineBClr); S_OutTok(self, "[] 0 ds st gr", 0); } S_OutTok(self, "st", 1); } void -PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, int bclr) +PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, PsOutColor bclr) { int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; S_OutStr(self, text, textl); S_OutNum(self, (float)x); S_OutNum(self, (float)y); - if( bclr<0 ) S_OutTok(self, "T", 1); + if( bclr == PSOUTCOLOR_NOCOLOR ) + S_OutTok(self, "T", 1); else { - int ir = bclr>>16; - int ig = (bclr>>8)&0xFF; - int ib = bclr&0xFF; - S_OutNum(self, (float)ir/255.); - S_OutNum(self, (float)ig/255.); - S_OutNum(self, (float)ib/255.); + int ir = PSOUTCOLOR_TO_REDBITS(bclr); + int ig = PSOUTCOLOR_TO_GREENBITS(bclr); + int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); + + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); S_OutTok(self, "Tb", 1); } } void -PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, int bclr) +PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr) { int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; S_OutStr16(self, text, textl); S_OutNum(self, (float)x); S_OutNum(self, (float)y); - if( bclr<0 ) S_OutTok(self, "T", 1); + if( bclr == PSOUTCOLOR_NOCOLOR ) + S_OutTok(self, "T", 1); else { - int ir = bclr>>16; - int ig = (bclr>>8)&0xFF; - int ib = bclr&0xFF; - S_OutNum(self, (float)ir/255.); - S_OutNum(self, (float)ig/255.); - S_OutNum(self, (float)ib/255.); + int ir = PSOUTCOLOR_TO_REDBITS(bclr); + int ig = PSOUTCOLOR_TO_GREENBITS(bclr); + int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ig)); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ib)); S_OutTok(self, "Tb", 1); } } #ifdef BM_CACHE void /* new */ -PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, int bclr, int fclr) +PsOut_ImageCache(PsOutPtr self, int x, int y, long cache_id, PsOutColor bclr, PsOutColor fclr) { char cacheID[10]; int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; sprintf(cacheID, "c%di", cache_id); S_OutNum(self, (float)x); S_OutNum(self, (float)y); - if( fclr==0xFFFFFF ) + if( fclr==PSOUTCOLOR_WHITE ) { - int ir, ig, ib; - ir = bclr>>16; ig = (bclr>>8)&0xFF; ib = bclr&0xFF; + int ir = PSOUTCOLOR_TO_REDBITS(bclr); + int ig = PSOUTCOLOR_TO_GREENBITS(bclr); + int ib = PSOUTCOLOR_TO_BLUEBITS(bclr); + if( ir==ig && ig==ib ) - S_OutNum(self, (float)ir/255.); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); else S_OutNum(self, (float)0); self->RevImage = 1; } else { - int ir, ig, ib; - ir = fclr>>16; ig = (fclr>>8)&0xFF; ib = fclr&0xFF; + int ir = PSOUTCOLOR_TO_REDBITS(fclr); + int ig = PSOUTCOLOR_TO_GREENBITS(fclr); + int ib = PSOUTCOLOR_TO_BLUEBITS(fclr); + if( ir==ig && ig==ib ) - S_OutNum(self, (float)ir/255.); + S_OutNum(self, PSOUTCOLOR_BITS_TO_PSFLOAT(ir)); else S_OutNum(self, (float)0); } S_OutTok(self, cacheID, 1); } /* new */ void /* new */ PsOut_BeginImageCache(PsOutPtr self, long cache_id) { char cacheID[10]; sprintf(cacheID, "/c%di {", cache_id); S_OutTok(self, cacheID, 0); } /* new */ void /* new */ PsOut_EndImageCache(PsOutPtr self) { S_OutTok(self, "}bd", 1); } /* new */ #endif void -PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y, +PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, int w, int h, int sw, int sh, int format) { - int savClr = self->CurColor; + PsOutColor savClr = self->CurColor; int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; if( self->InTile ) { if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; } self->ImgBClr = bclr; self->ImgFClr = fclr; self->ImgX = x; self->ImgY = y; self->ImgW = w; self->ImgH = h; self->SclW = sw; self->SclH = sh; S_OutTok(self, "<", 0); self->ImageFormat = format; self->RevImage = 0; - if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF ) + if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE ) self->RevImage = 1; return; } self->RevImage = 0; if( format==1 ) { S_OutTok(self, "gs", 0); - if( fclr==0xFFFFFF ) + if( fclr==PSOUTCOLOR_WHITE ) { PsOut_Color(self, fclr); PsOut_FillRect(self, x, y, sw, sh); PsOut_Color(self, bclr); self->RevImage = 1; } else { PsOut_Color(self, bclr); PsOut_FillRect(self, x, y, sw, sh); PsOut_Color(self, fclr); } } S_OutNum(self, (float)x); S_OutNum(self, (float)y); S_OutNum(self, (float)w); S_OutNum(self, (float)h); S_OutNum(self, (float)sw); S_OutNum(self, (float)sh); if( format==1 ) { if(self->RevImage) S_OutTok(self, "Im1rev", 1); else S_OutTok(self, "Im1", 1); } else S_OutTok(self, "Im24", 1); self->ImageFormat = format; self->CurColor = savClr; } void -PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y, +PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, int w, int h, int sw, int sh, int format) { - int savClr = self->CurColor; + PsOutColor savClr = self->CurColor; int xo = self->XOff; int yo = self->YOff; if( self->InFrame || self->InTile ) xo = yo = 0; x += xo; y += yo; if( self->InTile ) { if( self->InTile>=PsStip && format!=1 ) { self->ImgSkip = 1; return; } self->ImgBClr = bclr; self->ImgFClr = fclr; self->ImgX = x; self->ImgY = y; self->ImgW = w; self->ImgH = h; self->SclW = sw; self->SclH = sh; S_OutTok(self, "<", 0); self->ImageFormat = format; self->RevImage = 0; - if( self->InTile==PsTile && format==1 && fclr==0xFFFFFF ) + if( self->InTile==PsTile && format==1 && fclr==PSOUTCOLOR_WHITE ) self->RevImage = 1; return; } self->RevImage = 0; if( format==1 ) { S_OutTok(self, "gs", 0); #ifdef BM_CACHE S_OutTok(self, "g", 1); #else - if( fclr==0xFFFFFF ) + if( fclr==PSOUTCOLOR_WHITE ) { PsOut_Color(self, bclr); self->RevImage = 1; } else { PsOut_Color(self, fclr); } #endif } #ifdef BM_CACHE S_OutTok(self, "tr", 0); /* new */ #else S_OutNum(self, (float)x); S_OutNum(self, (float)y); #endif S_OutNum(self, (float)w); S_OutNum(self, (float)h); S_OutNum(self, (float)sw); @@ -1394,41 +1406,41 @@ if(self->RevImage) S_OutTok(self, "Im1rev", 1); else S_OutTok(self, "Im1", 1); } else S_OutTok(self, "Im24", 1); #endif self->ImageFormat = format; self->CurColor = savClr; } void PsOut_EndImage(PsOutPtr self) { if( self->ImgSkip ) { self->ImgSkip = 0; return; } if( self->InTile ) { S_OutTok(self, ">", 1); if( self->ImageFormat==1 && self->InTile==PsTile ) { - if( self->ImgFClr==0xFFFFFF ) + if( self->ImgFClr==PSOUTCOLOR_WHITE ) { PsOut_Color(self, self->ImgFClr); PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH); PsOut_Color(self, self->ImgBClr); } else { PsOut_Color(self, self->ImgBClr); PsOut_FillRect(self, self->ImgX, self->ImgY, self->SclW, self->SclH); PsOut_Color(self, self->ImgFClr); } } S_OutNum(self, (float)self->ImgX); S_OutNum(self, (float)self->ImgY); S_OutNum(self, (float)self->ImgW); S_OutNum(self, (float)self->ImgH); S_OutNum(self, (float)self->SclW); S_OutNum(self, (float)self->SclH); if( self->ImageFormat==1 ) S_OutTok(self, "Im1t", 1); else S_OutTok(self, "Im24t", 1); @@ -1492,41 +1504,41 @@ { S_OutNum(self, (float)xoff); S_OutNum(self, (float)yoff); S_OutTok(self, "tr", 0); } S_OutTok(self, "gs", 1); self->InFrame += 1; } void PsOut_EndFrame(PsOutPtr self) { self->InFrame -= 1; if( self->InFrame<0 ) self->InFrame = 0; S_OutTok(self, "gr gr", 1); PsOut_DirtyAttributes(self); } int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, PsFillEnum type, - int bclr, int fclr) + PsOutColor bclr, PsOutColor fclr) { int i; char key[64]; for( i=0 ; iNPatterns ; i++ ) { if( self->Patterns[i].tag==tag && self->Patterns[i].type==type ) break; } if( iNPatterns ) return(1); if( (self->NPatterns+1)>self->MxPatterns ) { if( self->Patterns ) { self->MxPatterns *= 2; self->Patterns = (PsPatPtr)xrealloc(self->Patterns, sizeof(PsPatRec)*self->MxPatterns); } else { self->MxPatterns = 64; self->Patterns = (PsPatPtr)xalloc(sizeof(PsPatRec)*self->MxPatterns); } @@ -1568,41 +1580,41 @@ self->InTile = PsSolid; S_OutTok(self, "rs ed}d de im_ mp d", 1); } void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type) { int i; char key[64]; for( i=0 ; iNPatterns ; i++ ) { if( tag==self->Patterns[i].tag && type==self->Patterns[i].type ) break; } if( i>=self->NPatterns ) return; sprintf(key, " %d", (int)tag); switch(type) { case PsTile: key[0] = 't'; break; case PsStip: key[0] = 's'; break; case PsOpStip: key[0] = 'o'; break; } S_OutTok(self, key, 0); S_OutTok(self, "spt", 1); - self->CurColor = 0xFFFFFFFF; + self->CurColor = PSOUTCOLOR_NOCOLOR; } void PsOut_RawData(PsOutPtr self, char *data, int len) { S_Flush(self); if (!ferror(self->Fp)) { (void) fwrite(data, 1, len, self->Fp); } } typedef enum PsDownfontFontType_ { PsDFT_Type1PFA=0, PsDFT_Type1PFB, PsDFT_TrueType /* not implemented yet */ } PsDownfontFontType; /* Download a PS Type1 font */ int Index: xc/programs/Xserver/Xprint/ps/psout.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/Xprint/ps/psout.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 psout.h --- xc/programs/Xserver/Xprint/ps/psout.h 23 Apr 2004 18:57:56 -0000 1.2 +++ xc/programs/Xserver/Xprint/ps/psout.h 7 Sep 2004 10:07:32 -0000 @@ -136,151 +136,175 @@ typedef struct PsClipRec_ { int nRects; PsRectPtr rects; int nElms; PsElmPtr elms; int nOutterClips; PsRectPtr outterClips; } PsClipRec; typedef PsClipRec *PsClipPtr; typedef enum PsFTDownloadFontType_ { PsFontBitmap=0, PsFontType1, PsFontType3 } PsFTDownloadFontType; +#ifdef PSOUT_USE_DEEPCOLOR +typedef long long PsOutColor; +#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 32) +#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 16) & 0xFFFF) +#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFFFF) +#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 65535.) +#define PSOUTCOLOR_WHITE (0xFFFFFFFFFFFFLL) +#define PSOUTCOLOR_NOCOLOR (-1LL) +#define PSOUTCOLOR_TO_RGB24BIT(clr) (((PSOUTCOLOR_TO_REDBITS(clr) >> 8) << 16) | \ + ((PSOUTCOLOR_TO_GREENBITS(clr) >> 8) << 8) | \ + ((PSOUTCOLOR_TO_BLUEBITS(clr) >> 8) << 0)) +#else +typedef long PsOutColor; +#define PSOUTCOLOR_TO_REDBITS(clr) ((clr) >> 16) +#define PSOUTCOLOR_TO_GREENBITS(clr) (((clr) >> 8) & 0xFF) +#define PSOUTCOLOR_TO_BLUEBITS(clr) ((clr) & 0xFF) +#define PSOUTCOLOR_BITS_TO_PSFLOAT(b) ((float)(b) / 255.) +#define PSOUTCOLOR_WHITE (0xFFFFFF) +#define PSOUTCOLOR_NOCOLOR (-1) +#define PSOUTCOLOR_TO_RGB24BIT(clr) ((PSOUTCOLOR_TO_REDBITS(clr) << 16) | \ + (PSOUTCOLOR_TO_GREENBITS(clr) << 8) | \ + (PSOUTCOLOR_TO_BLUEBITS(clr) << 0)) +#endif /* PSOUT_USE_DEEPCOLOR */ + #ifdef USE_PSOUT_PRIVATE typedef void *voidPtr; typedef struct PsPatRec_ { PsFillEnum type; voidPtr tag; } PsPatRec; typedef PsPatRec *PsPatPtr; typedef struct PsOutRec_ { FILE *Fp; char Buf[16384]; - int CurColor; + PsOutColor CurColor; int LineWidth; PsCapEnum LineCap; PsJoinEnum LineJoin; int NDashes; int *Dashes; int DashOffset; - int LineBClr; + PsOutColor LineBClr; PsRuleEnum FillRule; char *FontName; int FontSize; float FontMtx[4]; int ImageFormat; int RevImage; int NPatterns; int MxPatterns; PsPatPtr Patterns; int ClipType; PsClipRec Clip; int InFrame; int XOff; int YOff; PsFillEnum InTile; int ImgSkip; - int ImgBClr; - int ImgFClr; + PsOutColor ImgBClr; + PsOutColor ImgFClr; int ImgX; int ImgY; int ImgW; int ImgH; int SclW; int SclH; Bool isRaw; int pagenum; int start_image; } PsOutRec; typedef struct PsOutRec_ *PsOutPtr; extern void S_Flush(PsOutPtr self); extern void S_OutNum(PsOutPtr self, float num); extern void S_OutTok(PsOutPtr self, char *tok, int cr); #else typedef struct PsOutRec_ *PsOutPtr; #endif /* USE_PSOUT_PRIVATE */ extern PsOutPtr PsOut_BeginFile(FILE *fp, char *title, int orient, int count, int plex, int res, int wd, int ht, Bool raw); extern void PsOut_EndFile(PsOutPtr self, int closeFile); extern void PsOut_BeginPage(PsOutPtr self, int orient, int count, int plex, int res, int wd, int ht); extern void PsOut_EndPage(PsOutPtr self); extern void PsOut_DirtyAttributes(PsOutPtr self); extern void PsOut_Comment(PsOutPtr self, char *comment); extern void PsOut_Offset(PsOutPtr self, int x, int y); extern void PsOut_Clip(PsOutPtr self, int clpTyp, PsClipPtr clpinf); -extern void PsOut_Color(PsOutPtr self, int clr); +extern void PsOut_Color(PsOutPtr self, PsOutColor clr); extern void PsOut_FillRule(PsOutPtr self, PsRuleEnum rule); extern void PsOut_LineAttrs(PsOutPtr self, int wd, PsCapEnum cap, PsJoinEnum join, int nDsh, int *dsh, int dshOff, - int bclr); + PsOutColor bclr); extern void PsOut_TextAttrs(PsOutPtr self, char *fnam, int siz, int iso); extern void PsOut_TextAttrsMtx(PsOutPtr self, char *fnam, float *mtx, int iso); extern void PsOut_Polygon(PsOutPtr self, int nPts, PsPointPtr pts); extern void PsOut_FillRect(PsOutPtr self, int x, int y, int w, int h); extern void PsOut_FillArc(PsOutPtr self, int x, int y, int w, int h, float ang1, float ang2, PsArcEnum style); extern void PsOut_Lines(PsOutPtr self, int nPts, PsPointPtr pts); extern void PsOut_Points(PsOutPtr self, int nPts, PsPointPtr pts); extern void PsOut_DrawRect(PsOutPtr self, int x, int y, int w, int h); extern void PsOut_DrawArc(PsOutPtr self, int x, int y, int w, int h, float ang1, float ang2); extern void PsOut_Text(PsOutPtr self, int x, int y, char *text, int textl, - int bclr); -extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, int bclr); + PsOutColor bclr); +extern void PsOut_Text16(PsOutPtr self, int x, int y, unsigned short *text, int textl, PsOutColor bclr); -extern void PsOut_BeginImage(PsOutPtr self, int bclr, int fclr, int x, int y, +extern void PsOut_BeginImage(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, int w, int h, int sw, int sh, int format); -extern void PsOut_BeginImageIM(PsOutPtr self, int bclr, int fclr, int x, int y, +extern void PsOut_BeginImageIM(PsOutPtr self, PsOutColor bclr, PsOutColor fclr, int x, int y, int w, int h, int sw, int sh, int format); extern void PsOut_EndImage(PsOutPtr self); extern void PsOut_OutImageBytes(PsOutPtr self, int nBytes, char *bytes); extern void PsOut_BeginFrame(PsOutPtr self, int xoff, int yoff, int x, int y, int w, int h); extern void PsOut_EndFrame(PsOutPtr self); extern int PsOut_BeginPattern(PsOutPtr self, void *tag, int w, int h, - PsFillEnum type, int bclr, int fclr); + PsFillEnum type, PsOutColor bclr, PsOutColor fclr); extern void PsOut_EndPattern(PsOutPtr self); extern void PsOut_SetPattern(PsOutPtr self, void *tag, PsFillEnum type); extern void PsOut_RawData(PsOutPtr self, char *data, int len); extern int PsOut_DownloadType1(PsOutPtr self, const char *auditmsg, const char *name, const char *fname); extern int PsOut_DownloadFreeType1(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset); extern int PsOut_DownloadFreeType3(PsOutPtr self, const char *psfontname, FontPtr pFont, long block_offset); extern int PsOut_DownloadFreeType(PsOutPtr self, PsFTDownloadFontType downloadfonttype, const char *psfontname, FontPtr pFont, long block_offset); extern void PsOut_Get_FreeType_Glyph_Name( char *destbuf, FontPtr pFont, unsigned long x11fontindex); extern void PsOut_FreeType_Text(FontPtr pFont, PsOutPtr self, int x, int y, char *text, int textl); extern void PsOut_FreeType_Text16(FontPtr pFont, PsOutPtr self, int x, int y, unsigned short *text, int textl); extern void PsOut_FreeType_TextAttrs16(PsOutPtr self, char *fnam, int siz, int iso); extern void PsOut_FreeType_TextAttrsMtx16(PsOutPtr self, char *fnam, float *mtx, int iso); #endif