Class VJViewspaceRender

All Implemented Interfaces:
Direct Known Subclasses:

public class VJViewspaceRender
extends VJRenderer

VJViewspaceRender class. Implements viewspace rendering, where the volume is rendered in the order of the pixels on the viewport. So for the whole viewport, rays are cast into the volume for one k-step, and in the next step, the rays are advanced by one k-step. This class implements polymorphic viewspace-ordered volume rendering. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.

Field Summary
protected static float[] osv
protected  int pixelSize
          size of entry viewspacePixel.
protected  VJVoxelLoc[] viewspace
          The viewspace buffer contains the x, y, z, and the interpolation coefficients steps for the next.
protected  VJAlphaColor[] viewspacePixel
          The viewspace pixel buffer contains the rgb composites and the alpha for all pixels.
protected static float[] vsv
protected static float[] vsvstep
Fields inherited from class VolumeJ.VJRenderer
classifier, COLORINT, cutout, depth, description, doDepthCueing, doPerspective, doPixeltracing, GRAYBYTE, height, interpolator, ioffset, joffset, koffset, m, message, mi, miLight, mLight, outputType, pixelms, pixels, running, sequenceNumber, shader, tracei, tracej, traceString, v, width
Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
Constructor Summary
VJViewspaceRender(VJInterpolator interpolator, VJShader shader, VJClassifier classifier)
          Create a new viewspace renderer with specified methods.
Method Summary
protected  void blendCompose(int index, VJValue value, VJGradient g, VJAlphaColor color, VJShade shade)
          Compose the classified voxel color into pixel.
static java.lang.String desc()
 void run()
          Viewspace rendering.
Methods inherited from class VolumeJ.VJRenderer
defaultViewport, getClassifier, getInterpolator, getPixels, getShader, getTimePerPixel, getTransformation, getViewport, getViewportHeight, getViewportWidth, getVolume, kill, minmax, newViewportBuffer, onTrace, setClassifier, setCutout, setDescription, setInterpolator, setMessage, setOutputColor, setOutputGrayscale, setPixel, setPixel, setSequenceNumber, setShader, setTransformation, setTransformation, setViewport, setVolume, trace, trace, traceWrite
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


protected VJAlphaColor[] viewspacePixel
The viewspace pixel buffer contains the rgb composites and the alpha for all pixels.


protected VJVoxelLoc[] viewspace
The viewspace buffer contains the x, y, z, and the interpolation coefficients steps for the next.


protected int pixelSize
size of entry viewspacePixel.


protected static float[] vsv


protected static float[] vsvstep


protected static float[] osv
Constructor Detail


public VJViewspaceRender(VJInterpolator interpolator,
                         VJShader shader,
                         VJClassifier classifier)
                  throws java.lang.Exception
Create a new viewspace renderer with specified methods.
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.Exception - if parameters not properly defined.
Method Detail


public void run()
Viewspace rendering. Render v into a pixel array. The type of pixel array depends on the value of pixelSize (grayscale or RGB). This is a general renderer. It can process interpolated voxels of type Object, and these voxels are passed to a classifier and a composer. Of course, interpolator, classifier and composer will need to be able to produce and process the needed type of Object. Thus, voxels can be scalars, indexed scalars (implemented here), or vectors, such as RGB (implemented here) or flow vectors.
run in class VJRenderer


protected void blendCompose(int index,
                            VJValue value,
                            VJGradient g,
                            VJAlphaColor color,
                            VJShade shade)
Compose the classified voxel color into pixel. Link to VJAlphaColor.blendComposeScalar() so that this method can be overloaded.
index - the index of the current composited pixel (so far).
value - the voxel VJValue for the current voxel (needed by some subclasses).
g - the interpolated gradient for shading
color - contains the alpha value and the color (grayscale or RGB) of the classified values.
shade - is the effect of shading.


public static java.lang.String desc()