summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-17 16:45:04 +0000
committerMichael Vrhel <michael.vrhel@artifex.com>2016-11-21 08:29:23 -0800
commitc9d8618934ebf682f72dd9b3ebef48b2be535a8d (patch)
tree89ef2c7bd7f34b6240022d5b344287ad70ac7446 /devices
parentb33ffc0e958b613cd6ba114d42720694b11219ff (diff)
downloadghostpdl-c9d8618934ebf682f72dd9b3ebef48b2be535a8d.tar.gz
Change API for put_image
Diffstat (limited to 'devices')
-rw-r--r--devices/gdevbit.c11
-rw-r--r--devices/gdevpng.c15
2 files changed, 10 insertions, 16 deletions
diff --git a/devices/gdevbit.c b/devices/gdevbit.c
index 5a4b17546..ecf1a596f 100644
--- a/devices/gdevbit.c
+++ b/devices/gdevbit.c
@@ -777,9 +777,9 @@ bittags_print_page(gx_device_printer * pdev, FILE * prn_stream)
}
static int
-bit_put_image(gx_device *pdev, const byte *buffer, int num_chan, int xstart,
+bit_put_image(gx_device *pdev, const byte **buffers, int num_chan, int xstart,
int ystart, int width, int height, int row_stride,
- int plane_stride, int alpha_plane_index, int tag_plane_index)
+ int alpha_plane_index, int tag_plane_index)
{
gx_device_memory *pmemdev = (gx_device_memory *)pdev;
byte *buffer_prn;
@@ -791,9 +791,6 @@ bit_put_image(gx_device *pdev, const byte *buffer, int num_chan, int xstart,
if (alpha_plane_index != 0)
return 0; /* we don't want alpha, return 0 to ask for the */
/* pdf14 device to do the alpha composition */
- /* Eventually, the pdf14 device might be chunky pixels, punt for now */
- if (plane_stride == 0)
- return 0;
if (num_chan != 3 || tag_plane_index <= 0)
return_error(gs_error_unknownerror); /* can't handle these cases */
/* Drill down to get the appropriate memory buffer pointer */
@@ -805,11 +802,11 @@ bit_put_image(gx_device *pdev, const byte *buffer, int num_chan, int xstart,
for ( x = xstart; x < xend; x++ ) {
/* Tag data first, then RGB */
buffer_prn[des_position] =
- buffer[src_position + tag_plane_index * plane_stride];
+ buffers[tag_plane_index][src_position];
des_position += 1;
for ( k = 0; k < 3; k++) {
buffer_prn[des_position] =
- buffer[src_position + k * plane_stride];
+ buffers[k][src_position];
des_position += 1;
}
src_position += 1;
diff --git a/devices/gdevpng.c b/devices/gdevpng.c
index 45b886c1d..1c203897d 100644
--- a/devices/gdevpng.c
+++ b/devices/gdevpng.c
@@ -845,9 +845,9 @@ pngalpha_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
/* Handle the RGBA planes from the PDF 1.4 compositor */
static int
-pngalpha_put_image (gx_device *pdev, const byte *buffer, int num_chan, int xstart,
+pngalpha_put_image (gx_device *pdev, const byte **buffers, int num_chan, int xstart,
int ystart, int width, int height, int row_stride,
- int plane_stride, int alpha_plane_index, int tag_plane_index)
+ int alpha_plane_index, int tag_plane_index)
{
gx_device_memory *pmemdev = (gx_device_memory *)pdev;
byte *buffer_prn;
@@ -856,9 +856,6 @@ pngalpha_put_image (gx_device *pdev, const byte *buffer, int num_chan, int xstar
int x, y;
int src_position, des_position;
- /* Eventually, the pdf14 device might be chunky pixels, punt for now */
- if (plane_stride == 0)
- return 0;
if (num_chan != 3 || alpha_plane_index <= 0)
return_error(gs_error_unknownerror); /* can't handle these cases */
@@ -873,11 +870,11 @@ pngalpha_put_image (gx_device *pdev, const byte *buffer, int num_chan, int xstar
src_position = (y - ystart) * row_stride;
des_position = y * pmemdev->raster + xstart * 4;
for ( x = xstart; x < xend; x++ ) {
- buffer_prn[des_position++] = buffer[src_position];
- buffer_prn[des_position++] = buffer[src_position + plane_stride];
- buffer_prn[des_position++] = buffer[src_position + 2 * plane_stride];
+ buffer_prn[des_position++] = buffers[0][src_position];
+ buffer_prn[des_position++] = buffers[1][src_position];
+ buffer_prn[des_position++] = buffers[2][src_position];
/* Alpha data in low bits. Note that Alpha is inverted. */
- buffer_prn[des_position++] = (255 - buffer[src_position + alpha_plane_index * plane_stride]);
+ buffer_prn[des_position++] = (255 - buffers[alpha_plane_index][src_position]);
src_position += 1;
}
}