Mercurial > projects > dwt-mac
diff dwt/internal/image/JPEGQuantizationTable.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 1a8b3cb347e0 |
children | 5123b17c98ef |
line wrap: on
line diff
--- a/dwt/internal/image/JPEGQuantizationTable.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/internal/image/JPEGQuantizationTable.d Wed Aug 27 14:30:35 2008 +0200 @@ -13,7 +13,7 @@ final class JPEGQuantizationTable : JPEGVariableSizeSegment { public static byte[] DefaultLuminanceQTable = { - (byte)255, (byte)219, 0, 67, 0, + cast(byte)255, cast(byte)219, 0, 67, 0, 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, @@ -24,7 +24,7 @@ 72, 92, 95, 98, 112, 100, 103, 99 }; public static byte[] DefaultChrominanceQTable = { - (byte)255, (byte)219, 0, 67, 1, + cast(byte)255, cast(byte)219, 0, 67, 1, 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, @@ -141,7 +141,7 @@ int temp = ((reference[i] & 0xFF) * qFactor + 50) / 100; if (temp <= 0) temp = 1; if (temp > 255) temp = 255; - reference[i] = (byte)temp; + reference[i] = cast(byte)temp; } ofs += 65; totalLength -= 65; @@ -150,8 +150,8 @@ int temp = (((reference[i] & 0xFF) * 256 + (reference[i + 1] & 0xFF)) * qFactor + 50) / 100; if (temp <= 0) temp = 1; if (temp > 32767) temp = 32767; - reference[i] = (byte)(temp >> 8); - reference[i + 1] = (byte)(temp & 0xFF); + reference[i] = cast(byte)(temp >> 8); + reference[i + 1] = cast(byte)(temp & 0xFF); } ofs += 129; totalLength -= 129;