Changeset 15961 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
- Timestamp:
- 2009-06-17T09:46:26+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GeorefImage.java
r13784 r15961 28 28 29 29 public BufferedImage image; 30 30 31 31 private double angle = 0; // in radian 32 32 33 33 private BufferedImage rotated_image; // only if angle <> 0 34 34 … … 47 47 max = new EastNorth(max.east() + dx, max.north() + dy); 48 48 } 49 49 50 50 public void resize(EastNorth rasterCenter, double proportion) { 51 51 min = min.interpolate(rasterCenter, proportion); … … 53 53 updatePixelPer(); 54 54 } 55 55 56 56 public void rotate(EastNorth pivot, double delta) { 57 57 if (angle == 0) { 58 org_min = min; 58 org_min = min; 59 59 org_max = max; 60 60 } 61 61 this.angle += delta; 62 62 63 63 EastNorth imageCenter = org_min.interpolate(org_max, 0.5); 64 64 EastNorth newimageCenter = imageCenter.rotate(pivot, angle); … … 74 74 max2 = max2.rotate(newimageCenter, angle); 75 75 getNewBounding(min, max, min2, max2); 76 76 77 77 rotated_image = tilt(image, angle); 78 78 } 79 79 80 80 public static BufferedImage tilt(BufferedImage image, double angle) { 81 81 double sin = Math.abs(Math.sin(angle)), cos = Math.abs(Math.cos(angle)); … … 96 96 return gd.getDefaultConfiguration(); 97 97 } 98 98 99 99 private void getNewBounding(EastNorth min, EastNorth max, EastNorth c, EastNorth d) { 100 100 EastNorth pt[] = new EastNorth[4]; … … 116 116 max.setLocation(highestEast, highestNorth); 117 117 } 118 118 119 119 public boolean contains(EastNorth en) { 120 120 return min.east() <= en.east() && en.east() <= max.east() && min.north() <= en.north() … … 165 165 /** 166 166 * Make all pixels masked by the given georefImage transparent in this image 167 * 167 * 168 168 * @param georefImage 169 169 */
Note:
See TracChangeset
for help on using the changeset viewer.
