/* Start processing an ImageType 1 image. */ int gs_image_init(gs_image_enum * penum, const gs_image_t * pim, bool multi, gs_state * pgs) { gs_image_t image; gx_image_enum_common_t *pie; int code; image = *pim; if (image.ImageMask) { image.ColorSpace = NULL; if (pgs->in_cachedevice <= 1) image.adjust = false; } else { if (pgs->in_cachedevice) return_error(gs_error_undefined); if (image.ColorSpace == NULL) { /* * Use of a non-current color space is potentially * incorrect, but it appears this case doesn't arise. */ image.ColorSpace = gs_cspace_new_DeviceGray(pgs->memory); } } code = gs_image_begin_typed((const gs_image_common_t *)&image, pgs, image.ImageMask | image.CombineWithColor, &pie); if (code < 0) return code; return gs_image_enum_init(penum, pie, (const gs_data_image_t *)&image, pgs); }
/* * Process an image that has no explicit source data. This isn't used by * standard Level 2, but it's a very small procedure and is needed by * both zdps.c and zdpnext.c. */ int process_non_source_image(i_ctx_t *i_ctx_p, const gs_image_common_t * pic, client_name_t cname) { gx_image_enum_common_t *pie; int code = gs_image_begin_typed(pic, igs, false /****** WRONG ******/ , &pie); /* We didn't pass any data, so there's nothing to clean up. */ return code; }
/* Common setup for all Level 1 and 2 images, and ImageType 4 images. */ int zimage_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim, const ref * sources, bool uses_color, int npop) { gx_image_enum_common_t *pie; int code = gs_image_begin_typed((const gs_image_common_t *)pim, igs, uses_color, &pie); if (code < 0) return code; return zimage_data_setup(i_ctx_p, (const gs_pixel_image_t *)pim, pie, sources, npop); }