]> git.wh0rd.org - ICEs.git/blobdiff - sh-ghostscript/gdevifno.i.1
more ices
[ICEs.git] / sh-ghostscript / gdevifno.i.1
diff --git a/sh-ghostscript/gdevifno.i.1 b/sh-ghostscript/gdevifno.i.1
new file mode 100644 (file)
index 0000000..b9f446f
--- /dev/null
@@ -0,0 +1,101 @@
+typedef struct gs_memory_struct_type_s gs_memory_struct_type_t;
+typedef struct gs_matrix_s gs_matrix;
+typedef unsigned long long gx_color_index_data;
+typedef gx_color_index_data gx_color_index;
+typedef unsigned short gx_color_value;
+typedef struct gx_device_s gx_device;
+typedef struct gs_param_list_s gs_param_list;
+typedef struct gx_device_anti_alias_info_s
+{
+  int text_bits;
+  int graphics_bits;
+}
+gx_device_anti_alias_info;
+typedef enum
+{
+  GX_CINFO_UNKNOWN_SEP_LIN = -1, GX_CINFO_SEP_LIN_NONE = 0, GX_CINFO_SEP_LIN
+}
+gx_color_enc_sep_lin_t;
+typedef struct gx_device_color_info_s
+{
+  int max_components;
+  gx_device_anti_alias_info anti_alias;
+  gx_color_enc_sep_lin_t separable_and_linear;
+  unsigned char comp_shift[(8 * 8)];
+  unsigned char comp_bits[(8 * 8)];
+  int black_component;
+}
+gx_device_color_info;
+typedef struct gx_device_procs_s gx_device_procs;
+typedef struct gs_devn_params_s gs_devn_params;
+struct gx_device_procs_s
+{
+  int (*open_device) (gx_device * dev);
+  void (*get_initial_matrix) (gx_device * dev, gs_matrix * pmat);
+  int (*sync_output) (gx_device * dev);
+  int (*output_page) (gx_device * dev, int num_copies, int flush);
+  int (*close_device) (gx_device * dev);
+    gx_color_index (*map_rgb_color) (gx_device * dev,
+                                    const gx_color_value cv[]);
+  int (*map_color_rgb) (gx_device * dev, gx_color_index color,
+                       gx_color_value rgb[3]);
+  gs_devn_params *(*ret_devn_params) (gx_device * dev);
+};
+gx_device *gx_page_device_get_page_device (gx_device * dev);
+typedef struct gx_device_printer_s gx_device_printer;
+struct gx_device_printer_s
+{
+};
+extern const gs_memory_struct_type_t st_device_printer;
+int gdev_prn_output_page (gx_device * dev, int num_copies, int flush);
+int gdev_prn_get_params (gx_device * dev, gs_param_list * plist);
+int gdev_prn_put_params (gx_device * dev, gs_param_list * plist);
+static gx_color_index inferno_rgb2cmap (gx_device * dev,
+                                       const gx_color_value cv[]);
+static int inferno_cmap2rgb (gx_device * dev, gx_color_index color,
+                            gx_color_value rgb[3]);
+static int inferno_open (gx_device * dev);
+static int inferno_close (gx_device * dev);
+typedef struct inferno_device_s
+{
+  int retained;
+  int is_open;
+  gx_device_color_info color_info;
+  gx_device_procs orig_procs;
+  int ldepth;
+  int cmapcall;
+  int nbits;
+}
+inferno_device;
+static const gx_device_procs inferno_procs = {
+  inferno_open, ((void *) 0), ((void *) 0), gdev_prn_output_page,
+    inferno_close, inferno_rgb2cmap, inferno_cmap2rgb, ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
+    gdev_prn_get_params, gdev_prn_put_params, ((void *) 0), ((void *) 0),
+    ((void *) 0), ((void *) 0), gx_page_device_get_page_device, ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0), ((void *) 0),
+    ((void *) 0), ((void *) 0), ((void *) 0)
+};
+inferno_device gs_inferno_device = {
+  sizeof (gx_device_printer), &inferno_procs, "inferno", 0,
+    &st_device_printer, 0, 0, {
+                              0}
+};
+static gx_color_index
+inferno_rgb2cmap (gx_device * dev, const gx_color_value cv[])
+{
+  inferno_device *bdev = (inferno_device *) dev;
+  int nbits = bdev->nbits;
+  int mask = (1 << nbits) - 1;
+  gx_color_value red, green, blue;
+  if (red == green && green == blue && red != 0 && red != mask)
+    {
+    }
+  else
+    bdev->ldepth = 3;
+  bdev->cmapcall = 1;
+  return ((((blue << 4) | green) << 4) | red);
+}