static int bbox_begin_typed_image(gx_device * dev, const gs_imager_state * pis, const gs_matrix * pmat, const gs_image_common_t * pic, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * memory, gx_image_enum_common_t ** pinfo) { bbox_image_enum *pbe; int code = bbox_image_begin(pis, pmat, pic, prect, pcpath, memory, &pbe); if (code < 0) return code; /* * If there is no target, we still have to call default_begin_image * to get the correct num_planes and plane_depths. */ { gx_device_bbox *const bdev = (gx_device_bbox *) dev; gx_device *tdev = bdev->target; dev_proc_begin_typed_image((*begin_typed_image)); byte wanted[GS_IMAGE_MAX_COMPONENTS]; if (tdev == 0) { tdev = dev; begin_typed_image = gx_default_begin_typed_image; } else { begin_typed_image = dev_proc(tdev, begin_typed_image); } code = (*begin_typed_image) (tdev, pis, pmat, pic, prect, pdcolor, pcpath, memory, &pbe->target_info); if (code) { bbox_image_end_image((gx_image_enum_common_t *)pbe, false); return code; } /* * We fill in num_planes and plane_depths later. format is * irrelevant. NOTE: we assume that if begin_typed_image returned * 0, the image is a data image. */ code = gx_image_enum_common_init((gx_image_enum_common_t *) pbe, (const gs_data_image_t *)pic, &bbox_image_enum_procs, dev, 0, gs_image_format_chunky); if (code < 0) return code; bbox_image_copy_target_info(pbe); pbe->params_are_const = gx_image_planes_wanted(pbe->target_info, wanted); } *pinfo = (gx_image_enum_common_t *) pbe; return 0; }
int gx_forward_begin_typed_image(gx_device * dev, const gs_imager_state * pis, const gs_matrix * pmat, const gs_image_common_t * pim, const gs_int_rect * prect, const gx_drawing_color * pdcolor, const gx_clip_path * pcpath, gs_memory_t * memory, gx_image_enum_common_t ** pinfo) { gx_device_forward * const fdev = (gx_device_forward *)dev; gx_device *tdev = fdev->target; dev_proc_begin_typed_image((*proc)) = (tdev == 0 ? (tdev = dev, gx_default_begin_typed_image) : dev_proc(tdev, begin_typed_image)); return proc(tdev, pis, pmat, pim, prect, pdcolor, pcpath, memory, pinfo); }