private void FilterRow(int rown)
{
// warning: filters operation rely on: "previos row" (rowbprev) is
// initialized to 0 the first time
if (filterStrat.shouldTestAll(rown)) {
FilterRowNone();
reportResultsForFilter(rown, FilterType.FILTER_NONE, true);
FilterRowSub();
reportResultsForFilter(rown, FilterType.FILTER_SUB, true);
FilterRowUp();
reportResultsForFilter(rown, FilterType.FILTER_UP, true);
FilterRowAverage();
reportResultsForFilter(rown, FilterType.FILTER_AVERAGE, true);
FilterRowPaeth();
reportResultsForFilter(rown, FilterType.FILTER_PAETH, true);
}
FilterType filterType = filterStrat.gimmeFilterType(rown, true);
rowbfilter[0] = (byte)(int)filterType;
switch (filterType) {
case Hjg.Pngcs.FilterType.FILTER_NONE:
FilterRowNone();
break;
case Hjg.Pngcs.FilterType.FILTER_SUB:
FilterRowSub();
break;
case Hjg.Pngcs.FilterType.FILTER_UP:
FilterRowUp();
break;
case Hjg.Pngcs.FilterType.FILTER_AVERAGE:
FilterRowAverage();
break;
case Hjg.Pngcs.FilterType.FILTER_PAETH:
FilterRowPaeth();
break;
default:
throw new PngjOutputException("Filter type " + filterType + " not implemented");
}
reportResultsForFilter(rown, filterType, false);
}