funworld
Class OverlayImagesXY

java.lang.Object
  extended by funworld.WorldImage
      extended by funworld.OverlayImagesXY
Direct Known Subclasses:
OverlayImages

public class OverlayImagesXY
extends WorldImage

The class to represent an overlay of the top image on the bottom one with the top offset by the given dx and dy combined into WorldImage to be drawn by the World when drawing on its Canvas.

Since:
February 4 2012
Author:
Viera K. Proulx

Field Summary
 WorldImage bot
          the bottom image for the combined image
 int dx
          the horizontal offset for the top image
 int dy
          the vertical offset for the top image
 WorldImage top
          the top image for the combined image
 
Fields inherited from class funworld.WorldImage
color, pinhole
 
Constructor Summary
OverlayImagesXY(WorldImage bot, WorldImage top, int dx, int dy)
          The full constructor that produces the top image overlaid over the bottom one with the given offset.
 
Method Summary
 int getHeight()
          Produce the height of this image
 int getWidth()
          Produce the width of this image
 WorldImage movePinhole(int ddx, int ddy)
          Produce the overlay of images with the pinhole moved by the given (dx, dy)
 WorldImage moveTo(geometry.Posn p)
          Produce the overlay of images with the pinhole moved to the given location
 
Methods inherited from class funworld.WorldImage
overlayImages
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bot

public WorldImage bot
the bottom image for the combined image


top

public WorldImage top
the top image for the combined image


dx

public int dx
the horizontal offset for the top image


dy

public int dy
the vertical offset for the top image

Constructor Detail

OverlayImagesXY

public OverlayImagesXY(WorldImage bot,
                       WorldImage top,
                       int dx,
                       int dy)
The full constructor that produces the top image overlaid over the bottom one with the given offset.

Parameters:
bot - the bottom image for the combined image
top - the bottom image for the combined image
dx - the horizontal offset for the top image
dy - the vertical offset for the top image
Method Detail

movePinhole

public WorldImage movePinhole(int ddx,
                              int ddy)
Produce the overlay of images with the pinhole moved by the given (dx, dy)

Specified by:
movePinhole in class WorldImage
Parameters:
ddx - the horizontal offset
ddy - the vertical offset

moveTo

public WorldImage moveTo(geometry.Posn p)
Produce the overlay of images with the pinhole moved to the given location

Specified by:
moveTo in class WorldImage
Parameters:
p - the given location

getWidth

public int getWidth()
Produce the width of this image

Specified by:
getWidth in class WorldImage
Returns:
the width of this image

getHeight

public int getHeight()
Produce the height of this image

Specified by:
getHeight in class WorldImage
Returns:
the height of this image