Fix (device interface) : Provide an access to image data filter for devices.
"Igor V. Melichev" <[email protected]> Mon, 29 Dec 2008 15:00:10 +0300
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_00CD_01C969C6.255AF990
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
Fix (device interface) : Provide an access to image data filter for devices.
DETAILS :
This is a preparation for the bug 690199
"File generates very large clist, crashes at 200 dpi"
The scheduled fix is to compress image data in clist.
For doing that the clist writer needs to know
whether the image should be packed with
a DCT, Flate or JBig2 filter.
The patch adds the new field gx_image_enum_common_s::plane_stream
that devices can access in the image_plane_data method can know
what filter was used to pack source data.
Rather it extends the device interface,
the change is backward compatible for devices.
Interpreters should call the new function
gs_image_set_plane_stream, otherwise the new
functionality is not provided.
See new comment in gxiparam.h for more details.
EXPECTED DIFFERENCES :
None.
------=_NextPart_000_00CD_01C969C6.255AF990
Content-Type: text/plain; format=flowed; name="patch.txt"; reply-type=original
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="patch.txt"
[Log message beg]
Fix (device interface) : Provide an access to image data filter for =
devices.
DETAILS :
This is a preparation for the bug 690199=20
"File generates very large clist, crashes at 200 dpi"=20
The scheduled fix is to compress image data in clist.
For doing that the clist writer needs to know
whether the image should be packed with=20
a DCT, Flate or JBig2 filter.=20
The patch adds the new field gx_image_enum_common_s::plane_stream
that devices can access in the image_plane_data method can know
what filter was used to pack source data. =20
Rather it extends the device interface,
the change is backward compatible for devices.
Interpreters should call the new function
gs_image_set_plane_stream, otherwise the new
functionality is not provided.
See new comment in gxiparam.h for more details.
=20
EXPECTED DIFFERENCES :
None.
[Log message end]=20
=20
=20
=20
=20
=20
*** F:\SVN-GS\gs\gs\base\gdevddrw.c Sat Dec 13 23:05:40 2008
--- files\gs\base\gdevddrw.c Mon Dec 29 14:27:40 2008
***************
*** 839,843 ****
static=20
ENUM_PTRS_WITH(image_enum_common_enum_ptrs, gx_image_enum_common_t =
*eptr)
! return 0;
case 0: return ENUM_OBJ(gx_device_enum_ptr(eptr->dev));
ENUM_PTRS_END
--- 839,844 ----
static=20
ENUM_PTRS_WITH(image_enum_common_enum_ptrs, gx_image_enum_common_t =
*eptr)
! if (index <=3D eptr->num_planes)
! return ENUM_OBJ(eptr->plane_stream[index - 1]);
case 0: return ENUM_OBJ(gx_device_enum_ptr(eptr->dev));
ENUM_PTRS_END
***************
*** 845,849 ****
--- 846,854 ----
static RELOC_PTRS_WITH(image_enum_common_reloc_ptrs, =
gx_image_enum_common_t *eptr)
{
+ int i;
+=20
eptr->dev =3D gx_device_reloc_ptr(eptr->dev, gcst);
+ for (i =3D 0; i < eptr->num_planes; i++)
+ RELOC_OBJ(eptr->plane_stream[i]);
}
RELOC_PTRS_END
=20
=20
=20
*** F:\SVN-GS\gs\gs\base\gsimage.c Tue Dec 9 11:02:32 2008
--- files\gs\base\gsimage.c Mon Dec 29 14:38:46 2008
***************
*** 670,671 ****
--- 670,676 ----
}
=20
+ /* Set plane_stream[i] */
+ void gs_image_set_plane_stream(gs_image_enum *pie, int i, stream *s)
+ {
+ pie->info->plane_stream[i] =3D s;
+ }
=20
=20
=20
*** F:\SVN-GS\gs\gs\base\gsimage.h Thu Sep 25 04:54:40 2008
--- files\gs\base\gsimage.h Mon Dec 29 14:33:36 2008
***************
*** 200,202 ****
--- 200,205 ----
int gs_image_cleanup_and_free_enum(gs_image_enum * penum, gs_state =
*pgs);
=20
+ /* Set plane_stream[i] */
+ void gs_image_set_plane_stream(gs_image_enum *pie, int i, stream *s);
+=20
#endif /* gsimage_INCLUDED */
=20
=20
=20
*** F:\SVN-GS\gs\gs\base\gximage.c Thu Sep 25 04:54:40 2008
--- files\gs\base\gximage.c Mon Dec 29 14:39:24 2008
***************
*** 105,110 ****
return_error(gs_error_rangecheck);
}
! for (i =3D 0; i < piec->num_planes; ++i)
piec->plane_widths[i] =3D pic->Width;
return 0;
}
--- 105,112 ----
return_error(gs_error_rangecheck);
}
! for (i =3D 0; i < piec->num_planes; ++i) {
piec->plane_widths[i] =3D pic->Width;
+ piec->plane_stream[i] =3D NULL;
+ }
return 0;
}
=20
=20
=20
*** F:\SVN-GS\gs\gs\base\gxiparam.h Thu Sep 25 04:54:50 2008
--- files\gs\base\gxiparam.h Mon Dec 29 14:33:00 2008
***************
*** 219,223 ****
int num_planes;\
int plane_depths[GS_IMAGE_MAX_COMPONENTS]; /* [num_planes] */\
! int plane_widths[GS_IMAGE_MAX_COMPONENTS] /* [num_planes] */
struct gx_image_enum_common_s {
gx_image_enum_common;
--- 219,229 ----
int num_planes;\
int plane_depths[GS_IMAGE_MAX_COMPONENTS]; /* [num_planes] */\
! int plane_widths[GS_IMAGE_MAX_COMPONENTS]; /* [num_planes] */\
! /* Rather plane_stream allows to access the data stream,
! this field is not intended for that,
! and we don't provide a consistency if a data is consumed through =
it.
! The only correct use is to retrieve the filter parameters
! for high level devices and for clist writer. */\
! stream *plane_stream[GS_IMAGE_MAX_COMPONENTS] /* [num_planes] */
struct gx_image_enum_common_s {
gx_image_enum_common;
=20
=20
=20
=20
=20
*** F:\SVN-GS\gs\gs\psi\zimage.c Thu Sep 25 04:49:08 2008
--- files\gs\psi\zimage.c Mon Dec 29 14:36:36 2008
***************
*** 505,508 ****
--- 505,509 ----
plane_data[px].data =3D sbufptr(s);
plane_data[px].size =3D avail;
+ gs_image_set_plane_stream(penum, px, s);
}
=20
=20
------=_NextPart_000_00CD_01C969C6.255AF990
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
------=_NextPart_000_00CD_01C969C6.255AF990--