BoundingBox (Javadocs: diewald_CV_kit)

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## diewald_CV_kit.utility
Class BoundingBox

    java.lang.Object
      diewald_CV_kit.utility.BoundingBox

    public final class BoundingBox

extends Object

Author:
  thomas diewald (c) 2011

Constructor Summary
`BoundingBox()` generate a new bounding-box.
`BoundingBox(int x_min, int y_min, int x_max, int y_max)` generate a new bounding-box, and define its bounds.

Method Summary
`boolean` | `inside(int x, int y)` check if the given coordinate is inside the bounding-box.
`boolean` | `inside(Pixel p)` check if the given pixel is inside the bounding-box
`void` | `set(int x_min, int y_min, int x_max, int y_max)` set the bounds of the bounding-box.
`float` | `xCenter()`
`int` | `xMax()`
`int` | `xMin()`
`int` | `xSize()`
`float` | `yCenter()`
`int` | `yMax()`
`int` | `yMin()`
`int` | `ySize()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BoundingBox

    public BoundingBox()

  generate a new bounding-box.

### BoundingBox

    public BoundingBox(int x_min,
                       int y_min,
                       int x_max,
                       int y_max)

  generate a new bounding-box, and define its bounds.

  Parameters:
    `x_min` - minimum x-pos of the bounding-box.
    `y_min` - minimum y-pos of the bounding-box.
    `x_max` - maximum x-pos of the bounding-box.
    `y_max` - maximum y-pos of the bounding-box.

Method Detail

### set

    public final void set(int x_min,
                          int y_min,
                          int x_max,
                          int y_max)

  set the bounds of the bounding-box.

  Parameters:
    `x_min` - minimum x-pos of the bounding-box.
    `y_min` - minimum y-pos of the bounding-box.
    `x_max` - maximum x-pos of the bounding-box.
    `y_max` - maximum y-pos of the bounding-box.

### inside

    public final boolean inside(int x,
                                int y)

  check if the given coordinate is inside the bounding-box.

  Parameters:
    `x` - x-coordinate.
    `y` - y-coordinate.
  Returns:
    true, if the coordinate is inside the bounding-box.

### inside

    public final boolean inside(Pixel p)

  check if the given pixel is inside the bounding-box

  Parameters:
    `p` - the pixel to check for.
  Returns:
    true, if the pixel is inside the bounding-box

### xMin

    public final int xMin()

### yMin

    public final int yMin()

### xMax

    public final int xMax()

### yMax

    public final int yMax()

### xSize

    public final int xSize()

### ySize

    public final int ySize()

### xCenter

    public final float xCenter()

### yCenter

    public final float yCenter()

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Processing library diewald_CV_kit by Thomas Diewald. (C) 2012