b311480e |
1 | -- Created on: 1993-03-23 |
2 | -- Created by: BBL |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
b311480e |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
7fd59977 |
10 | -- |
b311480e |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
7fd59977 |
13 | -- |
b311480e |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class X11XWDAlienData from AlienImage inherits AlienImageData from AlienImage |
23 | |
24 | ---Version: 0.0 |
25 | |
26 | ---Purpose: This class defines a X11 Alien image. |
27 | ---Keywords: |
28 | ---Warning: |
29 | ---References: |
30 | |
31 | uses |
32 | File from OSD, |
33 | AsciiString from TCollection, |
34 | ColorImage from Image, |
35 | PseudoColorImage from Image, |
36 | Image from Image, |
37 | X11XColor from AlienImage, |
38 | X11XWDFileHeader from AlienImage |
39 | |
40 | raises |
41 | OutOfRange from Standard, |
42 | TypeMismatch from Standard |
43 | |
44 | is |
45 | Create returns mutable X11XWDAlienData from AlienImage ; |
46 | |
47 | Clear( me : in out mutable ) ; |
48 | ---Level: Public |
49 | ---Purpose: Frees memory allocated by X11XWDAlienData |
50 | ---C++: alias ~ |
51 | |
52 | Read ( me : in out mutable ; afile : in out File from OSD ) |
53 | returns Boolean from Standard ; |
54 | ---Level: Public |
55 | ---Purpose: Read content of a X11XWDAlienData object from a file |
56 | -- Returns True if file is a XWD file . |
57 | |
58 | Write( me : in immutable; afile : in out File from OSD ) |
59 | returns Boolean from Standard ; |
60 | ---Level: Public |
61 | ---Purpose: Write content of a X11XWDAlienData object to a file |
62 | |
63 | SetName( me : in out mutable ; |
64 | aName : in AsciiString from TCollection) |
65 | is redefined; |
66 | ---Level: Public |
67 | ---Purpose: Set Image name . |
68 | |
69 | Name( me : in immutable ) returns AsciiString from TCollection |
70 | is redefined; |
71 | ---C++: return const & |
72 | ---Level: Public |
73 | ---Purpose: Get Image name . |
74 | |
75 | ToImage( me : in immutable) |
76 | returns mutable Image from Image |
77 | raises TypeMismatch from Standard ; |
78 | ---Level: Public |
79 | ---Purpose : convert a X11XWDAlienData object to a Image object. |
80 | |
81 | FromImage( me : in out mutable ; anImage : in Image from Image ) |
82 | raises TypeMismatch from Standard ; |
83 | ---Level: Public |
84 | ---Purpose : convert a Image object to a X11XWDAlienData object. |
85 | |
86 | -- |
87 | -- Private Method |
88 | -- |
89 | |
90 | Pixel ( me : in immutable ; X,Y : in Integer from Standard ) |
91 | returns Integer from Standard |
92 | raises OutOfRange from Standard is private ; |
93 | ---Level: Internal |
94 | |
95 | SetPixel( me : in out mutable; X,Y : in Integer from Standard ; |
96 | Value : in Integer from Standard ) |
97 | raises OutOfRange from Standard is private ; |
98 | ---Level: Internal |
99 | |
100 | DataSize( me : in immutable) |
101 | returns Integer from Standard is private ; |
102 | ---Level: Internal |
103 | ---Purpose: Compute the imaga data size in byte |
104 | -- from header information |
105 | |
106 | RedShift( me : in immutable) returns Integer from Standard |
107 | raises TypeMismatch from Standard is private ; |
108 | ---Purpose: Compute the red shift for TrueColor X11XWDImage |
109 | |
110 | GreenShift( me : in immutable) returns Integer from Standard |
111 | raises TypeMismatch from Standard is private ; |
112 | ---Level: Internal |
113 | ---Purpose: Compute the red shift for TrueColor X11XWDImage |
114 | |
115 | BlueShift( me : in immutable) returns Integer from Standard |
116 | raises TypeMismatch from Standard is private ; |
117 | ---Level: Internal |
118 | ---Purpose: Compute the red shift for TrueColor X11XWDImage |
119 | |
120 | ToPseudoColorImage( me : in immutable) |
121 | returns PseudoColorImage from Image is private ; |
122 | ---Level: Internal |
123 | ---Purpose : convert a Image object to a AlienImage object. |
124 | |
125 | ToColorImage( me : in immutable) |
126 | returns ColorImage from Image is private ; |
127 | ---Level: Internal |
128 | ---Purpose : convert a Image object to a AlienImage object. |
129 | |
130 | FromPseudoColorImage( me : in out mutable; |
131 | anImage : in PseudoColorImage from Image ) |
132 | is private ; |
133 | ---Level: Internal |
134 | ---Purpose : convert a Image object to a X11XWDAlienData object. |
135 | |
136 | FromColorImage( me : in out mutable; |
137 | anImage : in ColorImage from Image) |
138 | is private ; |
139 | ---Level: Internal |
140 | ---Purpose : convert a Image object to a X11XWDAlienData object. |
141 | |
142 | fields |
143 | |
144 | myHeader : X11XWDFileHeader from AlienImage is protected ; |
145 | |
146 | myColors : Address from Standard is protected ; |
147 | -- XColors definition |
148 | |
149 | myData : Address from Standard is protected ; |
150 | -- my is a ( unsigned char * ) for 8 bit image , |
151 | -- ( unsigned int * ) for 24 bit image . |
152 | |
153 | end ; |
154 | |