|
|
|
@ -216,6 +216,17 @@ void packWatermark(const Region &changed) {
|
|
|
|
|
const Rect &bounding = changed.get_bounding_rect();
|
|
|
|
|
|
|
|
|
|
for (y = 0; y < rh; y++) {
|
|
|
|
|
// Is the entire line outside the changed area?
|
|
|
|
|
if (bounding.tl.y > y || bounding.br.y < y) {
|
|
|
|
|
for (x = 0; x < rw; x++) {
|
|
|
|
|
pix[cur] = 0;
|
|
|
|
|
|
|
|
|
|
if (cur || (y == rh - 1 && x == rw - 1))
|
|
|
|
|
*dst++ = pix[0] | (pix[1] << 4);
|
|
|
|
|
|
|
|
|
|
cur ^= 1;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
for (x = 0; x < rw; x++) {
|
|
|
|
|
pix[cur] = 0;
|
|
|
|
|
if (bounding.contains(Point(x, y)) && changed.contains(x, y))
|
|
|
|
@ -227,6 +238,7 @@ void packWatermark(const Region &changed) {
|
|
|
|
|
cur ^= 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uLong destLen = MAXW * MAXH / 2;
|
|
|
|
|
if (compress2(watermarkData, &destLen, watermarkTmp, rw * rh / 2 + 1, 1) != Z_OK)
|
|
|
|
|