gx_image4_sget(gs_image_common_t *pic, stream *s,
               gs_color_space *pcs)
{
    gs_image4_t *const pim = (gs_image4_t *)pic;
    int num_values;
    int i;
    int code = gx_pixel_image_sget((gs_pixel_image_t *)pim, s, pcs);

    if (code < 0)
        return code;
    pim->type = &gs_image_type_4;
    pim->MaskColor_is_range = code;
    num_values =
        gs_color_space_num_components(pcs) *
        (pim->MaskColor_is_range ? 2 : 1);
    for (i = 0; i < num_values; ++i) {
        code = sget_variable_uint(s, &pim->MaskColor[i]);
        if (code < 0)
            return code;
    }
    pim->image_parent_type = gs_image_type4;
    return 0;
}
gx_image4_sget(gs_image_common_t *pic, stream *s,
               gs_color_space *pcs)
{
    gs_image4_t *const pim = (gs_image4_t *)pic;
    int num_values;
    int i;
    int code = gx_pixel_image_sget((gs_pixel_image_t *)pim, s, pcs);

    if (code < 0)
        return code;
    pim->type = &gs_image_type_4;
    pim->MaskColor_is_range = code;
    num_values =
        gs_color_space_num_components(pcs) *
        (pim->MaskColor_is_range ? 2 : 1);
    for (i = 0; i < num_values; ++i) {
        code = sget_variable_uint(s, &pim->MaskColor[i]);
        if (code < 0)
            return code;
    }
    pim->image_parent_type = gs_image_type4;
    return 0;
}