}; /* * Example device with RGB and spot color support */ static const gx_device_procs spot_rgb_procs = device_procs(get_spotrgb_color_mapping_procs); const xcf_device gs_xcf_device = { prn_device_body_extended(xcf_device, spot_rgb_procs, "xcf", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, X_DPI, Y_DPI, /* X and Y hardware resolution */ 0, 0, 0, 0, /* margins */ GX_DEVICE_COLOR_MAX_COMPONENTS, 3, /* MaxComponents, NumComp */ GX_CINFO_POLARITY_ADDITIVE, /* Polarity */ 24, 0, /* Depth, Gray_index, */ 255, 255, 256, 256, /* MaxGray, MaxColor, DitherGray, DitherColor */ GX_CINFO_UNKNOWN_SEP_LIN, /* Let check_device_separable set up values */ "DeviceN", /* Process color model name */ xcf_print_page), /* Printer page print routine */ /* DeviceN device specific parameters */ XCF_DEVICE_RGB, /* Color model */ 8, /* Bits per color - must match ncomp, depth, etc. above */ (&DeviceRGBComponents), /* Names of color model colorants */ 3, /* Number colorants for RGB */ {0}, /* SeparationNames */ {0} /* SeparationOrder names */ }; static const gx_device_procs spot_cmyk_procs = device_procs(get_xcf_color_mapping_procs);
NULL, /* begin_transparency_mask */ NULL, /* end_transparency_mask */ NULL, /* discard_transparency_layer */ perm_get_color_mapping_procs, /* get_color_mapping_procs */ perm_get_color_comp_index, perm_encode_color, /* encode_color */ perm_decode_color /* decode_color */ }; const gx_device_perm_t gs_perm_device = { prn_device_body_extended(gx_device_perm_t, perm_procs, "permute", DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, 72, 72, 0, 0, 0, 0, GX_DEVICE_COLOR_MAX_COMPONENTS, 4, GX_CINFO_POLARITY_SUBTRACTIVE, 32, 0, 255, 255, 256, 256, GX_CINFO_SEP_LIN, "DeviceN", perm_print_page), NULL, 0, 0, 0 }; static int perm_print_page(gx_device_printer *pdev, FILE *pstream) { int y; gx_device_perm_t * const dev = (gx_device_perm_t *)pdev; int ncomp = dev->num_std_colorant_names; int raw_raster = pdev->width * ncomp; byte *raw_line;