]> git.wh0rd.org - ICEs.git/blob - sh-ghostscript/gdevifno.i.1
add bfin ice
[ICEs.git] / sh-ghostscript / gdevifno.i.1
1 typedef struct gs_memory_struct_type_s gs_memory_struct_type_t;
2 typedef struct gs_matrix_s gs_matrix;
3 typedef unsigned long long gx_color_index_data;
4 typedef gx_color_index_data gx_color_index;
5 typedef unsigned short gx_color_value;
6 typedef struct gx_device_s gx_device;
7 typedef struct gs_param_list_s gs_param_list;
8 typedef struct gx_device_anti_alias_info_s
9 {
10 int text_bits;
11 int graphics_bits;
12 }
13 gx_device_anti_alias_info;
14 typedef enum
15 {
16 GX_CINFO_UNKNOWN_SEP_LIN = -1, GX_CINFO_SEP_LIN_NONE = 0, GX_CINFO_SEP_LIN
17 }
18 gx_color_enc_sep_lin_t;
19 typedef struct gx_device_color_info_s
20 {
21 int max_components;
22 gx_device_anti_alias_info anti_alias;
23 gx_color_enc_sep_lin_t separable_and_linear;
24 unsigned char comp_shift[(8 * 8)];
25 unsigned char comp_bits[(8 * 8)];
26 int black_component;
27 }
28 gx_device_color_info;
29 typedef struct gx_device_procs_s gx_device_procs;
30 typedef struct gs_devn_params_s gs_devn_params;
31 struct gx_device_procs_s
32 {
33 int (*open_device) (gx_device * dev);
34 void (*get_initial_matrix) (gx_device * dev, gs_matrix * pmat);
35 int (*sync_output) (gx_device * dev);
36 int (*output_page) (gx_device * dev, int num_copies, int flush);
37 int (*close_device) (gx_device * dev);
38 gx_color_index (*map_rgb_color) (gx_device * dev,
39 const gx_color_value cv[]);
40 int (*map_color_rgb) (gx_device * dev, gx_color_index color,
41 gx_color_value rgb[3]);
42 gs_devn_params *(*ret_devn_params) (gx_device * dev);
43 };
44 gx_device *gx_page_device_get_page_device (gx_device * dev);
45 typedef struct gx_device_printer_s gx_device_printer;
46 struct gx_device_printer_s
47 {
48 };
49 extern const gs_memory_struct_type_t st_device_printer;
50 int gdev_prn_output_page (gx_device * dev, int num_copies, int flush);
51 int gdev_prn_get_params (gx_device * dev, gs_param_list * plist);
52 int gdev_prn_put_params (gx_device * dev, gs_param_list * plist);
53 static gx_color_index inferno_rgb2cmap (gx_device * dev,
54 const gx_color_value cv[]);
55 static int inferno_cmap2rgb (gx_device * dev, gx_color_index color,
56 gx_color_value rgb[3]);
57 static int inferno_open (gx_device * dev);
58 static int inferno_close (gx_device * dev);
59 typedef struct inferno_device_s
60 {
61 int retained;
62 int is_open;
63 gx_device_color_info color_info;
64 gx_device_procs orig_procs;
65 int ldepth;
66 int cmapcall;
67 int nbits;
68 }
69 inferno_device;
70 static const gx_device_procs inferno_procs = {
71 inferno_open, ((void *) 0), ((void *) 0), gdev_prn_output_page,
72 inferno_close, inferno_rgb2cmap, inferno_cmap2rgb, ((void *) 0),
73 ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
74 gdev_prn_get_params, gdev_prn_put_params, ((void *) 0), ((void *) 0),
75 ((void *) 0), ((void *) 0), gx_page_device_get_page_device, ((void *) 0),
76 ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
77 ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
78 ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
79 ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
80 ((void *) 0), ((void *) 0), ((void *) 0)
81 };
82 inferno_device gs_inferno_device = {
83 sizeof (gx_device_printer), &inferno_procs, "inferno", 0,
84 &st_device_printer, 0, 0, {
85 0}
86 };
87 static gx_color_index
88 inferno_rgb2cmap (gx_device * dev, const gx_color_value cv[])
89 {
90 inferno_device *bdev = (inferno_device *) dev;
91 int nbits = bdev->nbits;
92 int mask = (1 << nbits) - 1;
93 gx_color_value red, green, blue;
94 if (red == green && green == blue && red != 0 && red != mask)
95 {
96 }
97 else
98 bdev->ldepth = 3;
99 bdev->cmapcall = 1;
100 return ((((blue << 4) | green) << 4) | red);
101 }