List of utility methods to do Pixel
int | pixel_distance(int x1, int y1, int x2, int y2) Calculate the "pixel distance" between two points (squaring not involved). int dx = Math.abs(x1 - x2); int dy = Math.abs(y1 - y2); return (dx > dy) ? dx : dy; |
int | pixelRange(int p) Utility method to limit the value within [0,255] range return ((p > 255) ? 255 : (p < 0) ? 0 : p);
|
double | pixelSize(double lat, double lng, int zoom) pixel Size double scale = (1 << zoom) * TILE_SIZE; return 40075160 * Math.cos(Math.PI * lat / 180) / scale; |
double | pixelSpacing(int n) pixel Spacing double k = 1.; return 1. / (n - 1 + k * SQRT_3); |
int | pixelsPerPanel(int n) pixels Per Panel return n * (n + 1) / 2;
|
boolean | pixelValuesEqual(final double num1, final double num2) Compares two double values with the error margin of #PIXEL_EPSILON (i.e. return Math.abs(num1 - num2) <= PIXEL_EPSILON;
|