// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int positionOf(char value, char[] array) {
//     for (int i = 0; i < array.length; i++) {
//         if (value == array[i]) {
//             return i;
//         }
//     }
//     throw new OkapiException("Unable to find character '" + value + "' in character array.");
// }


import static uk.org.okapibarcode.util.Arrays.positionOf;
import java.util.Arrays;

        placeData(NR, NC);
        grid = new int[W * H];
        for (i = 0; i < (W * H); i++) {
            grid[i] = 0;
        }
        for (y = 0; y < H; y += FH) {
            for (x = 0; x < W; x++) {
                grid[y * W + x] = 1;
            }
            for (x = 0; x < W; x += 2) {
                grid[(y + FH - 1) * W + x] = 1;
            }
        }
        for (x = 0; x < W; x += FW) {
            for (y = 0; y < H; y++) {
                grid[y * W + x] = 1;
            }
            for (y = 0; y < H; y += 2) {
                grid[y * W + x + FW - 1] = 1;
            }
        }
        for (y = 0; y < NR; y++) {
            for (x = 0; x < NC; x++) {
                v = places[(NR - y - 1) * NC + x];
                if (v == 1 || (v > 7 && (target[(v >> 3) - 1] & (1 << (v & 7))) != 0)) {
                    grid[(1 + y + 2 * (y / (FH - 2))) * W + 1 + x + 2 * (x / (FW - 2))] = 1;
                }
            }
        }


// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int positionOf(char value, char[] array) {
//     for (int i = 0; i < array.length; i++) {
//         if (value == array[i]) {
//             return i;
//         }
//     }
//     throw new OkapiException("Unable to find character '" + value + "' in character array.");
// }


// Path: src/main/java/uk/org/okapibarcode/backend/DataMatrix.java
import static uk.org.okapibarcode.util.Arrays.positionOf;
import java.util.Arrays;

        placeData(NR, NC);
        grid = new int[W * H];
        for (i = 0; i < (W * H); i++) {
            grid[i] = 0;
        }
        for (y = 0; y < H; y += FH) {
            for (x = 0; x < W; x++) {
                grid[y * W + x] = 1;
            }
            for (x = 0; x < W; x += 2) {
                grid[(y + FH - 1) * W + x] = 1;
            }
        }
        for (x = 0; x < W; x += FW) {
            for (y = 0; y < H; y++) {
                grid[y * W + x] = 1;
            }
            for (y = 0; y < H; y += 2) {
                grid[y * W + x + FW - 1] = 1;
            }
        }
        for (y = 0; y < NR; y++) {
            for (x = 0; x < NC; x++) {
                v = places[(NR - y - 1) * NC + x];
                if (v == 1 || (v > 7 && (target[(v >> 3) - 1] & (1 << (v & 7))) != 0)) {
                    grid[(1 + y + 2 * (y / (FH - 2))) * W + 1 + x + 2 * (x / (FW - 2))] = 1;
                }
            }
        }


        actualSize = positionOf(symbolsize, INT_SYMBOL) + 1;
