renderedge.h revision b9a21c3c91c47e090316e28d759194e46628ed49
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Copyright © 2004 Keith Packard
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * documentation for any purpose is hereby granted without fee, provided that
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * the above copyright notice appear in all copies and that both that
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * copyright notice and this permission notice appear in supporting
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * documentation, and that the name of Keith Packard not be used in
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * advertising or publicity pertaining to distribution of the software without
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * specific, written prior permission. Keith Packard makes no
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * representations about the suitability of this software for any purpose. It
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * is provided "as is" without express or implied warranty.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * PERFORMANCE OF THIS SOFTWARE.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * An edge structure. This represents a single polygon edge
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * and can be quickly stepped across small or large gaps in the
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * sample grid
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Step across a small sample grid gap
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync if (edge->e > 0) \
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Step across a large sample grid gap
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync if (edge->e > 0) \
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#endif /* _RENDEREDGE_H_ */