third_party/cairo/src/cairo-pattern.c
void
_cairo_gradient_pattern_box_to_parameter (const cairo_gradient_pattern_t *gradient,
					  double x0, double y0,
					  double x1, double y1,
					  double tolerance,
					  double out_range[2])
{
    assert (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR ||
	    gradient->base.type == CAIRO_PATTERN_TYPE_RADIAL);

    if (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR) {
	_cairo_linear_pattern_box_to_parameter ((cairo_linear_pattern_t *) gradient,
						x0, y0, x1, y1, out_range);
    } else {
	_cairo_radial_pattern_box_to_parameter ((cairo_radial_pattern_t *) gradient,
						x0, y0, x1, y1, tolerance, out_range);
    }
}
/**
 * _cairo_gradient_pattern_box_to_parameter:
 *
 * Compute a interpolation range sufficient to draw (within the given
 * tolerance) the gradient in the given box getting the same result as
 * using the (-inf, +inf) range.
 *
 * Assumes that the pattern is not degenerate. This can be guaranteed
 * by simplifying it to a solid clear if _cairo_pattern_is_clear or to
 * a solid color if _cairo_gradient_pattern_is_solid.
 *
 * The range isn't guaranteed to be minimal, but it tries to.
 **/
Compute a interpolation range sufficient to draw (within the given
tolerance) the gradient in the given box getting the same result as
using the (-inf, +inf) range.

Assumes that the pattern is not degenerate. This can be guaranteed
by simplifying it to a solid clear if _cairo_pattern_is_clear or to
a solid color if _cairo_gradient_pattern_is_solid.

The range isn't guaranteed to be minimal, but it tries to.
Compute a interpolation range sufficient to draw ( within the given tolerance ) the gradient in the given box getting the same result as using the ( - inf + inf ) range . Assumes that the pattern is not degenerate . This can be guaranteed by simplifying it to a solid clear if _cairo_pattern_is_clear or to a solid color if _cairo_gradient_pattern_is_solid . The range isn ' t guaranteed to be minimal but it tries to .
void
_cairo_gradient_pattern_box_to_parameter (const cairo_gradient_pattern_t *gradient,
					  double x0, double y0,
					  double x1, double y1,
					  double tolerance,
					  double out_range[2])
{
    assert (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR ||
	    gradient->base.type == CAIRO_PATTERN_TYPE_RADIAL);
    if (gradient->base.type == CAIRO_PATTERN_TYPE_LINEAR) {
	_cairo_linear_pattern_box_to_parameter ((cairo_linear_pattern_t *) gradient,
						x0, y0, x1, y1, out_range);
    } else {
	_cairo_radial_pattern_box_to_parameter ((cairo_radial_pattern_t *) gradient,
						x0, y0, x1, y1, tolerance, out_range);
    }
}
void _cairo_gradient_pattern_box_to_parameter ( const cairo_gradient_pattern_t * gradient , double x0 , double y0 , double x1 , double y1 , double tolerance , double out_range [ 2 ] ) { assert ( gradient -> base . type == CAIRO_PATTERN_TYPE_LINEAR || gradient -> base . type == CAIRO_PATTERN_TYPE_RADIAL ) ; if ( gradient -> base . type == CAIRO_PATTERN_TYPE_LINEAR ) { _cairo_linear_pattern_box_to_parameter ( ( cairo_linear_pattern_t * ) gradient , x0 , y0 , x1 , y1 , out_range ) ; } else { _cairo_radial_pattern_box_to_parameter ( ( cairo_radial_pattern_t * ) gradient , x0 , y0 , x1 , y1 , tolerance , out_range ) ; } }
_cairo_gradient_pattern_box_to_parameter:
 Compute a interpolation range sufficient to draw (within the given
 tolerance) the gradient in the given box getting the same result as
 using the (-inf, +inf) range.
_cairo_gradient_pattern_box_to_parameter : Compute a interpolation range sufficient to draw ( within the given tolerance ) the gradient in the given box getting the same result as using the ( - inf + inf ) range .