uk.ac.starlink.ttools.plot2.layer
Class Pixers

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.Pixers

public class Pixers
extends Object

Utility class for use with Pixers.

Since:
27 Nov 2013
Author:
Mark Taylor

Method Summary
static Pixer clip(Pixer base, Rectangle clip)
          Returns a clipped version of a given pixel iterator whose extent is not known.
static Pixer clip(Pixer base, Rectangle clip, int xminBase, int xmaxBase, int yminBase, int ymaxBase)
          Returns a clipped version of a given pixel iterator whose extent is known.
static Pixer createArrayPixer(int[] xs, int[] ys, int np)
          Returns a new pixer that iterates over a given list of X,Y coordinates.
static Pixer translate(Pixer base, int tx, int ty)
          Returns a translated version of a pixel iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createArrayPixer

public static Pixer createArrayPixer(int[] xs,
                                     int[] ys,
                                     int np)
Returns a new pixer that iterates over a given list of X,Y coordinates.

Parameters:
xs - array of X values
ys - array of Y values
np - number of points (xs and ys must be at least this length)
Returns:
new pixel iterator

translate

public static Pixer translate(Pixer base,
                              int tx,
                              int ty)
Returns a translated version of a pixel iterator.

Parameters:
base - base pixel iterator
tx - offset in X direction
ty - offset in Y direction
Returns:
translated pixel iterator

clip

public static Pixer clip(Pixer base,
                         Rectangle clip)
Returns a clipped version of a given pixel iterator whose extent is not known.

Parameters:
base - base pixel iterator
clip - clipping rectangle
Returns:
clipped pixel iterator

clip

public static Pixer clip(Pixer base,
                         Rectangle clip,
                         int xminBase,
                         int xmaxBase,
                         int yminBase,
                         int ymaxBase)
Returns a clipped version of a given pixel iterator whose extent is known. May return null if the clipped pixer would dispense no pixels. {x,y}{min,max}Base are the extreme values of the base pixer; they do not account for the extent of a single pixel (so a single pixel at the origin would have all values set to zero).

Parameters:
base - base pixel iterator
clip - clipping rectangle
xminBase - lower limit of X values dispensed by base pixer
xmaxBase - upper limit of X values dispensed by base pixer
yminBase - lower limit of Y values dispensed by base pixer
ymaxBase - upper limit of Y values dispensed by base pixer
Returns:
clipped pixel iterator, or null if no pixels


Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.