Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement