我正在尝试实现一个新的数字水印系统,这是嵌入程序
参考文件可在以下链接中找到
http://www.4shared.com/folder/UNjahlTS/_online.html
我无法理解嵌入程序,所以请任何人帮忙,谢谢
private byte[] encode_text(byte[] image, byte[] 加法, int offset) {
//check that the data + offset will fit in the image if (addition.length + offset > image.length) { throw new IllegalArgumentException("File not long enough!"); } //loop through each addition byte for (int i = 0; i < addition.length; ++i) { //loop through the 8 bits of each byte int add = addition[i]; for (int bit = 7; bit >= 0; --bit, ++offset) //ensure the new offset value carries on through both loops { //assign an integer to b, shifted by bit spaces AND 1 //a single bit of the current byte int b = (add >>> bit) & 1; //assign the bit by taking: [(previous byte value) AND 0xfe] OR bit to add //changes the last bit of the byte in the image to be the bit of addition image[offset] = (byte) ((image[offset] & 0xFE) | b); } } return image; }
这是嵌入过程