1、INCITS/ISO/IEC 9593-4-1 991/ I AMI-1994 (R1999) (formerly ANSI/ISO/IEC 9593-4-1 991/ AM 1 - 1 994 (R1999) for Information Technology - Computer Graphics - Programmer s Hierarchical Interactive Graphics System (PHIGS) Language Bindings - Part 4: C - Amendment 1 Developed by Where IT all begins Approv
2、al of an American National Standard requires review by ANSI that the requirements for due process, consensus, and other criteria for approval have been met by the standards developer. Consensus is established when, in the judgment of the ANSI Board of Standards Review, substantial agreement has been
3、 reached by directly and materially affected interests. Substantial agreement means much more than a simple majority, but not necessarily unanimity. Consensus requires that all views and objections be considered, and that a concerted effort be made toward their resolution. The use of American Nation
4、al Standards is completely voluntary; their existence does not in any respect preclude anyone, whether he has approved the standards or not, from manufacturing, marketing, purchasing, or using products, processes, or procedures not conforming to the standards. The American National Standards Institu
5、te does not develop standards and will in no circumstances give an interpretation of any American National Standard. Moreover, no person shall have the right or authority to issue an interpretation of an American National Standard in the name of the American National Standards Institute. Requests fo
6、r interpretations should be addressed to the secretariat or sponsor whose name appears on the title page of this standard. CAUTION NOTICE: This American National Standard may be revised or withdrawn at any time. The procedures of the American National Standards Institute require that action be taken
7、 periodically to reaffirm, revise, or withdraw this standard. Purchasers of American National Standards may receive current information on all standards by calling or writing the American National Standards Institute. American National Published by American National Standards Institute 11 West 42nd
8、Street, New York, New York 10036 Copyright O1 994 by Information Technology Industry Council (ITI) All rights reserved. These materials are subject to copyright claims of International Standardization Organization (ISO), International Electrotechnical Commission (IEC), American National Standards In
9、stitute (ANSI), and Information Technology Industry Council (ITI). Not for resale. No part of this publication may be reproduced in any form, including an electronic retrieval system, without the prior written permission of ITI. All requests pertaining to this standard should be submitted to ITI, 12
10、50 Eye Street NW, Washington, DC 20005. Printed in the United States of America ANSI/ISO/IEC 9593-4-1 991/AM 1-1 994 Amendment to ANSIIISO 9593-4-1 991 American National Standard for Information Technology - Compute r G ra ph ics - Programmers Hierarch cal I nte ract ive G rap h ics System (PHIGS) L
11、anguage Bindings - Part 4: C - Amendment 1 Secretariat Computer and Business Equipment Manufacturers Association Approved August 23, 1994 American National Standards Institute, Inc. Contents scope 1 Normative references . 2 The C language binding of PHIGS 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3
12、.11 3.12 3.13 Conformance . 3 Functions versus macros . 3 Character strings . 3 Function identifiers . 3 Registration . 3 Return values . 4 Header files . 4 Memory management . 4 3.9.1 inquiry functions which return simple lists 4 3.9.2 inquiry functions which return complex data structures 4 3.9.3
13、Meaning of the size of an element 4 Error handling . 5 3.11.1 Application defined error handlers . 5 3.1 1.2 Error codes 5 3.11.3 C specific PHIGS errors . 5 3.12.1 Storage of matrices . 5 3.12.2 Storage of colour arrays 6 Data type descriptions . 6 Identifiers for graphical items . 4 Inquiries retu
14、rning structure elements . 4 Storage of two-dimensional data . 5 Tables . 7 4.1 Abbreviation policy for construction of identifiers . 7 4.2 Table of abbreviations . 7 4.3 Function names . 8 4.3.1 List ordered alphabetically by bound name 8 4.3.2 List ordered alphabetically by PHIGS function name 10
15、Type definitions . 14 Macro definitions . 15 C PHIGS functions 16 C PHIGS PLUS type definitions 17 8.1 8.2 Modifications to PHIGS data types 18 8.3 Implementation dependent PHIGS PLUS type definitions . 23 8.4 Implementation independent PHIGS PLUS type definitions 33 Mapping of PHIGS PLUS data types
16、 17 U 9 10 A B C D E C PHIGS PLUS macro definitions 55 9.1 Function identifiers . 55 9.2 Error codes 56 9.3 Miscellaneous 59 9.3.1 9.3.2 9.3.3 9.3.4 9.3.5 9.3.6 9.3.7 9.3.8 9.3.9 9.3.10 9.3.11 9.3.12 9.3.13 Coiour mapping methods 59 Curve approximation criteria types 60 Data mapping methods . 60 Col
17、our types 59 Interior shading method 60 Light source types . 60 Parametric surface characteristic types . 60 Polyline shading method 61 Reflectance models . 61 Reflectance properties . 61 Rendering Colour Model 61 Element enumeration 61 Surface approximation criteria types 61 C PHIGS PLUS functions
18、62 10.1 10.2 Attribute specification functions . 68 10.2.1 Bundled amibute selection . 68 10.2.2 Individual attribute selection 69 10.2.3 Workstation attribute table definition . 75 10.3 Inquiry functions . 78 10.3.1 Inquiry functions for the workstation state list . 78 10.3.2 Inquiry functions for
19、the workstation description table 85 A.l Macro definitions 95 A.2 Types in compilation order 101 A.3 External functions . 125 Example programs . 144 B.l star . 144 B.2 iron 144 B.3 dyna-star . 144 B.4 show-line 144 B.5 xfomgline . 144 B.6 surface-trimmed 144 Macros for short function identifiers . 1
20、49 C.l Short function identifiers . 149 Memory management 152 D.l Introduction . 152 D.2 Functions that return simple lists 152 D.3 Functions that retum complex data structures 152 Function lists 153 E.l List of functions ordered alphabetically by function name . 153 E.2 List of functions ordered al
21、phabetically by bound name 155 Output primitive functions 62 Data types in compiiation order and external functions 95 Foreword (This foreword is not part of American National Standard ANSI/ISO/IEC 9593-4-1991/AM 1-1994. This document is identical to ISO/IEC 9593- 4:1991/Amd. 1:1994 and the followin
22、g three paragraphs are the original foreword as it appeared in that document.) IS0 (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of IS0 or IEC pa
23、rticipate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. IS0 and IEC technical commit- tees collaborate in fields of mutual interest. Other international organiza- tions, gove
24、rnmental and non-governmental, in liaison with IS0 and IEC, also take part in the work. In the field of information technology, IS0 and IEC have established a joint technical committee, ISO/IEC JTC 1. Draft International Standards adopt- ed by the joint technical committee are circulated to national
25、 bodies for voting. Publication as an International Standard requires approval by at least 75% of the national bodies casting a vote. Amendment 1 to International Standard ISO/IEC 9593-4991 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology. Requests for interpretation,
26、suggestions for improvement or addenda, or defect reports are welcome. They should be sent to the X3 Secretariat, Computer and Business Equipment Manufacturers Association, 1250 Eye Street, NW, Suite 200, Washington, DC 20005. This standard was processed and approved for submittal to ANSI by Accredi
27、ted Standards Committee on Information Technology, X3. Committee approval of the standard does not necessarily imply that all committee members voted for its approval. At the time it approved this standard, the X3 Committee had the following members: James D. Converse, Chair Donald C. Loughry, Vice-
28、Chair Joanne Flanagan, Secretary Organization Represented Name of Representative American Nuclear Society Geraldine C. Main Sally Hartzell (Alt.) AMP, Inc Edward Kelly Charles Brill (Alt.) Apple Computer, Inc. . Karen Higginbottom David K. Michael (Alt.) AT-ind SET REFLECTANCE MODEL pset-refl-model
29、SET REFLECTANCE PROPERTIES pset-reflqrops SET REFLECTANCE REPRESENTATION pset-refl-rep SET RENDERING COLOUR MODEL pset-rend-colr-model SET SURFACE APPROXIMATION CRITEIUA pset-surf-approx-crit SET TEXT COLOUR pset-text-colr SET TEXT REPRESENTATION PLUS pset-text-repqlus TRIANGLE SET WITH DATA ptri-se
30、t-data TRIANGLE SET 3 WITH DATA TRIANGLE STRIP WITH DATA ptri-strip-data TRIANGLE STRIP 3 WITH DATA C Name I SET POLYLINE REPRESENTATION PLUS pset-line-repqlus ptri-set3-data ptri-strip3-data 13 ISO/IEC 9593-4: 199UAmd.l: 1994(E) 5 Type definitions Change the clause heading to C PHIGS type definitio
31、ns. 14 ISO/IEC 6 Macro definitions Change the clause heading to C PHIGS macro definitions. ISOfiEC 9593-4: 199UAmd.l: 1994(E) 15 ISO/IEC 9593-4:1991/Amd.l: 1994(E) 7 C PHIGS functions Change the following function definitions INQUIRE GENERALIZED DRAWING PRIMITIVE 3 0 ISODEC void pinagdp3 ( Pint Pint
32、 Pint Pint Pattrs ws-type, /* workstation type gdP # /* GDP function identifier *err-ind, /* OUT error indicator *nunvat t r , /* OUT number of attributes used attr7 /* OUT list of attributes used INQUIRE GENERALIZED DRAWING PRIMITIVE void pinq-gdp ( Pint Pint Pint Pint Pattrs ws-type, /* workstatio
33、n type gdp 8 /* GDP function identifier * err-ind, /* OUT error indicator *num-at tr , /* OUT number of attributes used attr7 /* OUT list of attributes used */ */ */ */ */ */ */ */ */ */ 16 0 ISODEC - PHIGS PLUS data type C binding data type COLRV coiour value Pcolrv ISOAEC 9593-4:199l/Amd.l:1994(E)
34、 8 C PHIGS PLUS type definitions 8.1 Mapping of PHIGS PLUS data types ISO/IEC 95924 specifies a set of abmct data types beyond the types defined in ISO/EC 9592-1. Table 4 - gives the mapping from those additional data types defined in ISO/IEC 95924 to the data types defined huer in this binding. Tab
35、le 4 - Mapping of PHIGS PLUS data types to C 17 ISO/IEC 9593-4:1991/Amd.l:1994(E) 83 Modifications to PHIGS data types Paspect ASPECT typedef enum ( /* start of PHIGS enumerations */ /* end of PHIGS enumerations */ /* start of PHIGS PLUS enumerations */ PASPECT-LIIW-COLR, PASPECT-MARKER-COLR , PASPE
36、CT-TEXT-COLR, PASPECT-INT-COLR, PASPECT-EDGE-COLR, PASPECT-LINE-SHAD-METHOD, PASPECT-INT-SHAD-METHOD, PASPECT-DATA-MAPMETHOD , PASPECT-REFL-PROPS, PASPECT-REFL-MODEL, PASPECT-BACK-INT-STYLE, PSPECT-BACK-INT-STYLE-IND, PASPECT-BACK-INT-COLR, PASPECT-BACK-1F-SHAD-METHOD, PASPECT-BACK-DATA-MAP-METHOD,
37、PASPECTBACK-REFL-PROPS, PASPECT-BACK-REFL-MODEL, PASPECT-CURVE-APPROX-CRIT, PASPECT-SURF-APPROX-CRIT, PASPECT-PARAM-SURF-CHARS /* end of PHIGS PLUS enumerations */ ., ) Paspect; Pattrs ATTRIBUTES USED typedef enum ( /* start of PHIGS enmerations */ /* end of PHIGS enumerations */ /* start of PHIGS P
38、LUS enumerations */ PATTR-REFL, PATTR-PARAM-SURF /* end of PHIGS PLUS enumerations */ ., 1 Pattrs; 18 o ISOAEC ISOAEC 9593-4:1991/Amd.l:1994(E) Pelem-data ELEMENT DATA typedef union ( /* start of PHIGS element data */ /* end of PHIGS element data */ /* start of PHIGS PLUS element data */ struct Pele
39、mgolyline-set3-colr ( ., Pint colr-type; /* colour type Pvertex3-set vertex-data; /* list of vertex lists ) polyline-set3-colr; struct Pelem-fill-area-set3-data ( Pint colr-type; /* colour type Pf acet *facet-data; /* facet data Pedge-flag-set *edge-flags; /* list of edge flag lists Pvertex3-set ver
40、tex-data; /* list of vertex lists ) fill-area-set3-data; struct Pelem-fillarea-setdata ( Pint colr-type; /* colour type Pfacet *facet-data; /* facet data Pedge-flag-set *edge-flags; /* list of edge flag lists Pvertex-set vertex-data; /* list of vertex lists ) fill-area-set-data; struct Pelem-cell-ar
41、ray3glus ( Pparal para1 ; /* parallelogram P, Q, R Ppat-repglus pattern; /* pattern colour array ) cell-array3glus; struct Pelem-set-of-fill-arepsets3data ( Pint colr-type; /* colour type Psetof-fillarea-sets-data *set-data;/* fill area sets data Pedge-flag-set-list *edge-flags; /* list of edge flag
42、 sets Pvertex3Jist vertex-data; /* list of vertices Pcontour-set-list contours; /* list of contour sets ) set-of-fill-area-sets3-data; struct Pelem-set-of-fill-area-sets-data ( Pint colr-type; /* colour type Pset-of-fill-area-sets-data *set-data;/* fill area sets data Pedge-flag-set-list *edge-flags
43、; /* list of edge flag sets Pvertex-list vertex-data; /* list of vertices Pcontour-set-list contours; /* list of contour sets ) set-of-fill-area-sets-data; struct Pelem-tri-set3-data ( Pint cok-type; /* colour type Ptri-set-data *set-data; /* triangle set data Pedge-flag-triplet-list *edge-flags; /*
44、 list of triangle edge flag Pvertex3-list vertex-data; /* list of vertices Pvertex-ind-triplet-list triplets; /* list of triangle vertex index /* triplets /* triplets */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ 19 ISO/IEC 9593-4:1991/Amd.l:1994(E) o ISO/IEC
45、 ) tri-set3-data; struct Pelem-tri-set-data ( Pint colr-type; Ptri-set-data *set-data; Pedge-flag-triplet-list *edge-flags; Pvertex-list vertex-data; Pvertex-ind-triplet-list triplets; ) tri-set-data; struct Pelem-tri-strip3-data ( Pint colr-type; Pfacet-list *facet-data; Pedge-flag-list *edge-flags
46、; hrertex3-list vertex-data; tri-strip3-data; struct Pelem-tri-strip-data Pint colr-type ; Pfacet-list *facet-data; Pedge-flag-list *edge-flags; Pvertex-list vertex-data; 1 tri-strip-data; struct Pelem-quad-mesh3-data ( Pint colr-type; Pfacet-array *facet-data; Pedge-flag-array *edge-flags; Pvertex3
47、-array vertex-data; 1 quad-mesh3-data; struct Pelem-quad-mesh-data ( Pint cok-type; Pfacet-array *facet-data; Pedge-flag-array *edge-flags; Pvertex-array vertex-data; ) quad-mesh-data; /* colour type /* triangle set data /* list of triangle edge flag /* triplets /* list of vertices /* list of triang
48、le vertex index /* triplets /* colour type /* list of facet data /* list of edge flags /* list of vertex data /* colour type /* list of facet data /* list of edge flags /* list of vertex data /* colour type /* array of facet data /* array of edge flags /* array of vertex data /* colour type /* array
49、 of facet data /* array of edge flags /* array of vertex data struct Pelemnonuniformbspline_curve3 ) nonunifombsplinecurve3; struct Pelemnonuniformbsplinecurve3colr ( Pcurve-geom-spline geom-spline; /* geometry spline kurve-geom-spline geom-spline; /* geometry spline Pcurve-colr-spline *coir-spline; /* colour spline ) nonunifombspline_curve3_colr; struct Pelem-non-unifom-b-spline_curf3 ( Psurf-geom-spline geom-spline; /* geometry spline Ptrim-curve-loop-list *trim-loops; /* list of trimming curve loops ) non-unifom-b-spline-surf3; struct Pelem,nonuniformb