Constructor and Description |
---|
ColoredOverlayCollection()
Create an empty collection.
|
ColoredOverlayCollection(OverlayCollection overlays,
ColorList colors) |
Modifier and Type | Method and Description |
---|---|
void |
add(Overlay overlay,
RGBColor color)
Append an overlay and its respective color to the end of the list..
|
RGBColor |
getColor(int index)
Access a particular color in the collection by index.
|
ColorList |
getColors()
The list of colors, each element corresponding to
overlays . |
Overlay |
getOverlay(int index)
Access a particular
Overlay in the collection by index. |
OverlayCollection |
getOverlays()
The collection of overlays, each element corresponding to
colors . |
Iterator<Overlay> |
iterator() |
int |
size()
The total number of elements in the list.
|
ColoredOverlayCollection |
subsetWhereBoxIntersects(Dimensions scene,
DrawOverlay drawOverlay,
List<BoundingBox> toIntersectWith)
Find overlays whose bounding-boxes intersect with any of the boxes in
toIntersectWith . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ColoredOverlayCollection()
public ColoredOverlayCollection(OverlayCollection overlays, ColorList colors)
public void add(Overlay overlay, RGBColor color)
overlay
- the overlay to append.color
- the corresponding color of the overlay.public int size()
public Overlay getOverlay(int index)
Overlay
in the collection by index.index
- the index (starting at 0).index
.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index
>= size())public RGBColor getColor(int index)
index
- the index (starting at 0).index
.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index
>= size())public ColoredOverlayCollection subsetWhereBoxIntersects(Dimensions scene, DrawOverlay drawOverlay, List<BoundingBox> toIntersectWith)
toIntersectWith
.scene
- the size of the image in which all bounding-boxes must fully fit inside.drawOverlay
- what draws the overlays on the image, and thus determines the bounding-box
of an overlay.toIntersectWith
- the list of boxes against which elements are searched for any
intersection.ColoredOverlayCollection
containing the elements (uncopied)
which match the criteria. This may be empty if no elements match the criteria.public OverlayCollection getOverlays()
colors
.public ColorList getColors()
overlays
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.