0

This program embed a message into an image by modifying lsb bit from alpha (transparency) part of ARGB, the mechanism of accessing the bits location in this code is confusing in this line:

startX = start/maxY, startY = start - startX*maxY

private void embedByte(BufferedImage img, byte b, int start, int 
storageBit) {
int maxX = img.getWidth(), maxY = img.getHeight(), 
____________________________________________________________
startX = start/maxY, startY = start - startX*maxY, count=0;
____________________________________________________________
 for(int i=startX; i<maxX && count<8; i++) {
   for(int j=startY; j<maxY && count<8; j++) {
    int rgb = img.getRGB(i, j), bit = getBitValue(b, count);
    rgb = setBitValue(rgb, storageBit, bit);
    img.setRGB(i, j, rgb);
    count++;
    }
  }
}

what is the mean of startX & startY and the purpose of two for loops?

Source code:

http://developeriq.in/articles/2013/feb/28/embedding-messages-in-digital-images-using-java/

  • if any one can help please dont ignore –  Aug 21 '17 at 22:09
  • The question you've asked and the question in your title don't appear to be the same. Please fix this. You should also edit your question to include **only the relevant portion of code**. – Luke Joshua Park Aug 22 '17 at 01:25
  • Im assuming you didnt try to google that line of code? – Owain Esau Aug 22 '17 at 05:29
  • https://stackoverflow.com/questions/21297633/storing-message-into-r-g-b-instead-of-alpha – Owain Esau Aug 22 '17 at 05:30
  • The line of code you're asking about has nothing to do with the rest of the question. It's just a 1D to 2D coordinate transformation. – harold Aug 22 '17 at 05:31
  • https://softwareengineering.stackexchange.com/questions/212808/treating-a-1d-data-structure-as-2d-grid – Reti43 Aug 22 '17 at 08:43

0 Answers0