#ifndef INKSCAPE_LIVAROT_FLOAT_LINE_H
#define INKSCAPE_LIVAROT_FLOAT_LINE_H
/** \file
* Coverage with floating-point boundaries.
*/
#include <vector>
#include "livarot/LivarotDefs.h"
/// A coverage portion ("run") with floating point boundaries.
struct float_ligne_run {
float st;
float en;
float vst;
float ven;
};
/**
* A floating-point boundary.
*
* Each float_ligne_bord is a boundary of some coverage.
* The Flatten() function will extract non-overlapping runs and produce an
* array of float_ligne_run. The float_ligne_bord are stored in an array, but
* linked like a doubly-linked list.
*
* The idea behind that is that a given edge produces one float_ligne_bord at
* the beginning of Scan() and possibly another in AvanceEdge() and
* DestroyEdge(); but that second float_ligne_bord will not be far away in
* the list from the first, so it's faster to salvage the index of the first
* float_ligne_bord and try to insert the second from that salvaged position.
*/
struct float_ligne_bord {
int other; ///< index, in the array of float_ligne_bord, of the other boundary associated to this one
///< coverage portion being scanned (in the Flatten() )
int pend_inv; ///< inverse of pend_ind, for faster handling of insertion/removal in the "pending" array
};
/**
* Coverage with floating-point boundaries.
*
* The goal is to salvage exact coverage info in the sweepline performed by
* Scan() or QuickScan(), then clean up a bit, convert floating point bounds
* to integer bounds, because pixel have integer bounds, and then raster runs
* of the type:
* \verbatim
position on the (pixel) line: st en
| |
coverage value (0=empty, 1=full) vst -> ven \endverbatim
*/
/// first boundary in the doubly-linked list
int s_first;
/// last boundary in the doubly-linked list
int s_last;
FloatLigne();
virtual ~FloatLigne();
void Reset();
void Flatten();
void Affiche();
void Copy(FloatLigne *a);
return 1;
}
return -1;
}
return 0;
}
};
};
};
#endif
/*
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:fileencoding=utf-8:textwidth=99 :