Developer

API Reference

IDrawDecorator_IntersectOpaque()

Brew Release
Brew MP 1.0.2
See Also
- IDrawDecorator
- IDecorator_IntersectOpaque
Description
This function retrieves the intersection of a given rectangle with the largest opaque region of a given draw decorator. To illustrate, consider the diagram below:
   
   +--------------------+
   |                    |
   |       source     -----------+ result of IDrawDecorator_IntersectOpaque()
   |     rectangle   |  |
   |                 V  |
   |            +---------------------------------------+
   |            |/ / / /|                               |
   |            | / / / |    target draw decorator      |
   |            |/ / / /|                               |
   +------------|-------                                |
                |                                       |
                +---------------------------------------+


The function determines where the extent of the target draw decorator and the source rectangle overlap -- subtracting out, however, areas that lack opacity. So, for example, if the draw decorator itself was transparent (i.e. it has no children or the background of the child widget has been set to be transparent), the rectangle that enclosed those transparent areas would not included in the calculated result.
If the rectangles intersect, IDrawDecorator_IntersectOpaque() will return TRUE, otherwise the function returns FALSE and the resultant rectangle is empty.
IDrawDecorator_IntersectOpaque() inherits wholly from IDecorator_IntersectOpaque().
Parameters
  • pif
    []:
    Pointer to the IDrawDecorator object to be used as a target for intersection.
  • prcDest
    []:
    Pointer to an AEERect, into which the function will return the intersection of the draw decorator's largest opaque rectangle and the rectangle passed to the function in 'prcIn'.
  • prcIn
    []:
    Pointer to the AEERect that is to be intersected with the draw decorator's largest opaque rectangle. This rectangle should be expressed in the target widget's coordinate system, with (0,0) being the top-left corner of the widget.
Prototype
   boolean IDrawDecorator_IntersectOpaque(IDrawDecorator *pif, AEERect *prcDest, const AEERect *prcIn);
   
Return
   TRUE   -  If 'prcIn' intersects with the draw decorator's largest opaque rectangle.
   FALSE  -  If 'prcIn' does not intersect with the draw decorator largest opaque rectangle.

The intersection of 'prcIn' and the draw decorator's largest opaque rectangle will be returned in 'prcDest', or returns the empty rectangle (0, 0, 0, 0) if the decorator is not wrapped around a widget (making the decorator, essentially, transparent).
Side Effect
None
Comment
By definition, the rectangle returned in 'prcDest' can be no larger than the rectangle passed to the function in 'prcIn'.
The largest opaque rectangle for an object is defined to be the largest rectangle required to capture all opaque points and regions within an object. So, for example, an object that looks something like this:
      +-------------------------------------------------------+
      |                                                       |
      |                                                       |
      |      #######                                          |
      |      #######                                          |
      |      #######                                          |
      |                              ##                       |
      |                              ##                       |
      |                  #######                              |
      |                   #######                             |
      |                    #######                            |  # indicates opaque
      |                     #######                           |    regions within the
      |                      #######                          |    object.  All other
      |            ##                                         |    area is transparent
      |           ####                                        |
      |          ######                                       |
      |         ########                                      |
      |        ##########                                     |
      |       ############                                    |
      |                                             ##        |
      |                                            ####       |
      |                                             ##        |
      |                                                       |
      |                                                       |
      +-------------------------------------------------------+

When expressed as its "largest opaque rectangle", the following rectangle would result (and subsequently compared to the source rectangle passed into the function to determine the intersecting rectangle):
      +-------------------------------------------------------+
      |                                                       |
      |                                                       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |  # indicates area
      |      ##########################################       |    enclosed by the
      |      ##########################################       |    largest opaque
      |      ##########################################       |    rectangle
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |      ##########################################       |
      |                                                       |
      |                                                       |
      +-------------------------------------------------------+
  • Follow