|
BIJ API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--VolumeJ.VJRenderer
VJRenderer class implements the context and support methods for Volume Rendering. Subclasses of VJRenderer have to implement the actual run() method. Available for the run() method by default:
shader classifier interpolator m and mi, the transformation matrix and its inverse of the required view. v the Volume that is to be rendered width, height, depth the size of the volume in viewspace. ioffset, joffset, koffset the offsets of the volume in viewspace. pixels the viewport bufferCopyright (c) 1999-2002, Michael Abramoff. All rights reserved.
Field Summary | |
protected VJClassifier |
classifier
Voxel classifier. |
protected static int |
COLORINT
Defines type of image the rendering is output to: color (as int). |
protected VJCutout |
cutout
|
protected int |
depth
Boundaries of viewspace volume (the viewport) in k,j,i space. |
protected java.lang.String |
description
|
protected boolean |
doDepthCueing
|
protected boolean |
doPerspective
|
protected boolean |
doPixeltracing
Pixel tracing variables. |
protected static int |
GRAYBYTE
Defines type of image the rendering is output to: grayscale. |
protected int |
height
Boundaries of viewspace volume (the viewport) in k,j,i space. |
protected VJInterpolator |
interpolator
Voxel interpolator. |
protected int |
ioffset
Start of rays in viewspace. |
protected int |
joffset
Start of rays in viewspace. |
protected int |
koffset
Start of rays in viewspace. |
protected VJMatrix |
m
Transformation matrix and inverse. |
protected java.lang.String |
message
|
protected VJMatrix |
mi
Transformation matrix and inverse. |
protected VJMatrix |
miLight
Separate transformation matrix and inverse for the light. |
protected VJMatrix |
mLight
Separate transformation matrix and inverse for the light. |
protected int |
outputType
Type of image output by this renderer: GRAYBYTE or COLORINT. |
protected double |
pixelms
Amount of ms per pixel spent in rendering loop. |
protected java.lang.Object |
pixels
Image buffer, is a flat array of int's or byte's, dependent on outputType. |
protected boolean |
running
Flag indicating whether this renderer is running. |
protected int |
sequenceNumber
|
protected VJShader |
shader
Surface shader. |
protected int |
tracei
|
protected int |
tracej
|
protected java.lang.String |
traceString
|
protected Volume |
v
Volume to be rendered (polymorphic). |
protected int |
width
Boundaries of viewspace volume (the viewport) in k,j,i space. |
Fields inherited from class java.lang.Thread |
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals |
Constructor Summary | |
VJRenderer(VJInterpolator interpolator,
VJShader shader,
VJClassifier classifier)
Create a new default renderer with specified interpolator, shader and classifier. |
Method Summary | |
int[] |
defaultViewport()
Get a default viewport automatically. |
VJClassifier |
getClassifier()
|
VJInterpolator |
getInterpolator()
|
java.lang.Object |
getPixels()
Get the viewport pixel buffer. |
VJShader |
getShader()
|
double |
getTimePerPixel()
|
VJMatrix |
getTransformation()
|
int[] |
getViewport()
Get the size of the viewport. |
int |
getViewportHeight()
Get the height of the viewport. |
int |
getViewportWidth()
Get the width of the viewport. |
Volume |
getVolume()
Get the volume in this renderer. |
void |
kill()
The kill method is called when this renderer is to stop. |
protected void |
minmax()
Calculate the extents of the volume to be rendered in view and objectspace. |
protected java.lang.Object |
newViewportBuffer()
|
protected boolean |
onTrace(int i,
int j)
|
void |
run()
To be overloaded, does nothing. |
void |
setClassifier(VJClassifier classifier)
|
void |
setCutout(VJCutout cutout)
|
void |
setDescription(java.lang.String description)
|
void |
setInterpolator(VJInterpolator interpolator)
|
void |
setMessage(java.lang.String message)
Set the rendering message. |
void |
setOutputColor()
Set the output to color. |
void |
setOutputGrayscale()
Set the output to color. |
protected void |
setPixel(int pixel,
int i,
int j)
Put color into the pixel array at i,j. |
protected void |
setPixel(VJAlphaColor pixel,
int i,
int j)
Put the pixel into the pixel array at i,j. |
void |
setSequenceNumber(int sequenceNumber)
|
void |
setShader(VJShader shader)
The shader has changed. |
void |
setTransformation(VJMatrix m)
Set the transformation matrix of the renderer to m. |
void |
setTransformation(VJMatrix m,
VJMatrix mLight)
Set the transformation matrix of the renderer to m and the special light transformation matrix to correct the light position (should not be influenced by e.g. |
void |
setViewport(int width,
int height)
Set the viewport to a specific size. |
void |
setVolume(Volume v)
The volume has changed. |
void |
trace(int i,
int j)
Start pixeltracing for the i,j pixel in the viewport. |
protected void |
trace(java.lang.String s)
|
protected void |
traceWrite()
|
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int GRAYBYTE
protected static final int COLORINT
protected boolean doPerspective
protected boolean doDepthCueing
protected int outputType
protected double pixelms
protected int sequenceNumber
protected boolean running
protected VJMatrix m
protected VJMatrix mi
protected VJMatrix mLight
protected VJMatrix miLight
protected VJClassifier classifier
protected VJInterpolator interpolator
protected VJShader shader
protected java.lang.Object pixels
protected VJCutout cutout
protected Volume v
protected int width
protected int height
protected int depth
protected int ioffset
protected int joffset
protected int koffset
protected java.lang.String message
protected boolean doPixeltracing
protected int tracei
protected int tracej
protected java.lang.String traceString
protected java.lang.String description
Constructor Detail |
public VJRenderer(VJInterpolator interpolator, VJShader shader, VJClassifier classifier) throws java.lang.IllegalArgumentException
interpolator
- the interpolator that will interpolate VJValues from the voluem to be rendered.shader
- the VJShader that will be used for shading.classifier
- the VJClassifier that will be used for classifying.java.lang.IllegalArgumentException
- if parameters not properly defined.Method Detail |
public int[] defaultViewport()
public void setOutputColor()
public void setOutputGrayscale()
public void setViewport(int width, int height)
width
- the width of the viewport.height
- the height of the viewport.protected java.lang.Object newViewportBuffer()
protected void setPixel(int pixel, int i, int j)
pixel
- an int, which contains the composited pixel value.i
- the i-position in the pixel array.j
- the j-position in the pixel array.protected void setPixel(VJAlphaColor pixel, int i, int j)
pixel
- a VJAlphaColor, which contains the composited pixel value.i
- the i-position in the pixel array.j
- the j-position in the pixel array.public void setTransformation(VJMatrix m)
m
- the transformation matrix wanted.public void setTransformation(VJMatrix m, VJMatrix mLight)
m
- the transformation matrix wanted.mLight
- the transformation matrix wanted for the light.public void setMessage(java.lang.String message)
message
- a String used for status updates, error messages etc.public void setShader(VJShader shader)
shader
- the new shader.protected void minmax()
public void run()
running
to true and check it.run
in class java.lang.Thread
public void kill()
public void setVolume(Volume v)
volume
- the new volume.public java.lang.Object getPixels()
public int[] getViewport()
public int getViewportWidth()
public int getViewportHeight()
public Volume getVolume()
public VJMatrix getTransformation()
public void setInterpolator(VJInterpolator interpolator)
public VJInterpolator getInterpolator()
public void setClassifier(VJClassifier classifier)
public VJClassifier getClassifier()
public VJShader getShader()
public void setCutout(VJCutout cutout)
public void trace(int i, int j)
i
- the x coordinate of the pixel in the viewport bufferj
- the y coordinate of the pixel in the viewport bufferprotected boolean onTrace(int i, int j)
protected void trace(java.lang.String s)
protected void traceWrite()
public double getTimePerPixel()
public void setSequenceNumber(int sequenceNumber)
public void setDescription(java.lang.String description)
|
BIJ API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |