package bdv.viewer.render;

import net.imglib2.Interval;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.realtransform.AffineTransform3D;
import net.imglib2.type.numeric.ARGBType;

/**
 * TODO javadoc
 */
public interface RenderResult
{
	/**
	 * TODO javadoc
	 */
	void init( int width, int height );

	/**
	 * TODO javadoc
	 * Get the image to render to.
	 *
	 * @return
	 */
	// TODO: rename getTargetImage() ???
	RandomAccessibleInterval< ARGBType > getScreenImage();

	/**
	 * TODO javadoc
	 * Get the viewer transform used to render image.
	 * This is with respect to the screen resolution (doesn't include scaling).
	 */
	AffineTransform3D getViewerTransform();

	/**
	 * TODO javadoc
	 */
	double getScaleFactor();

	/**
	 * TODO javadoc
	 */
	void setScaleFactor( double scaleFactor );

	/**
	 * Fill in {@code interval} with data from {@code patch},
	 * scaled by the relative scale between this {@code RenderResult} and {@code patch},
	 * and shifted such that {@code (0,0)} of the {@code patch} is placed at {@code (ox,oy)} of this {@code RenderResult}
	 * <p>
	 * Note that only data in {@code interval} will be modified, although the scaled and shifted {@code patch} might fall partially outside.
	 */
	void patch( final RenderResult patch, final Interval interval, final double ox, final double oy );

	void setUpdated();
}

@@ -201,78 +201,464 @@
 %0A * 
-TODO javadoc%0A */%0Apublic interface RenderResult%0A%7B%0A%09/**%0A%09 * TODO javadoc
+Provides the %7B@link MultiResolutionRenderer renderer%7D with a target image%0A * (%7B@code RandomAccessibleInterval%3CARGBType%3E%7D) to render to. Provides the%0A * %7B@link RenderTarget%7D with the rendered image and transform etc necessary to%0A * display it.%0A */%0Apublic interface RenderResult%0A%7B%0A%09/**%0A%09 * Allocate storage such that %7B@link #getScreenImage()%7D holds an image of%0A%09 * %7B@code width * height%7D.%0A%09 * %3Cp%3E%0A%09 * (Called by the %7B@link MultiResolutionRenderer renderer%7D.)
 %0A%09 *
@@ -702,33 +702,16 @@
 ;%0A%0A%09/**%0A
-%09 * TODO javadoc%0A
 %09 * Get 
@@ -741,20 +741,113 @@
 %0A%09 *
-%0A%09 * @return
+ %3Cp%3E%0A%09 * (Called by the %7B@link MultiResolutionRenderer renderer%7D.)%0A%09 *%0A%09 * @return the image to render to
 %0A%09 *
@@ -948,33 +948,16 @@
 ;%0A%0A%09/**%0A
-%09 * TODO javadoc%0A
 %09 * Get 
@@ -998,20 +998,16 @@
 r image.
-%0A%09 *
  This is
@@ -1022,16 +1022,20 @@
 spect to
+%0A%09 *
  the scr
@@ -1083,127 +1083,330 @@
 %0A%09 *
-/%0A%09AffineTransform3D getViewerTransform();%0A%0A%09/**%0A%09 * TODO javadoc%0A%09 */%0A%09double getScaleFactor();%0A%0A%09/**%0A%09 * TODO javadoc
+ %3Cp%3E%0A%09 * (Called by the %7B@link MultiResolutionRenderer renderer%7D to set the%0A%09 * transform.)%0A%09 */%0A%09AffineTransform3D getViewerTransform();%0A%0A%09/**%0A%09 * Get the scale factor from target coordinates to screen resolution.%0A%09 */%0A%09double getScaleFactor();%0A%0A%09/**%0A%09 * Set the scale factor from target coordinates to screen resolution.
 %0A%09 *
@@ -1515,20 +1515,16 @@
  patch%7D,
-%0A%09 *
  scaled 
@@ -1529,16 +1529,20 @@
 d by the
+%0A%09 *
  relativ
@@ -1605,16 +1605,16 @@
 ch%7D,
-%0A%09 *
  and
+%0A%09 *
  shi
@@ -1675,16 +1675,20 @@
 laced at
+%0A%09 *
  %7B@code 
@@ -1803,24 +1803,28 @@
 although the
+%0A%09 *
  scaled and 
@@ -1981,16 +1981,173 @@
  oy );%0A%0A
+%09/**%0A%09 * Notify that the %7B@link #getScreenImage() target image%7D data was changed.%0A%09 * %3Cp%3E%0A%09 * (Called by the %7B@link MultiResolutionRenderer renderer%7D.)%0A%09 */%0A
 %09void se

add javadoc