Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## quicktime.qd
Class Region

    java.lang.Object
      |
      +--quicktime.QTObject
            |
            +--quicktime.util.QTHandleRef
                  |
                  +--quicktime.qd.Region

All Implemented Interfaces:
  java.lang.Cloneable, quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QTStreamingLib, quicktime.jdirect.QuickTimeLib, com.apple.jdirect.SharedLibrary, quicktime.jdirect.SharedLibrary

public final class Region
extends QTHandleRef
implements quicktime.jdirect.QuickTimeLib, quicktime.jdirect.QTStreamingLib, java.lang.Cloneable

The Region represents an arbitary area or set of areas on the drawing coordinate plane. Methods are implemented for a corresponding QuickDraw structure used by QuickTime. Refer to Region in QuickTime documentation.

Fields inherited from interface quicktime.jdirect.QuickTimeLib
`JDirect_MacOSX, libraryInstance, name`

Fields inherited from interface quicktime.jdirect.QTStreamingLib
`JDirect_MacOSX, libraryInstance`

Constructor Summary
`Region()` Allocates a new empty region.
`Region(PixMap pMap)` Converts a specified BitMap or PixMap to a region.
`Region(QDRect r)` Allocates a new region specified by a rectangle.

Method Summary
`java.lang.Object` | `clone()` Copies the mathematical structure of the implicit region into a newly created region.
`void` | `close()` Completes the collection of lines or frames that define the Region.
`Region` | `copy()` Copies the mathematical structure of the implicit region into a newly created region.
`Region` | `diff(Region regionB)` Calculates the subtracts the specified explicit region from the implicit region and creates a new region representing that structure.
`boolean` | `empty()` Determines whether a region is empty or not.
`boolean` | `equalRgn(Region rgn)` Compares two regions for sizes, shapes, and locations.
`static Region` | `fromGraphicsImporter(GraphicsImporter gi)` Determines the current clipping region.
`static Region` | `fromGraphicsImporterDefault(GraphicsImporter gi)` Determines the default clipping region.
`static Region` | `fromMovieBounds(Movie m)` This method allows your application to determine a movie's boundary region.
`static Region` | `fromMovieClip(Movie m)` This method allows your application to determine a movie's clipping region.
`static Region` | `fromMovieControllerBadge(MovieController mc, Region movieRgn, boolean returnBadgeRgn)` This method allows you to display a controller's badge.
`static Region` | `fromMovieControllerBounds(MovieController mc)` This method returns the actual region occupied by the controller and its movie, if the movie is attached to the controller.
`static Region` | `fromMovieControllerClip(MovieController mc)` This method allows you to obtain information describing a movie controller's clipping regions.
`static Region` | `fromMovieControllerWindow(MovieController mc, QDGraphics window)` This method allows your application to determine the window region that is actually in use by a controller and its movie.
`static Region` | `fromMovieDisplayBounds(Movie m)` This method allows your application to determine a movie's display boundary region.
`static Region` | `fromMovieDisplayClip(Movie m)` This method allows your application to determine a movie's current display clipping region.
`static Region` | `fromMovieSegment(Movie m, int time, int duration)` This method allows your application to determine a movie's display boundary region during a specified segment.
`static Region` | `fromPresentationClip(Presentation p, Stream s)` This method allows your application to determine a Presentation's clipping region.
`static Region` | `fromTrackBounds(Track t)` This method allows the media to limit the size of the track boundary rectangle.
`static Region` | `fromTrackClip(Track t)` This method allows your application to determine the clipping region of a track.
`static Region` | `fromTrackDisplay(Track t)` This method allows your application to determine the region a track occupies in a movie's graphics world.
`static Region` | `fromTrackMovieBounds(Track t)` This method allows your application to determine the region the track occupies in a movie's boundary region.
`static Region` | `fromTrackSegment(Track t, int time, int duration)` This method allows your application to determine the region a track occupies in a movie's graphics world during a specified segment.
`static Region` | `fromVideoChannel(VisualChannel vc)` Allows you to retrieve a channels clipping region.
`QDRect` | `getBounds()` Returns a copy of the bounding rectangle of the Region.
`QDRect` | `getRgnBBox()` Returns a copy of the bounding rectangle of the Region.
`int` | `getSize()` Returns size of the Region.
`void` | `inset(int dh, int dv)` Moves all points on the region boundary horizontally and vertically by adding the respective parameters to those points.
`void` | `map(QDRect srcRect, QDRect dstRect)` Takes the implicit region with one rectangle, maps and scales it to another rectangle.
`void` | `offset(int dh, int dv)` Moves the region horizontally and vertically by adding the respective parameters to all of the region.
`void` | `open(QDGraphics graphics)` Begins the recording of lines or frames in the specified QDGraphics that when closed will define a Region.
`boolean` | `pointIn(QDPoint pt)` Checks whether the pixel below and to the right of the point is within the region.
`void` | `rect(QDRect r)` Resets the mathematical structure to the specified rectangle.
`boolean` | `rectIn(QDRect srcRect)` Checks whether the specified rectangle intersects the region.
`Region` | `sect(QDRect r)` Calculates the intersection of this region and the incoming QDRect and creates a new region representing that structure.
`Region` | `sect(Region regionB)` Calculates the intersection of two regions and creates a new region representing that structure.
`void` | `setEmpty()` Resets the mathematical structure to the rectangle (0,0,0,0).
`void` | `setRect(int x, int y, int width, int height)` Resets the mathematical structure to the specified coordinates and sizes.
`java.lang.String` | `toString()` Print information about this object.
`Region` | `union(QDRect rect)` Calculates the union of this region and the incoming rect, and creates a new region representing that structure.
`Region` | `union(Region regionB)` Calculates the union of two regions and creates a new region representing that structure.
`Region` | `xor(Region regionB)` Calculates the difference between the union and intersection of two regions and creates a new region representing that structure.

Methods inherited from class quicktime.util.QTHandleRef
`copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, fromCompressionDialogState, fromSCSequence, getBytes, inMemory, isLocked, lock, lockHigh, moveHigh, toQTPointer, toQTPointer, unlock`

Methods inherited from class quicktime.QTObject
`disposeQTObject, equals, ID`

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

Constructor Detail

### Region

    public Region()
           throws QTException

  Allocates a new empty region.
  QuickDraw::NewRgn

### Region

    public Region(QDRect r)
           throws QTException

  Allocates a new region specified by a rectangle.
  QuickDraw::RectRgn
  Parameters:
    `r` - the specified rectangle

### Region

    public Region(PixMap pMap)
           throws QTException

  Converts a specified BitMap or PixMap to a region.
  QuickDraw::BitMapToRegion
  Parameters:
    `pMap` - the specified pixmap

Method Detail

### fromGraphicsImporter

    public static Region fromGraphicsImporter(GraphicsImporter gi)
                                       throws QTException

  Determines the current clipping region.
  QuickTime::GraphicsImportGetClip

  Parameters:
    `gi` - the GraphicsImporter
  Returns:
    The current clip region or null, if not possible
  See Also:
    `GraphicsImporter.getClip()`

### fromGraphicsImporterDefault

    public static Region fromGraphicsImporterDefault(GraphicsImporter gi)
                                              throws QTException

  Determines the default clipping region.
  QuickTime::GraphicsImportGetDefaultClip

  Parameters:
    `gi` - the GraphicsImporter
  Returns:
    The default clip region or null, if not possible
  See Also:
    `GraphicsImporter.getClip()`

### fromMovieDisplayClip

    public static Region fromMovieDisplayClip(Movie m)
                                       throws QTException

  This method allows your application to determine a movie's current display clipping region.
  QuickTime::GetMovieDisplayClipRgn()

  Parameters:
    `m` - the Movie
  Returns:
    a Region object.
  See Also:
    `Movie.getDisplayClipRgn()`

### fromMovieDisplayBounds

    public static Region fromMovieDisplayBounds(Movie m)
                                         throws QTException

  This method allows your application to determine a movie's display boundary region. The display boundary region encloses all of a movie's enabled tracks after the track matrix, track clip, movie matrix, and movie clip have been applied to all of the movie's tracks. This region is in the display coordinate system of the movie's graphics world.
  QuickTime::GetMovieDisplayBoundsRgn()

  Parameters:
    `m` - the Movie
  Returns:
    a Region object.
  See Also:
    `Movie.getDisplayBoundsRgn()`

### fromMovieClip

    public static Region fromMovieClip(Movie m)
                                throws QTException

  This method allows your application to determine a movie's clipping region.
  QuickTime::GetMovieClipRgn()

  Parameters:
    `m` - the Movie
  Returns:
    a Region object.
  See Also:
    `quicktime.std.movies.Movie#getMovieClipRgn`

### fromPresentationClip

    public static Region fromPresentationClip(Presentation p,
                                              Stream s)
                                       throws QTException

  This method allows your application to determine a Presentation's clipping region.

  Parameters:
    `p` - the Presentation
    `s` - the Stream
  Returns:
    a Region object.
  See Also:
    `Presentation.getClip(quicktime.streaming.Stream)`

### fromMovieBounds

    public static Region fromMovieBounds(Movie m)
                                  throws QTException

  This method allows your application to determine a movie's boundary region. This region is in the movie's display coordinate system. The movie boundary region encloses all of a movie's tracks after the union of the track clip and the track matrix has been applied to all the movie's tracks (but not to the movie itself).
  QuickTime::GetMovieBoundsRgn()

  Parameters:
    `m` - the Movie
  Returns:
    a Region object specifying the movie boundary region.
  See Also:
    `Movie.getBoundsRgn()`

### fromMovieSegment

    public static Region fromMovieSegment(Movie m,
                                          int time,
                                          int duration)
                                   throws QTException

  This method allows your application to determine a movie's display boundary region during a specified segment.
  QuickTime::GetMovieSegmentDisplayBoundsRgn()

  Parameters:
    `m` - the Movie
    `time` - Specifies the starting time of the movie segment to consider.
    `duration` - Specifies the length of the segment to consider.
  Returns:
    a Region object.
  See Also:
    `Movie.getSegmentDisplayBoundsRgn(int, int)`

### fromMovieControllerBounds

    public static Region fromMovieControllerBounds(MovieController mc)
                                            throws QTException

  This method returns the actual region occupied by the controller and its movie, if the movie is attached to the controller.
  QuickTime::MCGetControllerBoundsRgn()

  Parameters:
    `mc` - the MovieController
  Returns:
    a Region object specifying the boundary region for this controller.
  See Also:
    `MovieController.getBoundsRgn()`

### fromMovieControllerWindow

    public static Region fromMovieControllerWindow(MovieController mc,
                                                   QDGraphics window)
                                            throws QTException

  This method allows your application to determine the window region that is actually in use by a controller and its movie.
  QuickTime::MCGetWindowRgn()

  Parameters:
    `mc` - the MovieController
    `window` - Specifies the window. This may NOT be null.
  Returns:
    a Region object specifying the window region.
  See Also:
    `MovieController.getWindowRgn(quicktime.qd.QDGraphics)`

### fromMovieControllerClip

    public static Region fromMovieControllerClip(MovieController mc)
                                          throws QTException

  This method allows you to obtain information describing a movie controller's clipping regions.
  QuickTime::MCGetClip()

  Parameters:
    `mc` - the MovieController
  Returns:
    the clipping region of the entire movie controller
  See Also:
    `MovieController.getClip()`

### fromMovieControllerBadge

    public static Region fromMovieControllerBadge(MovieController mc,
                                                  Region movieRgn,
                                                  boolean returnBadgeRgn)
                                           throws QTException

  This method allows you to display a controller's badge.
  QuickTime::MCDrawBadge()

  Parameters:
    `mc` - the MovieController
    `movieRgn` - Specifies the boundary region of the controller's movie.
  Returns:
    A Region that gives information about the location of the badge.
  See Also:
    `MovieController.drawBadge(quicktime.qd.Region, boolean)`

### fromTrackClip

    public static Region fromTrackClip(Track t)
                                throws QTException

  This method allows your application to determine the clipping region of a track.
  QuickTime::GetTrackClipRgn()

  Parameters:
    `t` - the Track
  Returns:
    a Region object specifying the clip region for this track.
  See Also:
    `Track.getClipRgn()`

### fromTrackDisplay

    public static Region fromTrackDisplay(Track t)
                                   throws QTException

  This method allows your application to determine the region a track occupies in a movie's graphics world.
  QuickTime::GetTrackDisplayBoundsRgn()
  Parameters:
    `t` - the Track
  Returns:
    a Region object specifying the track's bounds region.
  See Also:
    `Track.getDisplayBoundsRgn()`

### fromTrackMovieBounds

    public static Region fromTrackMovieBounds(Track t)
                                       throws QTException

  This method allows your application to determine the region the track occupies in a movie's boundary region.
  QuickTime::GetTrackMovieBoundsRgn()

  Parameters:
    `t` - the Track
  Returns:
    a Region object specifying the region the track occupies in a movie's boundary region.
  See Also:
    `Track.getMovieBoundsRgn()`

### fromTrackBounds

    public static Region fromTrackBounds(Track t)
                                  throws QTException

  This method allows the media to limit the size of the track boundary rectangle. Therefore, the region returned by GetTrackBoundsRgn may not be rectangular and may be smaller than the track boundary region.
  QuickTime::GetTrackBoundsRgn()

  Parameters:
    `t` - the Track
  Returns:
    a Region object specifying the region track's media uses to do drawing.
  See Also:
    `Track.getBoundsRgn()`

### fromTrackSegment

    public static Region fromTrackSegment(Track t,
                                          int time,
                                          int duration)
                                   throws QTException

  This method allows your application to determine the region a track occupies in a movie's graphics world during a specified segment.
  QuickTime::GetTrackSegmentDisplayBoundsRgn()

  Parameters:
    `t` - the Track
    `time` - Specifies the starting time of the track segment to consider.
    `duration` - Specifies the length of the segment to consider. Set this parameter to 0 to consider an instant in time.
  See Also:
    `Track.getSegmentDisplayBoundsRgn(int, int)`

### fromVideoChannel

    public static Region fromVideoChannel(VisualChannel vc)
                                   throws QTException

  Allows you to retrieve a channels clipping region.
  QuickTime::SGGetChannelClip QuickTime::SGGetChannelClip

  Parameters:
    `vc` - the VisualChannel
  Returns:
    the clipping region or null if no clip.
  See Also:
    `VisualChannel.getClip()`

### getSize

    public int getSize()

  Returns size of the Region.
  Overrides:
    `getSize` in class `QTHandleRef`
  Following copied from class: `quicktime.util.QTHandleRef`
  Returns:
    the size of the handle

### getRgnBBox

    public QDRect getRgnBBox()

  Returns a copy of the bounding rectangle of the Region.
  Returns:
    a rect

### getBounds

    public QDRect getBounds()

  Returns a copy of the bounding rectangle of the Region.
  Returns:
    a rect

### open

    public void open(QDGraphics graphics)
              throws QDException

  Begins the recording of lines or frames in the specified QDGraphics that when closed will define a Region.
  QuickDraw::OpenRgn
  Parameters:
    `graphics` - the QDGraphics object to record.

### close

    public void close()
               throws QDException

  Completes the collection of lines or frames that define the Region.
  QuickDraw::CloseRgn

### rect

    public void rect(QDRect r)

  Resets the mathematical structure to the specified rectangle. Destroys the previous mathematical structure of the implicit region.
  QuickDraw::RectRgn
  Parameters:
    `r` - the specified rectangle

### copy

    public Region copy()
                throws QTException

  Copies the mathematical structure of the implicit region into a newly created region.
  QuickDraw::CopyRgn
  QuickDraw::MacCopyRgn
  Returns:
    A new region copy.

### clone

    public java.lang.Object clone()

  Copies the mathematical structure of the implicit region into a newly created region.
  QuickDraw::CopyRgn
  Returns:
    A new region copy.

### setEmpty

    public void setEmpty()

  Resets the mathematical structure to the rectangle (0,0,0,0). Destroys the previous mathematical structure of the implicit region.
  QuickDraw::SetEmptyRgn

### setRect

    public void setRect(int x,
                        int y,
                        int width,
                        int height)

  Resets the mathematical structure to the specified coordinates and sizes. Destroys the previous mathematical structure of the implicit region. May reset the structure to the rectangle(0,0,0,0), if bad parameters.
  QuickDraw::SetRectRgn
  QuickDraw::MacSetRectRgn
  Parameters:
    `x` - the specified leftmost position.
    `y` - the specified topmost position.
    `width` - the specified width.
    `height` - the specified height.

### offset

    public void offset(int dh,
                       int dv)

  Moves the region horizontally and vertically by adding the respective parameters to all of the region.
  QuickDraw::OffsetRgn
  QuickDraw::MacOffsetRgn
  Parameters:
    `dh` - the specified horizontal offset.
    `dv` - the specified vertical offset.

### inset

    public void inset(int dh,
                      int dv)

  Moves all points on the region boundary horizontally and vertically by adding the respective parameters to those points.
  QuickDraw::InsetRgn
  Parameters:
    `dh` - the specified horizontal inset.
    `dv` - the specified vertical inset.

### sect

    public Region sect(Region regionB)
                throws QTException

  Calculates the intersection of two regions and creates a new region representing that structure. May return an empty region if no intersection or one of the regions is empty.
  QuickDraw::SectRgn
  Parameters:
    `regionB` - the specified intersecting region.
  Returns:
    The region of intersection.

### sect

    public Region sect(QDRect r)
                throws QTException

  Calculates the intersection of this region and the incoming QDRect and creates a new region representing that structure. May return an empty region if no intersection or one of the regions is empty.
  QuickDraw::SectRgn
  Parameters:
    `r` - the specified intersecting rect.
  Returns:
    The region of intersection.

### union

    public Region union(Region regionB)
                 throws QTException

  Calculates the union of two regions and creates a new region representing that structure. May return an empty region if both regions are empty.
  QuickDraw::UnionRgn
  QuickDraw::MacUnionRgn
  Parameters:
    `regionB` - the specified region to union with.
  Returns:
    The region of union.

### union

    public Region union(QDRect rect)
                 throws QTException

  Calculates the union of this region and the incoming rect, and creates a new region representing that structure. May return an empty region if both regions are empty.
  QuickDraw::UnionRgn
  Parameters:
    `rect` - the specified rect to union with.
  Returns:
    The region of union.

### diff

    public Region diff(Region regionB)
                throws QTException

  Calculates the subtracts the specified explicit region from the implicit region and creates a new region representing that structure. May return an empty region if the implicit region is empty.
  QuickDraw::DiffRgn
  Parameters:
    `regionB` - the specified region to find difference with.
  Returns:
    The region of difference.

### xor

    public Region xor(Region regionB)
               throws QTException

  Calculates the difference between the union and intersection of two regions and creates a new region representing that structure. May return an empty region if both regions are coincident.
  QuickDraw::XorRgn
  QuickDraw::MacXorRgn
  Parameters:
    `regionB` - the specified region to xor with.
  Returns:
    The region of exclusively or.

### rectIn

    public boolean rectIn(QDRect srcRect)

  Checks whether the specified rectangle intersects the region.
  QuickDraw::RectInRgn
  Parameters:
    `srcRect` - the specified source rectangle
  Returns:
    True if at least one bit of the rectangle is contained by the region, false otherwise.

### equalRgn

    public boolean equalRgn(Region rgn)

  Compares two regions for sizes, shapes, and locations.
  QuickDraw::EqualRgn
  QuickDraw::MacEqualRgn
  Parameters:
    `obj` - the specified comparision region
  Returns:
    true if both regions' sizes, shapes, and locations are identical, false otherwise.

### empty

    public boolean empty()

  Determines whether a region is empty or not.
  QuickDraw::EmptyRgn
  Returns:
    True if region is empty, false otherwise.

### map

    public void map(QDRect srcRect,
                    QDRect dstRect)

  Takes the implicit region with one rectangle, maps and scales it to another rectangle.
  QuickDraw::MapRgn
  Parameters:
    `srcRect` - the specified source rectangle
    `dstRect` - the specified destination rectangle

### pointIn

    public boolean pointIn(QDPoint pt)

  Checks whether the pixel below and to the right of the point is within the region.
  QuickDraw::PtInRgn
  Parameters:
    `pt` - the specified point.
  Returns:
    True if pt is contained by the region, false otherwise.

### toString

    public java.lang.String toString()

  Print information about this object.
  Overrides:
    `toString` in class `QTHandleRef`
  Returns:
    a string representing this Region object

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD