aboutsummaryrefslogtreecommitdiffstats
path: root/libart_lgpl/art_svp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libart_lgpl/art_svp.c')
-rw-r--r--libart_lgpl/art_svp.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/libart_lgpl/art_svp.c b/libart_lgpl/art_svp.c
index 8d7f7d143f..09def996b6 100644
--- a/libart_lgpl/art_svp.c
+++ b/libart_lgpl/art_svp.c
@@ -24,83 +24,6 @@
#include "art_misc.h"
-/* Add a new segment. The arguments can be zero and NULL if the caller
- would rather fill them in later.
-
- We also realloc one auxiliary array of ints of size n_segs if
- desired.
-*/
-/**
- * art_svp_add_segment: Add a segment to an #ArtSVP structure.
- * @p_vp: Pointer to where the #ArtSVP structure is stored.
- * @pn_segs_max: Pointer to the allocated size of *@p_vp.
- * @pn_points_max: Pointer to where auxiliary array is stored.
- * @n_points: Number of points for new segment.
- * @dir: Direction for new segment; 0 is up, 1 is down.
- * @points: Points for new segment.
- * @bbox: Bounding box for new segment.
- *
- * Adds a new segment to an ArtSVP structure. This routine reallocates
- * the structure if necessary, updating *@p_vp and *@pn_segs_max as
- * necessary.
- *
- * The new segment is simply added after all other segments. Thus,
- * this routine should be called in order consistent with the #ArtSVP
- * sorting rules.
- *
- * If the @bbox argument is given, it is simply stored in the new
- * segment. Otherwise (if it is NULL), the bounding box is computed
- * from the @points given.
- **/
-int
-art_svp_add_segment (ArtSVP **p_vp, int *pn_segs_max,
- int **pn_points_max,
- int n_points, int dir, ArtPoint *points,
- ArtDRect *bbox)
-{
- int seg_num;
- ArtSVP *svp;
- ArtSVPSeg *seg;
-
- svp = *p_vp;
- seg_num = svp->n_segs++;
- if (*pn_segs_max == seg_num)
- {
- *pn_segs_max <<= 1;
- svp = (ArtSVP *)art_realloc (svp, sizeof(ArtSVP) +
- (*pn_segs_max - 1) * sizeof(ArtSVPSeg));
- *p_vp = svp;
- if (pn_points_max != NULL)
- *pn_points_max = art_renew (*pn_points_max, int, *pn_segs_max);
- }
- seg = &svp->segs[seg_num];
- seg->n_points = n_points;
- seg->dir = dir;
- seg->points = points;
- if (bbox)
- seg->bbox = *bbox;
- else if (points)
- {
- double x_min, x_max;
- int i;
-
- x_min = x_max = points[0].x;
- for (i = 1; i < n_points; i++)
- {
- if (x_min > points[i].x)
- x_min = points[i].x;
- if (x_max < points[i].x)
- x_max = points[i].x;
- }
- seg->bbox.x0 = x_min;
- seg->bbox.y0 = points[0].y;
-
- seg->bbox.x1 = x_max;
- seg->bbox.y1 = points[n_points - 1].y;
- }
- return seg_num;
-}
-
/**
* art_svp_free: Free an #ArtSVP structure.