nr-rect.cpp revision 385709d739bf6cc29c933d533868f011ebc9fd73
#define __NR_RECT_C__
/*
* Pixel buffer rendering library
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* This code is in public domain
*/
#include "nr-rect-l.h"
{}
if (rect) {
} else {
nr_rect_d_set_empty(this);
}
}
if (nr_rect_d_test_empty(this)) {
} else {
}
}
/**
* \param r0 Rectangle.
* \param r1 Another rectangle.
* \param d Filled in with the intersection of r0 and r1.
* \return d.
*/
{
d->x0 = t;
d->y0 = t;
return d;
}
NRRect *
{
d->x0 = t;
d->y0 = t;
return d;
}
// returns minimal rect which covers all of r0 not covered by r1
NRRectL *
{
nr_rect_l_set_empty (d);
} else {
}
return d;
}
{
if (!r || NR_RECT_DFLS_TEST_EMPTY (r)) {
return 0;
}
}
NRRect *
{
if (NR_RECT_DFLS_TEST_EMPTY (r0)) {
if (NR_RECT_DFLS_TEST_EMPTY (r1)) {
nr_rect_d_set_empty (d);
} else {
*d = *r1;
}
} else {
if (NR_RECT_DFLS_TEST_EMPTY (r1)) {
*d = *r0;
} else {
d->x0 = t;
d->y0 = t;
}
}
return d;
}
NRRectL *
{
if (NR_RECT_DFLS_TEST_EMPTY (r0)) {
if (NR_RECT_DFLS_TEST_EMPTY (r1)) {
nr_rect_l_set_empty (d);
} else {
*d = *r1;
}
} else {
if (NR_RECT_DFLS_TEST_EMPTY (r1)) {
*d = *r0;
} else {
d->x0 = t;
d->y0 = t;
}
}
return d;
}
NRRect *
{
using NR::X;
using NR::Y;
return nr_rect_d_union_xy(dst, p[X], p[Y]);
}
NRRect *
{
} else {
}
return d;
}
NRRect *
{
using NR::X;
using NR::Y;
if (nr_rect_d_test_empty(s)) {
} else {
}
return d;
}
NRRect *
{
return nr_rect_d_matrix_transform(d, s, *m);
}
/** Enlarges the rectangle given amount of pixels to all directions */
NRRectL *
{
return d;
}
namespace NR {
/** returns the four corners of the rectangle in the correct winding order */
switch (i % 4) {
case 0:
return _min;
case 1:
case 2:
return _max;
default: /* i.e. 3 */
}
}
/** returns the midpoint of this rectangle */
}
/** returns a vector from topleft to bottom right. */
}
/** Translates the rectangle by p. */
_min += p;
_max += p;
}
/** Makes this rectangle large enough to include the point p. */
for ( int i=0 ; i < 2 ; i++ ) {
}
}
/** Returns the set of points shared by both rectangles. */
if ( !a || !b ) {
return Nothing();
} else {
Rect r;
for ( int i=0 ; i < 2 ; i++ ) {
return Nothing();
}
}
return r;
}
}
/** returns the smallest rectangle containing both rectangles */
Rect r;
for ( int i=0 ; i < 2 ; i++ ) {
}
return r;
}
} // namespace NR
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :