Exemplo n.º 1
0
        // The mask penalty calculation is complicated.  See Table 21 of JISX0510:2004 (p.45) for details.
        // Basically it applies four rules and summate all penalties.
        private static int calculateMaskPenalty(ByteMatrix matrix)
        {
            int penalty = 0;

            penalty += MaskUtil.applyMaskPenaltyRule1(matrix);
            penalty += MaskUtil.applyMaskPenaltyRule2(matrix);
            penalty += MaskUtil.applyMaskPenaltyRule3(matrix);
            penalty += MaskUtil.applyMaskPenaltyRule4(matrix);
            return(penalty);
        }
Exemplo n.º 2
0
 // The mask penalty calculation is complicated.  See Table 21 of JISX0510:2004 (p.45) for details.
 // Basically it applies four rules and summate all penalties.
 private static int calculateMaskPenalty(ByteMatrix matrix)
 {
     return(MaskUtil.applyMaskPenaltyRule1(matrix) + MaskUtil.applyMaskPenaltyRule2(matrix) + MaskUtil.applyMaskPenaltyRule3(matrix) + MaskUtil.applyMaskPenaltyRule4(matrix));
 }