daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int width = 200, height = 100;
  2.     uint8_t** INPUT;
  3.  
  4.     // generation of some test data
  5.     INPUT = (uint8_t**)malloc(height * sizeof(uint8_t*));
  6.     for (int i = 0; i < height; i++)
  7.     {
  8.         INPUT[i] = (uint8_t*)malloc(width * sizeof(uint8_t));
  9.     }
  10.  
  11.     for (int i = 0; i < height; i++)
  12.         for (int j = 0; j < width; j++)
  13.         {
  14.             if (j >= width / 2 - i && j < width / 2 + i && i > 0 && j != width / 2)
  15.                 INPUT[i][j] = 1;
  16.                 else INPUT[i][j] = 0;
  17.             if (i > height /2 && i < height * 3 / 4 && j >= width / 4 && j < width * 3 / 4)
  18.                 INPUT[i][j] = 0;
  19.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top