jfits
Class ScaleFactory

java.lang.Object
  extended by jfits.ScaleFactory

public class ScaleFactory
extends Object

This class is based on the IVOA Fits package. The only difference is that we work on a single color band (GRAY color model) to reduce the memory demands.

   Current Version
   ===============
   ID:            $Id: SlowScaleUtils.java,v 1.1 2004/07/23 18:52:35 carliles Exp $
   Revision:      $Revision: 1.1 $
   Date/time:     $Date: 2004/07/23 18:52:35 $
   
Array operations that should be implemented in one method, but which have to be reimplemented for each primitive data type just to have the right type in the damn parameter list.


Nested Class Summary
static class ScaleFactory.ByteScaler
           
static class ScaleFactory.DoubleScaler
           
static class ScaleFactory.FloatScaler
           
static class ScaleFactory.IntScaler
           
static interface ScaleFactory.Scaler
           
static class ScaleFactory.ShortScaler
           
 
Field Summary
static int ASINH
           
protected static double[] BYTE_LOG_MAP
           
static ScaleFactory.Scaler BYTE_SCALER
           
protected static double[] BYTE_SQRT_MAP
           
static ScaleFactory.Scaler DOUBLE_SCALER
           
static ScaleFactory.Scaler FLOAT_SCALER
           
static int HIST_EQ
           
static ScaleFactory.Scaler INT_SCALER
           
static int LINEAR
           
static int LOG
           
static String[] SCALE_NAMES
           
protected static double[] SHORT_LOG_MAP
           
static ScaleFactory.Scaler SHORT_SCALER
           
protected static double[] SHORT_SQRT_MAP
           
static int SQUARE
           
static int SQUARE_ROOT
           
 
Constructor Summary
ScaleFactory()
           
 
Method Summary
static FitsHistogram computeHistogram(byte[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static FitsHistogram computeHistogram(double[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static FitsHistogram computeHistogram(float[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static FitsHistogram computeHistogram(int[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
static FitsHistogram computeHistogram(short[][] data, double bZero, double bScale)
          Finds the minimum and maximum data values in data.
protected static double[] createLogMap(int size)
           
protected static double[] createSqrtMap(int size)
           
static String[] getScaleNames()
           
static ScaleFactory.Scaler getScaler(Object data)
           
static String revision()
           
static short[] scale(Object data, short[] result, int width, int height, double bZero, double bScale, double min, double max, double sigma, FitsHistogram hist, int scaleMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE_NAMES

public static final String[] SCALE_NAMES

LINEAR

public static final int LINEAR
See Also:
Constant Field Values

LOG

public static final int LOG
See Also:
Constant Field Values

SQUARE_ROOT

public static final int SQUARE_ROOT
See Also:
Constant Field Values

SQUARE

public static final int SQUARE
See Also:
Constant Field Values

HIST_EQ

public static final int HIST_EQ
See Also:
Constant Field Values

ASINH

public static final int ASINH
See Also:
Constant Field Values

BYTE_SCALER

public static final ScaleFactory.Scaler BYTE_SCALER

SHORT_SCALER

public static final ScaleFactory.Scaler SHORT_SCALER

INT_SCALER

public static final ScaleFactory.Scaler INT_SCALER

FLOAT_SCALER

public static final ScaleFactory.Scaler FLOAT_SCALER

DOUBLE_SCALER

public static final ScaleFactory.Scaler DOUBLE_SCALER

BYTE_SQRT_MAP

protected static final double[] BYTE_SQRT_MAP

BYTE_LOG_MAP

protected static final double[] BYTE_LOG_MAP

SHORT_SQRT_MAP

protected static final double[] SHORT_SQRT_MAP

SHORT_LOG_MAP

protected static final double[] SHORT_LOG_MAP
Constructor Detail

ScaleFactory

public ScaleFactory()
Method Detail

getScaleNames

public static String[] getScaleNames()

computeHistogram

public static FitsHistogram computeHistogram(byte[][] data,
                                             double bZero,
                                             double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static FitsHistogram computeHistogram(short[][] data,
                                             double bZero,
                                             double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static FitsHistogram computeHistogram(int[][] data,
                                             double bZero,
                                             double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static FitsHistogram computeHistogram(float[][] data,
                                             double bZero,
                                             double bScale)
Finds the minimum and maximum data values in data.


computeHistogram

public static FitsHistogram computeHistogram(double[][] data,
                                             double bZero,
                                             double bScale)
Finds the minimum and maximum data values in data.


scale

public static short[] scale(Object data,
                            short[] result,
                            int width,
                            int height,
                            double bZero,
                            double bScale,
                            double min,
                            double max,
                            double sigma,
                            FitsHistogram hist,
                            int scaleMethod)

getScaler

public static ScaleFactory.Scaler getScaler(Object data)

createSqrtMap

protected static double[] createSqrtMap(int size)

createLogMap

protected static double[] createLogMap(int size)

revision

public static String revision()
Returns:
CVS Revision number.