BillboardMarker
object can be used to
"paste" an advertisement on a virtual billboard.
Camera
attribute. This attribute
must be initialized by the explicit value constructor.
/** * Explicit Value Constructor * * @param camera The Camera to use when marking virtual billboards */ public BillboardMarker(Camera camera)
/** * "Paste" (i.e., place) an advertisment on a billboard * * @param image The image containing a virtual billboard * @param ad The image to place on the virtual billboard * @param index The index of the virtual billboard * @return A copy of the image with the billboard added */ public Color[][] paste(Color[][] image, Color[][] ad, int index) throws SizeMismatchException
This method must throw a SizeMismatchException
if: the
size of the ad differs from the size of the virtual billboard it is
supposed to be pasted on. If the ad is null, this method must
return a copy of the original image. Otherwise, it must
return an appopriately modified copy of the
image
.
The position and size of the virtual billboard
can be obtained from the Camera
class. However it is
important to observe that the virtual billboard may be partially
obscured. Hence, this method must check each pixel in the
virtual billboard to see if it is obscured.
The "idealized" color of the virtual billboard can be obtained from
the Camera
class. However, since the actual color
may differ somewhat, this method must use the areSimilar()
method in the ImageManipulator
class.
Copyright 2011