public class Utils
extends java.lang.Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asString(double[] a)
As string.
|
static java.lang.String |
asString(float[] a)
As string.
|
static java.lang.String |
asString(int[] a)
As string.
|
static java.awt.image.BufferedImage |
blurImageSimple(java.awt.image.BufferedImage image,
int kSize)
Blur image simple.
|
static int |
clamp(int i)
clamp to 8-bit int
|
static java.awt.image.BufferedImage |
createBufferedImage(int[] pixels,
int scanline)
Creates the buffered image.
|
static java.awt.image.BufferedImage |
createBufferedImage(Vec3f[] pixels,
int scanline)
Creates the buffered image.
|
static double |
dot3(double[] a,
double[] b)
Dot3.
|
static float |
dot3(float[] a,
float[] b)
Dot3.
|
static java.awt.image.BufferedImage |
gaussianBlur(java.awt.image.BufferedImage image,
int kSize,
float sigma)
Gaussian blur.
|
static int[] |
grabPixels(java.awt.image.BufferedImage image)
Grab pixels.
|
static int |
indexOfMax(double[] a)
Index of max.
|
static Vec3f[] |
intToVec(int[] a)
Int to vec.
|
static void |
main(java.lang.String[] args)
The main method.
|
static float[] |
normalize(float x,
float y,
float z)
Normalize.
|
static double[] |
normalize3(double[] a)
Normalize3.
|
static float[] |
normalize3(float[] a)
Normalize3.
|
static java.awt.image.BufferedImage |
readUnbuffered(java.io.InputStream is)
Read unbuffered.
|
static double[] |
reflect(double[] normal,
double[] incedent)
Reflect.
|
static float[] |
reflect(float[] normal,
float[] incedent)
Reflect.
|
static double[] |
scalarMult3(double[] a,
double s)
Scalar mult3.
|
static float[] |
scalarMult3(float[] a,
float s)
Scalar mult3.
|
static float |
translate(int i,
int maxVal)
Translate.
|
static int |
unsignedByteToInt(byte b)
Unsigned byte to int.
|
static double[] |
vecSum3(double[] a,
double[] b)
Vec sum3.
|
static float[] |
vecSum3(float[] a,
float[] b)
Vec sum3.
|
public static java.lang.String asString(double[] a)
a - the apublic static java.lang.String asString(float[] a)
a - the apublic static java.lang.String asString(int[] a)
a - the apublic static java.awt.image.BufferedImage blurImageSimple(java.awt.image.BufferedImage image,
int kSize)
image - the imagekSize - the k sizepublic static int clamp(int i)
public static java.awt.image.BufferedImage createBufferedImage(int[] pixels,
int scanline)
pixels - the pixelsscanline - the scanlinepublic static java.awt.image.BufferedImage createBufferedImage(Vec3f[] pixels, int scanline)
pixels - the pixelsscanline - the scanlinepublic static double dot3(double[] a,
double[] b)
a - the ab - the bpublic static float dot3(float[] a,
float[] b)
a - the ab - the bpublic static java.awt.image.BufferedImage gaussianBlur(java.awt.image.BufferedImage image,
int kSize,
float sigma)
image - the imagekSize - the k sizesigma - the sigmapublic static int[] grabPixels(java.awt.image.BufferedImage image)
image - the imagepublic static int indexOfMax(double[] a)
a - the apublic static Vec3f[] intToVec(int[] a)
a - the apublic static void main(java.lang.String[] args)
args - the argumentspublic static float[] normalize(float x,
float y,
float z)
x - the xy - the yz - the zpublic static double[] normalize3(double[] a)
a - the apublic static float[] normalize3(float[] a)
a - the apublic static java.awt.image.BufferedImage readUnbuffered(java.io.InputStream is)
throws java.io.IOException
is - the isjava.io.IOException - Signals that an I/O exception has occurred.public static double[] reflect(double[] normal,
double[] incedent)
normal - the normalincedent - the incedentpublic static float[] reflect(float[] normal,
float[] incedent)
normal - the normalincedent - the incedentpublic static double[] scalarMult3(double[] a,
double s)
a - the as - the spublic static float[] scalarMult3(float[] a,
float s)
a - the as - the spublic static float translate(int i,
int maxVal)
i - the imaxVal - the max valpublic static int unsignedByteToInt(byte b)
b - the bpublic static double[] vecSum3(double[] a,
double[] b)
a - the ab - the bpublic static float[] vecSum3(float[] a,
float[] b)
a - the ab - the b