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 ColorCubeColorMap from Aspect inherits ColorMap from Aspect |
23 | |
24 | ---Version: 0.0 |
25 | |
26 | ---Purpose: This class defines a ColorCube ColorMap object. |
27 | ---Keywords: |
28 | ---Warning: |
29 | ---References: |
30 | |
31 | uses |
32 | Color from Quantity, |
33 | ColorMapEntry from Aspect |
34 | |
35 | raises |
36 | BadAccess from Aspect, |
37 | RangeError from Standard |
38 | |
39 | is |
40 | Create( base_pixel, redmax, redmult, |
41 | greenmax, greenmult, |
42 | bluemax, bluemult : in Integer from Standard ) |
43 | returns mutable ColorCubeColorMap from Aspect |
44 | raises RangeError from Standard ; |
45 | ---Level: Public |
46 | ---Purpose : Create a ColorCube ColorMap. |
47 | |
48 | ColorCubeDefinition( me : in ; |
49 | base_pixel, |
50 | redmax, redmult, |
51 | greenmax, greenmult, |
52 | bluemax, bluemult : out Integer from Standard ); |
53 | |
54 | FindColorMapIndex ( me ; |
55 | AColorMapEntryIndex : Integer from Standard ) |
56 | returns Integer from Standard |
57 | raises BadAccess from Aspect ; |
58 | ---Level: Public |
59 | ---Purpose: Returns the index in the ColorMap of the |
60 | -- ColorMapEntry.Index() equal to <AnEntryIndex>. |
61 | -- Warning: Raises BadAccess if the index is not defined in the |
62 | -- ColorMap. |
63 | |
64 | FindEntry ( me ; AColorMapEntryIndex : Integer from Standard ) |
65 | returns ColorMapEntry from Aspect |
66 | raises BadAccess from Aspect ; |
67 | ---Level: Public |
68 | ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index() |
69 | -- equal to <AnEntryIndex>. |
70 | -- Warning: Raises BadAccess if the index is not defined in the |
71 | -- ColorMap. |
72 | ---C++: return const & |
73 | |
74 | NearestColorMapIndex( me ; aColor : Color from Quantity ) |
75 | returns Integer from Standard ; |
76 | ---Level: Public |
77 | ---Purpose: Returns the index in the ColorMap of the nearest |
78 | -- matching ColorMapEntry |
79 | |
80 | NearestEntry( me ; aColor : Color from Quantity ) |
81 | returns ColorMapEntry from Aspect ; |
82 | ---Level: Public |
83 | ---Purpose: Returns the nearest ColorMapEntry that match aColor . |
84 | ---C++: return const & |
85 | |
86 | AddEntry (me : mutable; aColor : Color from Quantity) |
87 | returns Integer from Standard; |
88 | ---Level: Public |
89 | ---Purpose: Search an identical color entry in the color map <me> |
90 | -- or returns the nearest ColorMapEntry Index. |
91 | |
92 | fields |
93 | mybasepixel : Integer from Standard ; |
94 | mygreenmax , mygreenmult : Integer from Standard ; |
95 | myredmax , myredmult : Integer from Standard ; |
96 | mybluemax , mybluemult : Integer from Standard ; |
97 | -- ColorCube definition for a ColorCube ColorMap. |
98 | |
99 | end ColorCubeColorMap ; |