Ejemplo n.º 1
0
 public static ColorRemappingGeneral GetColorRemappingFilterUnlinked(
     IImageStatistics redStatistics,
     IImageStatistics greenStatistics,
     IImageStatistics blueStatistics,
     double targetHistogramMeanPct,
     double shadowsClipping,
     System.Windows.Media.PixelFormat pf)
 {
     ushort[] mapRed   = GetStretchMap(redStatistics, targetHistogramMeanPct, shadowsClipping);
     ushort[] mapGreen = GetStretchMap(greenStatistics, targetHistogramMeanPct, shadowsClipping);
     ushort[] mapBlue  = GetStretchMap(blueStatistics, targetHistogramMeanPct, shadowsClipping);
     if (pf == PixelFormats.Rgb48)
     {
         var filter = new ColorRemappingGeneral(mapRed, mapGreen, mapBlue);
         return(filter);
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Ejemplo n.º 2
0
        public static ColorRemappingGeneral GetColorRemappingFilter(
            IImageStatistics statistics,
            double targetHistogramMeanPct,
            double shadowsClipping,
            System.Windows.Media.PixelFormat pf)
        {
            ushort[] map = GetStretchMap(statistics, targetHistogramMeanPct, shadowsClipping);

            if (pf == PixelFormats.Gray16)
            {
                var filter = new ColorRemappingGeneral(map);
                return(filter);
            }
            else if (pf == PixelFormats.Rgb48)
            {
                var filter = new ColorRemappingGeneral(map, map, map);
                return(filter);
            }
            else
            {
                throw new NotSupportedException();
            }
        }