53void calcEdgesGL(std::span<const uint32_t> curr, std::span<const uint32_t> next,
54 std::span<Endian::L32> edges2, EdgeOp edgeOp)
95 auto size = curr.size();
96 assert(next.size() == size);
97 assert(2 * edges2.size() == size);
99 using Pixel = uint32_t;
101 uint32_t pattern = 0;
104 if (edgeOp(c5, c8)) pattern |= 0x1800'0000;
106 auto size2 = size / 2;
107 for (
auto xx :
xrange(size2 - 1)) {
108 pattern = (pattern >> (16 + 9)) & 0x001C;
109 pattern |= (edges2[xx] << 3) & 0xC460'C460;
111 if (edgeOp(c5, c8)) pattern |= 0x0000'0080;
112 Pixel c6 = curr[2 * xx + 1];
113 if (edgeOp(c6, c8)) pattern |= 0x0004'0800;
114 if (edgeOp(c5, c6)) pattern |= 0x0010'2000;
115 Pixel c9 = next[2 * xx + 1];
116 if (edgeOp(c5, c9)) pattern |= 0x0008'1000;
118 if (edgeOp(c6, c9)) pattern |= 0x0080'0000;
119 c5 = curr[2 * xx + 2];
120 if (edgeOp(c5, c9)) pattern |= 0x0800'0000;
121 if (edgeOp(c6, c5)) pattern |= 0x2000'0000;
122 c8 = next[2 * xx + 2];
123 if (edgeOp(c6, c8)) pattern |= 0x1000'0000;
125 edges2[xx] = pattern;
128 pattern = (pattern >> (16 + 9)) & 0x001C;
129 pattern |= (edges2[size2 - 1] << 3) & 0xC460'C460;
131 if (edgeOp(c5, c8)) pattern |= 0x0000'0080;
132 Pixel c6 = curr[size - 1];
133 if (edgeOp(c6, c8)) pattern |= 0x0004'0800;
134 if (edgeOp(c5, c6)) pattern |= 0x0010'2000;
135 Pixel c9 = next[size - 1];
136 if (edgeOp(c5, c9)) pattern |= 0x0008'1000;
138 if (edgeOp(c6, c9)) pattern |= 0x1880'0000;
140 edges2[size2 - 1] = pattern;