org.deegree_impl.model.gc
Class ImgResize

java.lang.Object
  extended byorg.deegree_impl.model.gc.ImgResize

public class ImgResize
extends java.lang.Object

Version:
22.1.2003
Author:
Andreas Poth

Field Summary
private  float[][] inData
           
private  float[][] outData
           
 
Constructor Summary
ImgResize(float[][] data, int newWidth, int newHeight)
           
 
Method Summary
 float[][] rectStretch()
          RectStretch enlarges or diminishes a source rectangle of a bitmap to a destination rectangle.
private  int sign(int x)
           
 float[][] simpleStretch()
           
private  void stretch(int x1, int x2, int y1, int y2, int yr, int yw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inData

private float[][] inData

outData

private float[][] outData
Constructor Detail

ImgResize

public ImgResize(float[][] data,
                 int newWidth,
                 int newHeight)
Method Detail

sign

private int sign(int x)

stretch

private void stretch(int x1,
                     int x2,
                     int y1,
                     int y2,
                     int yr,
                     int yw)

rectStretch

public float[][] rectStretch()
RectStretch enlarges or diminishes a source rectangle of a bitmap to a destination rectangle. The source rectangle is selected by the two points (xs1,ys1) and (xs2,ys2), and the destination rectangle by (xd1,yd1) and (xd2,yd2). Since readability of source-code is wanted, some optimizations have been left out for the reader: It«s possible to read one line at a time, by first stretching in x-direction and then stretching that bitmap in y-direction. Entry: xs1,ys1 - first point of source rectangle xs2,ys2 - second point of source rectangle xd1,yd1 - first point of destination rectangle xd2,yd2 - second point of destination rectangle


simpleStretch

public float[][] simpleStretch()