public class ScaleBar
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
BEST_COLORBAR_LARGE_PADDING
This is how far in the colorbar and its annotations will be from the absolute corner of the image.
|
static float |
BEST_COLORBAR_PERCENT
This is the fraction of the image width or height that the colorbar is going to occupy
|
static float |
BEST_SCALEBAR_PERCENT
The best looking scale bars seem to be around 1/11th the image width
|
static java.lang.String |
ID
CVS ID
|
static float |
JPG_COMPRESSION_QUALITY
A number between zero and one for the jpeg quality
|
static float |
MARGIN_PERCENT
The margin (spacing above and below) will be calculated as this
fraction of the width.
|
static float |
PADDING_PERCENT
The padding (space between text and the margin) will be calculated
as this fraction of the margin.
|
static double[] |
SCALE_MULTIPLIERS
Fractional scales to try
|
Constructor and Description |
---|
ScaleBar() |
Modifier and Type | Method and Description |
---|---|
static double |
getBestScaleBar(int pixel_width,
double m_per_pixel)
Get the best scale bar length (in pixels) for an image whose width and
scale are specified.
|
static java.lang.String |
getScaleText(double meters)
Given a length in meters, return a formatted string for that scale
in the appropriate units.
|
static void |
main(java.lang.String[] args)
Process command line arguments
|
public static final java.lang.String ID
public static final float JPG_COMPRESSION_QUALITY
public static final float BEST_SCALEBAR_PERCENT
public static final float MARGIN_PERCENT
public static final float PADDING_PERCENT
public static final double[] SCALE_MULTIPLIERS
public static final float BEST_COLORBAR_PERCENT
public static final float BEST_COLORBAR_LARGE_PADDING
public static double getBestScaleBar(int pixel_width, double m_per_pixel)
pixel_width
- Width of image in pixelsm_per_pixel
- Scale of image, in meters per pixelpublic static java.lang.String getScaleText(double meters)
meters
- A scale in meterspublic static void main(java.lang.String[] args)
args
- -i[nput] file -o[utput] file -s[cale] meters-per-pixelCopyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona