示例#1
0
文件: DFilter.cs 项目: vebin/BD2
 static byte ConvertBit(int value, BitDistributionAlgorithm algorithm)
 {
     value ++;
     if (value <= 0) {
         throw new ArgumentException ("value must be a positive integer.(value > 0)", "value");
     }
     switch (algorithm) {
     case BitDistributionAlgorithm.Linear:
         return (byte)Math.Min (value, 255);
     }
     throw new ArgumentOutOfRangeException ("algorithm");
 }
示例#2
0
 static byte ConvertBit(int value, BitDistributionAlgorithm algorithm)
 {
     value++;
     if (value <= 0)
     {
         throw new ArgumentException("value must be a positive integer.(value > 0)", "value");
     }
     switch (algorithm)
     {
     case BitDistributionAlgorithm.Linear:
         return((byte)Math.Min(value, 255));
     }
     throw new ArgumentOutOfRangeException("algorithm");
 }