$OpenBSD: patch-src_assemble_h,v 1.1.1.1 2009/04/19 11:14:37 sthen Exp $ --- src/assemble.h.orig Sat Mar 8 23:16:23 2008 +++ src/assemble.h Fri Apr 17 20:18:16 2009 @@ -81,14 +81,18 @@ void checkpoint(pair &p, Image Threshold, AlphaAccessor> ThresholdingAccessor; + AlphaType* alphaType = p.second; + ImagePixelComponentType alphaMaxValue = AlphaTraits::max(); + ImagePixelComponentType alphaZeroValue = AlphaTraits::zero(); + AlphaPixelType numericZeroValue = NumericTraits::zero(); + Threshold curThreshold = + Threshold(numericZeroValue, + numericZeroValue, + alphaMaxValue, + alphaZeroValue); ThresholdingAccessor ata( - Threshold( - NumericTraits::zero(), - NumericTraits::zero(), - AlphaTraits::max(), - AlphaTraits::zero() - ), - (p.second)->accessor()); + curThreshold, + alphaType->accessor()); try { exportImageAlpha(srcImageRange(*(p.first)), @@ -118,12 +122,15 @@ void import(const ImageImportInfo &info, // Threshold the alpha mask so that all pixels are either contributing // or not contributing. + ImagePixelComponentType imagePixelMaxValue = AlphaTraits::max(); + AlphaPixelType alphaPixelMaxValue = AlphaTraits::max(); + AlphaPixelType alphaPixelZeroValue = AlphaTraits::zero(); ThresholdingAccessor ata( Threshold( - AlphaTraits::max() / 2, - AlphaTraits::max(), - AlphaTraits::zero(), - AlphaTraits::max() + imagePixelMaxValue / 2, + imagePixelMaxValue, + alphaPixelZeroValue, + alphaPixelMaxValue ), alpha.second);