b311480e |
1 | -- Created on: 1993-07-27 |
2 | -- Created by: Jean Louis FRENKEL |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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 | |
23 | class PlanarPixelInterpolation from Image inherits PixelInterpolation from Image |
24 | |
25 | ---Purpose: The class PlanarPixelInterpolation is used to compute a |
26 | -- SubPixelvalue on non integer Image coordinate |
27 | -- PlanarPixelInterpolation redefined a new method to compute a |
28 | -- SubPixel value . |
29 | -- To compute the value of a Image SubPixel, first we look |
30 | -- for the three nearest Image Pixels . |
31 | -- Then we compute the plane definition in the 3D space |
32 | -- composed by the Image Pixel coordinate and Pixel value |
33 | -- on Z axis . |
34 | -- The SubPixel value is the Z value of ( FX,FY ) point in the |
35 | -- three nearest Image Pixel defined plane . |
36 | |
37 | uses |
38 | |
39 | Image from Image, |
40 | Pixel from Aspect, |
41 | ColorPixel from Aspect, |
42 | IndexPixel from Aspect, |
43 | DColorImage from Image, |
44 | DIndexedImage from Image |
45 | |
46 | is |
47 | |
48 | Create returns PlanarPixelInterpolation from Image ; |
49 | ---Level: Public |
50 | ---Purpose: Create a PlanarPixelInterpolation object. |
51 | |
52 | Interpolate( me ; aImage : Image from Image ; |
53 | X,Y : Real from Standard ; |
54 | LowerX,LowerY,UpperX,UpperY : Integer from Standard ; |
55 | RetPixel : in out Pixel from Aspect ) |
56 | returns Boolean from Standard is redefined ; |
57 | ---Level: Public |
58 | ---Purpose: Redefined the method to compute SubPixel's value |
59 | -- on non integer Image coordinate. |
60 | -- LowerX,LowerY,UpperX,UpperY is the Image Min Max, it's used |
61 | -- to check if the SubPixel coordinate FX,FY is outside of |
62 | -- image. |
63 | -- Return True if Interpolation Succes. |
64 | -- Return False if the SubPixel is out from Image. |
65 | |
66 | Interpolate( me ; aImage : DColorImage from Image ; |
67 | X,Y : Real from Standard ; |
68 | LowerX,LowerY,UpperX,UpperY : Integer from Standard ; |
69 | RetPixel : in out ColorPixel from Aspect ) |
70 | returns Boolean from Standard is redefined; |
71 | ---Level: Public |
72 | ---Purpose: Compute SubPixel's value on non integer Image coordinate for |
73 | -- DColorImage and ColorPixel. |
74 | -- LowerX,LowerY,UpperX,UpperY is the Image Min Max, it's used |
75 | -- to check if the SubPixel coordinate FX,FY is outside of |
76 | -- image. |
77 | -- Return True if Interpolation Succes. |
78 | -- Return False if the SubPixel is out from Image. |
79 | |
80 | Interpolate( me ; aImage : DIndexedImage from Image ; |
81 | X,Y : Real from Standard ; |
82 | LowerX,LowerY,UpperX,UpperY : Integer from Standard ; |
83 | RetPixel : in out IndexPixel from Aspect ) |
84 | returns Boolean from Standard is redefined ; |
85 | ---Level: Public |
86 | ---Purpose: Compute SubPixel's value on non integer Image coordinate for |
87 | -- DIndexedImage and IndexPixel. |
88 | -- LowerX,LowerY,UpperX,UpperY is the Image Min Max, it's used |
89 | -- to check if the SubPixel coordinate X,Y is outside of |
90 | -- image. |
91 | -- Return True if Interpolation Succes. |
92 | -- Return False if the SubPixel is out from Image. |
93 | |
94 | end PlanarPixelInterpolation from Image; |