]> git.ipfire.org Git - thirdparty/cups.git/blob - pstoraster/gstypes.h
Import cups.org releases
[thirdparty/cups.git] / pstoraster / gstypes.h
1 /* Copyright (C) 1989, 1995 Aladdin Enterprises. All rights reserved.
2
3 This file is part of GNU Ghostscript.
4
5 GNU Ghostscript is distributed in the hope that it will be useful, but
6 WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
7 to anyone for the consequences of using it or for whether it serves any
8 particular purpose or works at all, unless he says so in writing. Refer
9 to the GNU General Public License for full details.
10
11 Everyone is granted permission to copy, modify and redistribute GNU
12 Ghostscript, but only under the conditions described in the GNU General
13 Public License. A copy of this license is supposed to have been given
14 to you along with GNU Ghostscript so you can know your rights and
15 responsibilities. It should be in a file named COPYING. Among other
16 things, the copyright notice and this notice must be preserved on all
17 copies.
18
19 Aladdin Enterprises supports the work of the GNU Project, but is not
20 affiliated with the Free Software Foundation or the GNU Project. GNU
21 Ghostscript, as distributed by Aladdin Enterprises, does not require any
22 GNU software to build or run it.
23 */
24
25 /*$Id$ */
26 /* Miscellaneous common types for Ghostscript library */
27
28 #ifndef gstypes_INCLUDED
29 # define gstypes_INCLUDED
30
31 /*
32 * Define a type used internally for unique IDs of various kinds
33 * (primarily, but not exclusively, character and halftone bitmaps).
34 * These IDs bear no relation to any other ID space; we generate them all
35 * ourselves.
36 */
37 typedef ulong gs_id;
38
39 #define gs_no_id 0L
40
41 /*
42 * Define a sensible representation of a string, as opposed to
43 * the C char * type (which can't store arbitrary data, represent
44 * substrings, or perform concatenation without destroying aliases).
45 */
46 typedef struct gs_string_s {
47 byte *data;
48 uint size;
49 } gs_string;
50 typedef struct gs_const_string_s {
51 const byte *data;
52 uint size;
53 } gs_const_string;
54
55 /*
56 * Define types for Cartesian points.
57 */
58 typedef struct gs_point_s {
59 double x, y;
60 } gs_point;
61 typedef struct gs_int_point_s {
62 int x, y;
63 } gs_int_point;
64
65 /*
66 * Define a scale for oversampling. Clients don't actually use this,
67 * but this seemed like the handiest place for it.
68 */
69 typedef struct gs_log2_scale_point_s {
70 int x, y;
71 } gs_log2_scale_point;
72
73 /*
74 * Define types for rectangles in the Cartesian plane.
75 * Note that rectangles are half-open, i.e.: their width is
76 * q.x-p.x and their height is q.y-p.y; they include the points
77 * (x,y) such that p.x<=x<q.x and p.y<=y<q.y.
78 */
79 typedef struct gs_rect_s {
80 gs_point p, q; /* origin point, corner point */
81 } gs_rect;
82 typedef struct gs_int_rect_s {
83 gs_int_point p, q;
84 } gs_int_rect;
85
86 #endif /* gstypes_INCLUDED */