| |
| |
| #ifndef BORDERS_EXTRACTOR_H |
| #define BORDERS_EXTRACTOR_H |
| |
| #include "traster.h" |
| #include "runsmap.h" |
| |
| #include "raster_edge_iterator.h" |
| |
| namespace TRop { |
| namespace borders { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename Pix, typename Val> |
| class pixel_selector { |
| public: |
| typedef Pix pixel_type; |
| typedef Val value_type; |
| |
| |
| public: |
| value_type value(const pixel_type &pix) const; |
| bool equal(const pixel_type &a, const pixel_type &b) const { |
| return value(a) == value(b); |
| } |
| |
| value_type transparent() const; |
| bool transparent(const pixel_type &pix) const { |
| return value(pix) == transparent(); |
| } |
| |
| |
| |
| bool skip(const value_type &prevLeftValue, |
| const value_type &leftValue) const { |
| return true; |
| } |
| }; |
| |
| |
| |
| enum RunType { |
| _BORDER_LEFT = 0x20, |
| _BORDER_RIGHT = 0x10, |
| _HIERARCHY_INCREASE = 0x8, |
| _HIERARCHY_DECREASE = 0x4 |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| template <typename Pixel, typename PixelSelector, typename ContainerReader> |
| void readBorders(const TRasterPT<Pixel> &raster, const PixelSelector &selector, |
| ContainerReader &reader, RunsMapP *rasterRunsMap = 0); |
| |
| |
| |
| template <typename PixelSelector, typename Mesh, typename ContainersReader> |
| void readMeshes(const TRasterPT<typename PixelSelector::pixel_type> &raster, |
| const PixelSelector &selector, |
| ContainersReader &meshesDataReader, |
| RunsMapP *rasterRunsMap = 0); |
| } |
| } |
| |
| #endif |
| |
| |
| |
| #ifdef INCLUDE_HPP |
| #include "borders_extractor.hpp" |
| #endif |