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 Willow on Thu 14th Feb 21:25 (modification of post by Willow view diff)
View followups from frymaster and frymaster | 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();
  6.  
  7.         const int gridYStep = sourceImage->height/GRID_ROWS;
  8.         const int gridXStep = sourceImage->width/GRID_COLS;
  9.         char bit;
  10.  
  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'
  14.  
  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 (it!=bitPtr->end())
  20.                         {
  21.                                 bit = *it;
  22.                                 setGridAngles(orientinfo, sourceImage, *it, gridSquare);
  23.                                 it++;
  24.                         }
  25.                         else
  26.                                 setGridAngles(orientinfo, sourceImage, '0', gridSquare);
  27.                 }

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