diff options
-rw-r--r-- | apps/pdfapp.c | 6 | ||||
-rw-r--r-- | apps/pdfdraw.c | 8 | ||||
-rw-r--r-- | apps/pdfextract.c | 4 | ||||
-rw-r--r-- | draw/meshdraw.c | 2 | ||||
-rw-r--r-- | fitz/dev_draw.c | 2 | ||||
-rw-r--r-- | fitz/fitz.h | 8 | ||||
-rw-r--r-- | fitz/res_colorspace.c | 70 | ||||
-rw-r--r-- | mupdf/pdf_build.c | 4 | ||||
-rw-r--r-- | mupdf/pdf_colorspace.c | 44 | ||||
-rw-r--r-- | mupdf/pdf_interpret.c | 18 |
10 files changed, 83 insertions, 83 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 32de4265..5a2d2322 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -295,12 +295,12 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage) if (app->image) fz_droppixmap(app->image); if (app->grayscale) - colorspace = pdf_devicegray; + colorspace = fz_devicegray; else #ifdef _WIN32 - colorspace = pdf_devicebgr; + colorspace = fz_devicebgr; #else - colorspace = pdf_devicergb; + colorspace = fz_devicergb; #endif app->image = fz_newpixmapwithrect(colorspace, bbox); fz_clearpixmap(app->image, 0xFF); diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c index f0601570..e0003246 100644 --- a/apps/pdfdraw.c +++ b/apps/pdfdraw.c @@ -292,13 +292,13 @@ int main(int argc, char **argv) glyphcache = fz_newglyphcache(); - colorspace = pdf_devicergb; + colorspace = fz_devicergb; if (grayscale) - colorspace = pdf_devicegray; + colorspace = fz_devicegray; if (output && strstr(output, ".pgm")) - colorspace = pdf_devicegray; + colorspace = fz_devicegray; if (output && strstr(output, ".ppm")) - colorspace = pdf_devicergb; + colorspace = fz_devicergb; timing.count = 0; timing.total = 0; diff --git a/apps/pdfextract.c b/apps/pdfextract.c index 1271d95a..7598fcd6 100644 --- a/apps/pdfextract.c +++ b/apps/pdfextract.c @@ -54,10 +54,10 @@ static void saveimage(int num) pix = pdf_loadtile(img); - if (dorgb && img->colorspace && img->colorspace != pdf_devicergb) + if (dorgb && img->colorspace && img->colorspace != fz_devicergb) { fz_pixmap *temp; - temp = fz_newpixmap(pdf_devicergb, pix->x, pix->y, pix->w, pix->h); + temp = fz_newpixmap(fz_devicergb, pix->x, pix->y, pix->w, pix->h); fz_convertpixmap(pix, temp); fz_droppixmap(pix); pix = temp; diff --git a/draw/meshdraw.c b/draw/meshdraw.c index f1c5ccc2..08411e6b 100644 --- a/draw/meshdraw.c +++ b/draw/meshdraw.c @@ -328,7 +328,7 @@ fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox) if (shade->usefunction) { - temp = fz_newpixmapwithrect(pdf_devicegray, bbox); + temp = fz_newpixmapwithrect(fz_devicegray, bbox); fz_clearpixmap(temp, 0); ntris = shade->meshlen / 9; } diff --git a/fitz/dev_draw.c b/fitz/dev_draw.c index 0e7e8138..3c94c5c3 100644 --- a/fitz/dev_draw.c +++ b/fitz/dev_draw.c @@ -833,7 +833,7 @@ fz_drawbeginmask(void *user, fz_rect rect, int luminosity, fz_colorspace *colors bbox = fz_roundrect(rect); bbox = fz_intersectbbox(bbox, dev->scissor); - dest = fz_newpixmapwithrect(pdf_devicegray, bbox); + dest = fz_newpixmapwithrect(fz_devicegray, bbox); if (luminosity) fz_clearpixmap(dest, 255); diff --git a/fitz/fitz.h b/fitz/fitz.h index 215b9437..3a6087e6 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -714,10 +714,10 @@ fz_error fz_writepng(fz_pixmap *pixmap, char *filename, int savealpha); * Colorspace resources. */ -extern fz_colorspace *pdf_devicegray; -extern fz_colorspace *pdf_devicergb; -extern fz_colorspace *pdf_devicebgr; -extern fz_colorspace *pdf_devicecmyk; +extern fz_colorspace *fz_devicegray; +extern fz_colorspace *fz_devicergb; +extern fz_colorspace *fz_devicebgr; +extern fz_colorspace *fz_devicecmyk; struct fz_colorspace_s { diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c index 3e8660ab..3d94fdce 100644 --- a/fitz/res_colorspace.c +++ b/fitz/res_colorspace.c @@ -108,10 +108,10 @@ static fz_colorspace kdevicergb = { -1, "DeviceRGB", 3, rgbtoxyz, xyztorgb }; static fz_colorspace kdevicebgr = { -1, "DeviceRGB", 3, bgrtoxyz, xyztobgr }; static fz_colorspace kdevicecmyk = { -1, "DeviceCMYK", 4, cmyktoxyz, xyztocmyk }; -fz_colorspace *pdf_devicegray = &kdevicegray; -fz_colorspace *pdf_devicergb = &kdevicergb; -fz_colorspace *pdf_devicebgr = &kdevicebgr; -fz_colorspace *pdf_devicecmyk = &kdevicecmyk; +fz_colorspace *fz_devicegray = &kdevicegray; +fz_colorspace *fz_devicergb = &kdevicergb; +fz_colorspace *fz_devicebgr = &kdevicebgr; +fz_colorspace *fz_devicecmyk = &kdevicecmyk; /* * Pixmap color conversions @@ -327,35 +327,35 @@ fz_convertpixmap(fz_pixmap *sp, fz_pixmap *dp) assert(ss && ds); - if (ss == pdf_devicegray) + if (ss == fz_devicegray) { - if (ds == pdf_devicergb) fastgraytorgb(sp, dp); - else if (ds == pdf_devicebgr) fastgraytorgb(sp, dp); /* bgr == rgb here */ - else if (ds == pdf_devicecmyk) fastgraytocmyk(sp, dp); + if (ds == fz_devicergb) fastgraytorgb(sp, dp); + else if (ds == fz_devicebgr) fastgraytorgb(sp, dp); /* bgr == rgb here */ + else if (ds == fz_devicecmyk) fastgraytocmyk(sp, dp); else fz_stdconvpixmap(sp, dp); } - else if (ss == pdf_devicergb) + else if (ss == fz_devicergb) { - if (ds == pdf_devicegray) fastrgbtogray(sp, dp); - else if (ds == pdf_devicebgr) fastrgbtobgr(sp, dp); - else if (ds == pdf_devicecmyk) fastrgbtocmyk(sp, dp); + if (ds == fz_devicegray) fastrgbtogray(sp, dp); + else if (ds == fz_devicebgr) fastrgbtobgr(sp, dp); + else if (ds == fz_devicecmyk) fastrgbtocmyk(sp, dp); else fz_stdconvpixmap(sp, dp); } - else if (ss == pdf_devicebgr) + else if (ss == fz_devicebgr) { - if (ds == pdf_devicegray) fastbgrtogray(sp, dp); - else if (ds == pdf_devicergb) fastrgbtobgr(sp, dp); /* bgr = rgb here */ - else if (ds == pdf_devicecmyk) fastbgrtocmyk(sp, dp); + if (ds == fz_devicegray) fastbgrtogray(sp, dp); + else if (ds == fz_devicergb) fastrgbtobgr(sp, dp); /* bgr = rgb here */ + else if (ds == fz_devicecmyk) fastbgrtocmyk(sp, dp); else fz_stdconvpixmap(sp, dp); } - else if (ss == pdf_devicecmyk) + else if (ss == fz_devicecmyk) { - if (ds == pdf_devicegray) fastcmyktogray(sp, dp); - else if (ds == pdf_devicebgr) fastcmyktobgr(sp, dp); - else if (ds == pdf_devicergb) fastcmyktorgb(sp, dp); + if (ds == fz_devicegray) fastcmyktogray(sp, dp); + else if (ds == fz_devicebgr) fastcmyktobgr(sp, dp); + else if (ds == fz_devicergb) fastcmyktorgb(sp, dp); else fz_stdconvpixmap(sp, dp); } @@ -390,15 +390,15 @@ fz_stdconvcolor(fz_colorspace *srcs, float *srcv, fz_colorspace *dsts, float *ds void fz_convertcolor(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv) { - if (ss == pdf_devicegray) + if (ss == fz_devicegray) { - if ((ds == pdf_devicergb) || (ds == pdf_devicebgr)) + if ((ds == fz_devicergb) || (ds == fz_devicebgr)) { dv[0] = sv[0]; dv[1] = sv[0]; dv[2] = sv[0]; } - else if (ds == pdf_devicecmyk) + else if (ds == fz_devicecmyk) { dv[0] = 0; dv[1] = 0; @@ -409,19 +409,19 @@ fz_convertcolor(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv) fz_stdconvcolor(ss, sv, ds, dv); } - else if (ss == pdf_devicergb) + else if (ss == fz_devicergb) { - if (ds == pdf_devicegray) + if (ds == fz_devicegray) { dv[0] = sv[0] * 0.3f + sv[1] * 0.59f + sv[2] * 0.11f; } - else if (ds == pdf_devicebgr) + else if (ds == fz_devicebgr) { dv[0] = sv[2]; dv[1] = sv[1]; dv[2] = sv[0]; } - else if (ds == pdf_devicecmyk) + else if (ds == fz_devicecmyk) { float c = 1 - sv[0]; float m = 1 - sv[1]; @@ -436,19 +436,19 @@ fz_convertcolor(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv) fz_stdconvcolor(ss, sv, ds, dv); } - else if (ss == pdf_devicebgr) + else if (ss == fz_devicebgr) { - if (ds == pdf_devicegray) + if (ds == fz_devicegray) { dv[0] = sv[0] * 0.11f + sv[1] * 0.59f + sv[2] * 0.3f; } - else if (ds == pdf_devicebgr) + else if (ds == fz_devicebgr) { dv[0] = sv[2]; dv[1] = sv[1]; dv[2] = sv[0]; } - else if (ds == pdf_devicecmyk) + else if (ds == fz_devicecmyk) { float c = 1 - sv[2]; float m = 1 - sv[1]; @@ -463,22 +463,22 @@ fz_convertcolor(fz_colorspace *ss, float *sv, fz_colorspace *ds, float *dv) fz_stdconvcolor(ss, sv, ds, dv); } - else if (ss == pdf_devicecmyk) + else if (ss == fz_devicecmyk) { - if (ds == pdf_devicegray) + if (ds == fz_devicegray) { float c = sv[1] * 0.3f; float m = sv[2] * 0.59f; float y = sv[2] * 0.11f; dv[0] = 1 - MIN(c + m + y + sv[3], 1); } - else if (ds == pdf_devicergb) + else if (ds == fz_devicergb) { dv[0] = 1 - MIN(sv[0] + sv[3], 1); dv[1] = 1 - MIN(sv[1] + sv[3], 1); dv[2] = 1 - MIN(sv[2] + sv[3], 1); } - else if (ds == pdf_devicebgr) + else if (ds == fz_devicebgr) { dv[0] = 1 - MIN(sv[2] + sv[3], 1); dv[1] = 1 - MIN(sv[1] + sv[3], 1); diff --git a/mupdf/pdf_build.c b/mupdf/pdf_build.c index 63360841..4ed8f19c 100644 --- a/mupdf/pdf_build.c +++ b/mupdf/pdf_build.c @@ -16,14 +16,14 @@ pdf_initgstate(pdf_gstate *gs, fz_matrix ctm) memset(gs->strokestate.dashlist, 0, sizeof(gs->strokestate.dashlist)); gs->stroke.kind = PDF_MCOLOR; - gs->stroke.cs = fz_keepcolorspace(pdf_devicegray); + gs->stroke.cs = fz_keepcolorspace(fz_devicegray); gs->stroke.v[0] = 0; gs->stroke.pattern = nil; gs->stroke.shade = nil; gs->stroke.alpha = 1; gs->fill.kind = PDF_MCOLOR; - gs->fill.cs = fz_keepcolorspace(pdf_devicegray); + gs->fill.cs = fz_keepcolorspace(fz_devicegray); gs->fill.v[0] = 0; gs->fill.pattern = nil; gs->fill.shade = nil; diff --git a/mupdf/pdf_colorspace.c b/mupdf/pdf_colorspace.c index 900ab366..08405de4 100644 --- a/mupdf/pdf_colorspace.c +++ b/mupdf/pdf_colorspace.c @@ -16,9 +16,9 @@ loadiccbased(fz_colorspace **csp, pdf_xref *xref, fz_obj *dict) switch (n) { - case 1: *csp = pdf_devicegray; return fz_okay; - case 3: *csp = pdf_devicergb; return fz_okay; - case 4: *csp = pdf_devicecmyk; return fz_okay; + case 1: *csp = fz_devicegray; return fz_okay; + case 3: *csp = fz_devicergb; return fz_okay; + case 4: *csp = fz_devicecmyk; return fz_okay; } return fz_throw("syntaxerror: ICCBased must have 1, 3 or 4 components"); @@ -78,7 +78,7 @@ xyztolab(fz_colorspace *cs, float *xyz, float *lab) } static fz_colorspace kdevicelab = { -1, "Lab", 3, labtoxyz, xyztolab }; -static fz_colorspace *pdf_devicelab = &kdevicelab; +static fz_colorspace *fz_devicelab = &kdevicelab; /* * Separation and DeviceN @@ -323,19 +323,19 @@ pdf_loadcolorspaceimp(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj) if (fz_isname(obj)) { if (!strcmp(fz_toname(obj), "Pattern")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(obj), "G")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(obj), "RGB")) - *csp = pdf_devicergb; + *csp = fz_devicergb; else if (!strcmp(fz_toname(obj), "CMYK")) - *csp = pdf_devicecmyk; + *csp = fz_devicecmyk; else if (!strcmp(fz_toname(obj), "DeviceGray")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(obj), "DeviceRGB")) - *csp = pdf_devicergb; + *csp = fz_devicergb; else if (!strcmp(fz_toname(obj), "DeviceCMYK")) - *csp = pdf_devicecmyk; + *csp = fz_devicecmyk; else return fz_throw("unknown colorspace: %s", fz_toname(obj)); return fz_okay; @@ -355,7 +355,7 @@ pdf_loadcolorspaceimp(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj) obj = fz_arrayget(obj, 1); if (!obj) { - *csp = pdf_devicegray; + *csp = fz_devicegray; return fz_okay; } @@ -365,25 +365,25 @@ pdf_loadcolorspaceimp(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj) } else if (!strcmp(fz_toname(name), "G")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(name), "RGB")) - *csp = pdf_devicergb; + *csp = fz_devicergb; else if (!strcmp(fz_toname(name), "CMYK")) - *csp = pdf_devicecmyk; + *csp = fz_devicecmyk; else if (!strcmp(fz_toname(name), "DeviceGray")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(name), "DeviceRGB")) - *csp = pdf_devicergb; + *csp = fz_devicergb; else if (!strcmp(fz_toname(name), "DeviceCMYK")) - *csp = pdf_devicecmyk; + *csp = fz_devicecmyk; else if (!strcmp(fz_toname(name), "CalGray")) - *csp = pdf_devicegray; + *csp = fz_devicegray; else if (!strcmp(fz_toname(name), "CalRGB")) - *csp = pdf_devicergb; + *csp = fz_devicergb; else if (!strcmp(fz_toname(name), "CalCMYK")) - *csp = pdf_devicecmyk; + *csp = fz_devicecmyk; else if (!strcmp(fz_toname(name), "Lab")) - *csp = pdf_devicelab; + *csp = fz_devicelab; else if (!strcmp(fz_toname(name), "ICCBased")) return loadiccbased(csp, xref, fz_arrayget(obj, 1)); diff --git a/mupdf/pdf_interpret.c b/mupdf/pdf_interpret.c index 6d4053be..bc4fd66b 100644 --- a/mupdf/pdf_interpret.c +++ b/mupdf/pdf_interpret.c @@ -480,11 +480,11 @@ Lsetcolorspace: else { if (!strcmp(fz_toname(obj), "DeviceGray")) - cs = fz_keepcolorspace(pdf_devicegray); + cs = fz_keepcolorspace(fz_devicegray); else if (!strcmp(fz_toname(obj), "DeviceRGB")) - cs = fz_keepcolorspace(pdf_devicergb); + cs = fz_keepcolorspace(fz_devicergb); else if (!strcmp(fz_toname(obj), "DeviceCMYK")) - cs = fz_keepcolorspace(pdf_devicecmyk); + cs = fz_keepcolorspace(fz_devicecmyk); else { fz_obj *dict = fz_dictgets(rdb, "ColorSpace"); @@ -635,7 +635,7 @@ Lsetcolorspace: goto syntaxerror; v[0] = fz_toreal(csi->stack[0]); - pdf_setcolorspace(csi, PDF_MSTROKE, pdf_devicegray); + pdf_setcolorspace(csi, PDF_MSTROKE, fz_devicegray); pdf_setcolor(csi, PDF_MSTROKE, v); break; @@ -658,7 +658,7 @@ Lsetcolorspace: v[2] = fz_toreal(csi->stack[2]); v[3] = fz_toreal(csi->stack[3]); - pdf_setcolorspace(csi, PDF_MSTROKE, pdf_devicecmyk); + pdf_setcolorspace(csi, PDF_MSTROKE, fz_devicecmyk); pdf_setcolor(csi, PDF_MSTROKE, v); break; @@ -699,7 +699,7 @@ Lsetcolorspace: v[1] = fz_toreal(csi->stack[1]); v[2] = fz_toreal(csi->stack[2]); - pdf_setcolorspace(csi, PDF_MSTROKE, pdf_devicergb); + pdf_setcolorspace(csi, PDF_MSTROKE, fz_devicergb); pdf_setcolor(csi, PDF_MSTROKE, v); break; @@ -1080,7 +1080,7 @@ Lsetcolor: goto syntaxerror; v[0] = fz_toreal(csi->stack[0]); - pdf_setcolorspace(csi, PDF_MFILL, pdf_devicegray); + pdf_setcolorspace(csi, PDF_MFILL, fz_devicegray); pdf_setcolor(csi, PDF_MFILL, v); break; case 's': @@ -1146,7 +1146,7 @@ Lsetcolor: v[2] = fz_toreal(csi->stack[2]); v[3] = fz_toreal(csi->stack[3]); - pdf_setcolorspace(csi, PDF_MFILL, pdf_devicecmyk); + pdf_setcolorspace(csi, PDF_MFILL, fz_devicecmyk); pdf_setcolor(csi, PDF_MFILL, v); break; @@ -1222,7 +1222,7 @@ Lsetcolor: v[1] = fz_toreal(csi->stack[1]); v[2] = fz_toreal(csi->stack[2]); - pdf_setcolorspace(csi, PDF_MFILL, pdf_devicergb); + pdf_setcolorspace(csi, PDF_MFILL, fz_devicergb); pdf_setcolor(csi, PDF_MFILL, v); break; default: |