pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by frymaster on Thu 14th Feb 21:40 (modification of post by Willow view diff)
diff | download | new post

  1. //Convert the message into a bitstream, storing each bit in a vector.
  2.         std::string message = argv[1];
  3.         std::vector<char> *bitPtr = new std::vector<char>;
  4.         convertMessage(message, bitPtr);
  5.         std::vector<char>::iterator it = bitPtr->begin();
  7.         const int gridYStep = sourceImage->height/GRID_ROWS;
  8.         const int gridXStep = sourceImage->width/GRID_COLS;
  9.         char bit;
  11.         //Define each grid square with dimensions (gridXStep by GridYStep) pixels.
  12.         //For each square we read in the next bit and set the angle data
  13.         //When the end of the vector is reached the square is defaulted to '0'
  15.         for(int y(0); y < sourceImage->height; y+= gridYStep)
  16.                 for(int x(0); x < sourceImage->width; x+= gridXStep)
  17.                 {
  18.                         cv::Rect gridSquare(x, y, gridXStep, gridYStep);
  19.                         if ( (y < gridYStep * GRID_ROWS) && (x < gridXStep * GRID_COLS) ) {
  20.                         if (it!=bitPtr->end())
  21.                         {
  22.                                 bit = *it;
  23.                                 setGridAngles(orientinfo, sourceImage, *it, gridSquare);
  24.                                 it++;
  25.                         }
  26.                         else
  27.                                 setGridAngles(orientinfo, sourceImage, '0', gridSquare);
  28.                         }
  29.                         }

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@

Remember my settings