summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/jstest_main.c1
-rw-r--r--apps/pdfapp.c11
-rw-r--r--apps/pdfapp.h1
3 files changed, 8 insertions, 5 deletions
diff --git a/apps/jstest_main.c b/apps/jstest_main.c
index ed884a9a..6dbc3927 100644
--- a/apps/jstest_main.c
+++ b/apps/jstest_main.c
@@ -229,6 +229,7 @@ main(int argc, char *argv[])
pdfapp_init(ctx, &gapp);
gapp.scrw = 640;
gapp.scrh = 480;
+ gapp.colorspace = fz_device_rgb;
fz_try(ctx)
{
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index f8d5ccff..d3d5d7a9 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -82,6 +82,11 @@ void pdfapp_init(fz_context *ctx, pdfapp_t *app)
app->scrh = 480;
app->resolution = 72;
app->ctx = ctx;
+#ifdef _WIN32
+ app->colorspace = fz_device_bgr;
+#else
+ app->colorspace = fz_device_rgb;
+#endif
}
void pdfapp_invert(pdfapp_t *app, fz_bbox rect)
@@ -359,11 +364,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai
if (app->grayscale)
colorspace = fz_device_gray;
else
-#ifdef _WIN32
- colorspace = fz_device_bgr;
-#else
- colorspace = fz_device_rgb;
-#endif
+ colorspace = app->colorspace;
app->image = fz_new_pixmap_with_bbox(app->ctx, colorspace, bbox);
fz_clear_pixmap_with_value(app->ctx, app->image, 255);
idev = fz_new_draw_device(app->ctx, app->image);
diff --git a/apps/pdfapp.h b/apps/pdfapp.h
index 75030c19..8b753483 100644
--- a/apps/pdfapp.h
+++ b/apps/pdfapp.h
@@ -47,6 +47,7 @@ struct pdfapp_s
int rotate;
fz_pixmap *image;
int grayscale;
+ fz_colorspace *colorspace;
int invert;
/* current page params */