From: Enblend <enb...@li...> - 2012-10-24 07:03:57
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hgroot/enblend/enblend/rev/c4e79d254b33 changeset: 812:c4e79d254b33 user: Chris <cs...@us...> date: Wed Oct 24 08:54:04 2012 +0200 description: Remove libXMI - Part 4 of 4: Remove old, XMI-based polygon filler. Remove the dependency on libXMI. The two implementations "new" and "new-active" (default) are still selectable via commandline parameter. diffstat: NEWS | 20 +++- VERSION | 2 +- configure.in | 5 - doc/enblend.info | 0 doc/enfuse.info | 0 doc/versenblend.texi | 4 +- doc/versenfuse.texi | 4 +- include/vigra_ext/Makefile.am | 3 +- include/vigra_ext/XMIWrapper.h | 146 ----------------------------------------- src/mask.h | 52 -------------- 10 files changed, 19 insertions(+), 217 deletions(-) diffs (329 lines): diff -r 29ec0c175c5a -r c4e79d254b33 NEWS --- a/NEWS Wed Oct 10 00:04:50 2012 +0200 +++ b/NEWS Wed Oct 24 08:54:04 2012 +0200 @@ -1,4 +1,4 @@ -* Version 4.1 ("touble in paradise") +* Version 4.1 "Touble In Paradise" Unreleased. Current line of development. @@ -114,12 +114,6 @@ ** Developer Stuff -- Enblend and Enfuse now use LittleCMS version 2.x. - -- Enblend and Enfuse no longer rely on their own versions of the Vigra - imaging library. Vigra version 1.8 or later is now required to - build. - - XHTML validation does not rely on network access anymore. This means all necessary DTDs must be available locally and all catalogs must be set up correctly to build the XHTML documentation. @@ -134,6 +128,18 @@ "common.h". +** Package Maintainer Stuff + +- Enblend and Enfuse now use LittleCMS version 2.x. + +- Enblend and Enfuse no longer rely on their own versions of the Vigra + imaging library. Vigra version 1.8 or later is now required to + build. + +- Enblend no longer relies on libXMI. (Enfuse never needed this + library.) + + * Version 4.0 Released on December 13, 2009. diff -r 29ec0c175c5a -r c4e79d254b33 VERSION --- a/VERSION Wed Oct 10 00:04:50 2012 +0200 +++ b/VERSION Wed Oct 24 08:54:04 2012 +0200 @@ -1,1 +1,1 @@ -4.1-8bb2b640886a +4.1-29ec0c175c5a diff -r 29ec0c175c5a -r c4e79d254b33 configure.in --- a/configure.in Wed Oct 10 00:04:50 2012 +0200 +++ b/configure.in Wed Oct 24 08:54:04 2012 +0200 @@ -39,9 +39,6 @@ AC_CHECK_LIB(lcms2, cmsCreateTransform, [], AC_MSG_ERROR([liblcms2 is required to compile Enblend.]), []) -AC_CHECK_LIB(xmi, miNewPaintedSet, - [], - AC_MSG_ERROR([libxmi is required to compile Enblend.]), []) AC_MSG_CHECKING([for Vigra import/export-library]) LIBS="-lvigraimpex $LIBS" @@ -306,8 +303,6 @@ AC_CHECK_HEADER(lcms2.h, [], AC_MSG_ERROR([lcms2 header files are required to compile Enblend.])) -AC_CHECK_HEADER(xmi.h, [], - AC_MSG_ERROR([xmi header files are required to compile Enblend.])) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL diff -r 29ec0c175c5a -r c4e79d254b33 doc/enblend.info Binary file doc/enblend.info has changed diff -r 29ec0c175c5a -r c4e79d254b33 doc/enfuse.info Binary file doc/enfuse.info has changed diff -r 29ec0c175c5a -r c4e79d254b33 doc/versenblend.texi --- a/doc/versenblend.texi Wed Oct 10 00:04:50 2012 +0200 +++ b/doc/versenblend.texi Wed Oct 24 08:54:04 2012 +0200 @@ -1,4 +1,4 @@ @set UPDATED 3 September 2012 @set UPDATED-MONTH September 2012 -@set EDITION 4.1-b7fcb07816a1 -@set VERSION 4.1-b7fcb07816a1 +@set EDITION 4.1-29ec0c175c5a +@set VERSION 4.1-29ec0c175c5a diff -r 29ec0c175c5a -r c4e79d254b33 doc/versenfuse.texi --- a/doc/versenfuse.texi Wed Oct 10 00:04:50 2012 +0200 +++ b/doc/versenfuse.texi Wed Oct 24 08:54:04 2012 +0200 @@ -1,4 +1,4 @@ @set UPDATED 3 September 2012 @set UPDATED-MONTH September 2012 -@set EDITION 4.1-b7fcb07816a1 -@set VERSION 4.1-b7fcb07816a1 +@set EDITION 4.1-29ec0c175c5a +@set VERSION 4.1-29ec0c175c5a diff -r 29ec0c175c5a -r c4e79d254b33 include/vigra_ext/Makefile.am --- a/include/vigra_ext/Makefile.am Wed Oct 10 00:04:50 2012 +0200 +++ b/include/vigra_ext/Makefile.am Wed Oct 24 08:54:04 2012 +0200 @@ -3,5 +3,4 @@ functoraccessor.hxx \ impexalpha.hxx \ rect2d.hxx \ - stdcachedfileimage.hxx \ - XMIWrapper.h + stdcachedfileimage.hxx diff -r 29ec0c175c5a -r c4e79d254b33 include/vigra_ext/XMIWrapper.h --- a/include/vigra_ext/XMIWrapper.h Wed Oct 10 00:04:50 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2004-2009 Andrew Mihal - * - * This file is part of Enblend. - * - * Enblend is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * Enblend is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Enblend; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __XMIWRAPPER_H__ -#define __XMIWRAPPER_H__ - -extern "C" -{ -#include <xmi.h> -} - - -/* This is the public include file for the miPaintedSet module, contained - in mi_spans.c. */ - -/* A Spans structure is a sorted list of spans, i.e. a list of point ranges - [xmin,xmax], sorted in increasing y order. There may be more than one - span at a given y. */ - -typedef struct -{ - int count; /* number of spans */ - miPoint *points; /* pointer to list of start points */ - unsigned int *widths; /* pointer to list of widths */ -} Spans; - - -/* A SpanGroup is an unsorted list of Spans's, associated with a particular - pixel value. - - A SpanGroup is allowed to include more than a single Spans because most - libxmi drawing functions write out multiple Spans's. */ - -typedef struct -{ - miPixel pixel; /* pixel value */ - Spans *group; /* Spans slots */ - int size; /* number of Spans slots allocated */ - int count; /* number of Spans slots filled */ - int ymin, ymax; /* min, max y values over all Spans's */ -} SpanGroup; - - -/* A miPaintedSet structure is an array of SpanGroups, specifying the - partition into differently painted subsets. There is at most one - SpanGroup for any pixel. */ - -typedef struct lib_miPaintedSet -{ - SpanGroup **groups; /* SpanGroup slots */ - int size; /* number of SpanGroup slots allocated */ - int ngroups; /* number of SpanGroup slots filled */ -} _miPaintedSet; - - -namespace vigra_ext -{ - -template<class DestIterator, class DestAccessor> -void copyPaintedSetToImage(DestIterator dest_upperleft, - DestIterator dest_lowerright, - DestAccessor da, - const miPaintedSet* paintedSet, - const vigra::Diff2D offset) -{ - const vigra::Diff2D size(dest_lowerright - dest_upperleft); - - for (int group = 0; group < paintedSet->ngroups; group++) - { - if (paintedSet->groups[group]->group[0].count > 0) - { - const miPixel pixel = paintedSet->groups[group]->pixel; - const int spans = paintedSet->groups[group]->group[0].count; - const miPoint* ppt = paintedSet->groups[group]->group[0].points; - const unsigned int* pwidth = paintedSet->groups[group]->group[0].widths; - - if (ppt[0].y + offset.y >= size.y) - { - continue; - } - if (ppt[spans - 1].y + offset.y < 0) - { - continue; - } - - for (int i = 0; i < spans; i++) - { - int y = ppt[i].y + offset.y; - if (y < 0) - { - continue; - } - if (y >= size.y) - { - continue; - } - - int width = pwidth[i]; - int xstart = ppt[i].x + offset.x; - int xend = xstart + width - 1; - - const int xstart_clip = xstart < 0 ? 0 : xstart; - const int xend_clip = xend >= size.x ? size.x - 1 : xend; - - DestIterator dx = dest_upperleft + vigra::Diff2D(xstart_clip, y); - for (int x = xstart_clip; x <= xend_clip; ++x, ++dx.x) - { - da.set(pixel, dx); - } - } - } - } -} - - -template<class DestIterator, class DestAccessor> -void copyPaintedSetToImage(vigra::triple<DestIterator, DestIterator, DestAccessor> image, - const miPaintedSet* paintedSet, - const vigra::Diff2D offset) -{ - copyPaintedSetToImage(image.first, image.second, image.third, paintedSet, offset); -} - -} // namespace vigra_ext - -#endif /* __XMIWRAPPER_H__ */ - -// Local Variables: -// mode: c++ -// End: diff -r 29ec0c175c5a -r c4e79d254b33 src/mask.h --- a/src/mask.h Wed Oct 10 00:04:50 2012 +0200 +++ b/src/mask.h Wed Oct 24 08:54:04 2012 +0200 @@ -45,7 +45,6 @@ #include "vigra_ext/impexalpha.hxx" #include "vigra_ext/rect2d.hxx" #include "vigra_ext/stdcachedfileimage.hxx" -#include "vigra_ext/XMIWrapper.h" #include "common.h" #include "anneal.h" @@ -367,52 +366,6 @@ }; -template <typename MaskType> -void fillContourXMI(MaskType* mask, const Contour& contour, const vigra::Diff2D& offset) -{ - typedef typename MaskType::PixelType MaskPixelType; - typedef typename MaskType::Accessor MaskAccessor; - typedef vigra::NumericTraits<MaskPixelType> MaskPixelTraits; - - const size_t totalPoints = - std::accumulate(contour.begin(), contour.end(), 0U, ret<size_t>(_1 + bind(&Segment::size, _2))); - - if (totalPoints == 0U) { - return; - } - - miPixel pixels[2] = {MaskPixelTraits::max(), MaskPixelTraits::max()}; - miGC* pGC = miNewGC(2, pixels); - miPoint* const points = new miPoint[totalPoints]; - miPoint* p = points; - - for (Contour::const_iterator currentSegment = contour.begin(); - currentSegment != contour.end(); - ++currentSegment) { - for (Segment::iterator vertexIterator = (*currentSegment)->begin(); - vertexIterator != (*currentSegment)->end(); - ++vertexIterator, ++p) { - p->x = vertexIterator->second.x; - p->y = vertexIterator->second.y; - } - } - - miPaintedSet* paintedSet = miNewPaintedSet(); - miFillPolygon(paintedSet, pGC, - MI_SHAPE_GENERAL, MI_COORD_MODE_ORIGIN, - totalPoints, points); - - delete [] points; - - vigra_ext::copyPaintedSetToImage(mask->upperLeft(), mask->lowerRight(), - XorAccessor<MaskPixelType, MaskAccessor>(mask->accessor()), - paintedSet, offset); - - miDeletePaintedSet(paintedSet); - miDeleteGC(pGC); -} - - template <class BackInsertionIterator> void closedPolygonsOfContourSegments(const vigra::Size2D& mask_size, const Contour& contour, BackInsertionIterator result) @@ -529,11 +482,6 @@ std::cout << "+ fillContour: use fillContourScanLine polygon filler\n"; #endif fillContourScanLine(mask, contour, offset); - } else if (routine_name == "xmi") { -#ifdef DEBUG_POLYGON_FILL - std::cout << "+ fillContour: use fillContourXMI polygon filler\n"; -#endif - fillContourXMI(mask, contour, offset); } else { #ifdef DEBUG_POLYGON_FILL std::cout << "+ fillContour: use fillContourScanLineActive polygon filler\n"; |