summaryrefslogtreecommitdiff
path: root/src/Image/Image_PseudoColorImage.cdl
blob: 413072e553221a3651e5db97a4f282d1d3ff16eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
-- File:	Image_PseudoColorImage.cdl
-- Created:	Tue Jul 27 18:53:48 1993
-- Author:	Jean Louis FRENKEL
--		<jlf@sparc3>
---Copyright:	 Matra Datavision 1993


class PseudoColorImage from Image inherits DIndexedImage from Image

	---Purpose : A PseudoColorImage is a DIndexedImage associated with a
	--	     ColorMap . The ColoMap is set at Creation time and then
	--	     never be changed. Each Pixel in the Image ,as a IndexPixel
	--	     from Aspect, match a ColoMap Entry with the same value.

uses
    ColorMap 		from Aspect,
    Color    		from Quantity,
    IndexPixel 		from Aspect ,
    Array1OfColor 	from Quantity,
    HArray1OfColor 	from Quantity,
    LookupTable  	from Image,
    Image 		from Image,
    TypeOfImage 	from Image
    
is

    Create( x,y,dx,dy   : in Integer from Standard ;
            aColorMap   : ColorMap   from Aspect )
    	returns mutable PseudoColorImage from Image;
	---Level: Public
	---Purpose : Creates a PseudoColorImage object.
	--	       The default Background Pixel is set to 0 .
	--	       All the Image is initialised with Background Pixel
    
    Create( x,y,dx,dy   : in Integer from Standard ;
            aColorMap   : ColorMap   from Aspect ;
	    BackPixel   : IndexPixel from Aspect )
    	returns mutable PseudoColorImage from Image;
	---Level: Public
	---Purpose : Creates a PseudoColorImage object and set the 
	--	       Background Pixel.
	--	       All the Image is initialised with Background Pixel
    
    Type    ( me : immutable )  returns TypeOfImage from Image ;
	---Level: Public
	---Purpose : Returns the Image Type.

    ColorMap( me ) returns immutable ColorMap from Aspect;
	---Level: Public
	---Purpose : returns the Image ColorMap .

    PixelColor( me : immutable ; X,Y : in Integer from Standard ) 
	returns Color from Quantity ;
    	---C++: return const &
	---Level: Public
	---Purpose : Returns the Pixel Color .

    RowColor  ( me : immutable ; Y : in Integer from Standard )
	returns HArray1OfColor from Quantity is redefined ;
	---Level: Public
	---Purpose : Return the PixelRow Color in a HArray1 of Color.

    RowColor  ( me       : immutable ; 
		Y        : in Integer from Standard ;
		aArray1  : in out Array1OfColor from Quantity ) is redefined ;
	---Level: Public
	---Purpose : Stores the PixelRow Color in a Array1 .

    Squeeze( 	me 		: immutable ; 
		BasePixel 	: IndexPixel from Aspect ) 
	returns PseudoColorImage from Image ;
	---Level: Public
	---Purpose : Creates a new Image with continuous Pixel and a continuous 
	--              ColorMap whith only used Image color starting from
	--		BasePixel .

    SqueezedLookupTable( 
		me 		: immutable ; 
		BasePixel 	: IndexPixel from Aspect ;
		aLookup		: in out LookupTable from Image ) ;
	---Level: Public
	---Purpose: Creates a LookupTable that can be used to create a
	--	    new Image with continuous Pixel and a continuous 
	--	    ColorMap with only used Image color starting
	--	    from BasePixel .

    Lookup( me : mutable ; 
	    aLookup : in LookupTable from Image ) ;
	---Level: Public
	---Purpose : Pass a PseudoColorImage through a lookupTable

    Extrema( me : immutable ; Min, Max : in out IndexPixel from Aspect );
	---Level: Public
	---Purpose: Find the maximum and minimum Pixel Value of an Image.

    Threshold( me : mutable ; Min, Max : IndexPixel from Aspect ;
			      Map      : IndexPixel from Aspect );
	---Level: Public
	---Purpose: This method changes the value of any Pixel beetwen the 
	--	    range (Min->Max) to the Pixel Map value. All Pixel values
	--	    outside the range are passed through without changed .

    Rescale( me : mutable ; Scale, Offset : Real from Standard ) ;
	---Level: Public
	---Purpose : Map the Image Pixel Value from one range to another range.
	--	     This method perform the mapping by multiplying each
	--	     Pixel Value by Scale and then adding Offset to the result.

    Dup   ( me : immutable ) returns mutable Image from Image;
	---Level: Public
	---Purpose : Duplicate a Image.

    -- ******************* Redefined method  *************************** 

--	ShallowCopy (me) returns mutable like me  ;
	---Level: Public
--	    ---Purpose: Returns a copy at the first level of <me>. The objects 
--	    --         referenced are not copied. Entities copied by 
--	    --         ShallowCopy are equal.
--	    ---C++:  function call

--	DeepCopy (me) returns mutable like me  ;
	---Level: Public
--	    ---Purpose: Returns a deep copy of <me>. The objects 
--	    --          referenced are copied. Entities copied by 
--	    --          DeepCopy are similar (c.f the Method IsSimilar).
--	    ---C++:  function call

fields
    myColorMap: ColorMap from Aspect;
    
end PseudoColorImage from Image;