|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpview.graphics.EnvironmentMap
public class EnvironmentMap
The environment map class stores the environment images and provides a method to rotate the map
| Field Summary | |
|---|---|
static int |
BLUR_TYPE_GAUSSIAN
constant indicating a gaussian blur |
static int |
BLUR_TYPE_NONE
constant indicating no blur |
static int |
BLUR_TYPE_SIMPLE
constant indicating simple blur (no weighting) |
static int |
DEFAULT_DOWNSAMPLE
default setting for downsampling the map |
static float |
DEFAULT_GAUSSIAN_SIGMA
the default sigma setting for the gaussian kernel |
static int |
DEFAULT_KERNEL_SIZE
default gaussian kernel size |
int |
MAX_DOWNSAMPLE_SZ
The maximum downsample size, determined by the environment map image |
| Constructor Summary | |
|---|---|
EnvironmentMap(java.awt.image.BufferedImage source,
PTM ptm)
Creates a new instance of EnvironmentMap |
|
| Method Summary | |
|---|---|
int |
getDownSample()
Returns the amount by which the map is downsampled |
int |
getHeight()
returns the height of the environment map |
java.awt.image.BufferedImage |
getImage()
Returns the sphere map image used for the environment map |
int |
getMapIndex(Vec3f normal)
Returns the pixel value indexed by the provided normal in a flat (1D) pixel buffer |
int |
getMaxDownsample()
Returns the current amount by which the map can be downsampled |
int |
getPixel(Vec3f normal)
Returns the pixel indexed by light reflected by the provided normal |
java.awt.Point |
getPosition(Vec3f normal)
Returns the point on a 2D plane indexed by the provided normal |
int |
getWidth()
Returns the width of the PTM |
void |
refresh()
Refreshes the sampling and blur routines |
void |
release()
free all storage used by this class |
int[] |
rotatedMap()
Returns a pixel buffer of the rotated map |
void |
setAngle(int degrees)
Sets the angle for rotation of the map |
void |
setBlurKernelSize(int i)
Sets the kernel size for the gaussian blur |
void |
setGaussianBlur()
Set the blur type to gaussian blur |
void |
setGaussianSigma(float f)
Sets the sigma value for the gaussian blur algorithm |
void |
setImage(java.awt.image.BufferedImage source)
Set the sphere map image to be used |
void |
setNoBlur()
Turn off blurring |
void |
setSampleSize(int i)
Sets the downsample size for the map |
void |
setSimpleBlur()
Set the blur type to a simple blur (no weights) |
void |
updateMonitor(Vec3f[] normals)
Updates the local monitor (for debugging) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BLUR_TYPE_NONE
public static final int BLUR_TYPE_SIMPLE
public static final int BLUR_TYPE_GAUSSIAN
public static final int DEFAULT_KERNEL_SIZE
public static final int DEFAULT_DOWNSAMPLE
public static final float DEFAULT_GAUSSIAN_SIGMA
public int MAX_DOWNSAMPLE_SZ
| Constructor Detail |
|---|
public EnvironmentMap(java.awt.image.BufferedImage source,
PTM ptm)
source - the sphere map imageptm - the parent PTM to be mapped| Method Detail |
|---|
public int getDownSample()
public void release()
public void setImage(java.awt.image.BufferedImage source)
source - the sphere map imagepublic int getWidth()
public int getHeight()
public int getMaxDownsample()
public java.awt.image.BufferedImage getImage()
public int getPixel(Vec3f normal)
normal - the normal on the PTM
public java.awt.Point getPosition(Vec3f normal)
normal - normal from the PTM
public int getMapIndex(Vec3f normal)
normal - a normal from the PTM surface
public void setSampleSize(int i)
i - the downsample sizepublic void setBlurKernelSize(int i)
i - sets the blur kernel sizepublic void setGaussianSigma(float f)
f - the sigma value for the gaussian blurpublic void setGaussianBlur()
public void setSimpleBlur()
public void setNoBlur()
public int[] rotatedMap()
public void refresh()
public void updateMonitor(Vec3f[] normals)
normals - list of normals to highlight for debuggingpublic void setAngle(int degrees)
degrees - angle in degrees to rotate the map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||