PandA-2024.02
inverse.c
Go to the documentation of this file.
1 /* inverse.c */
2 #include "mypgm.h"
3 
4 int make_inverse_image(unsigned char *image1, unsigned char *image2, unsigned int x_size, unsigned int y_size)
5  /* inverse of image1 is output into image2 */
6 {
7  int x, y; /* control variable */
8 
9  for (y = 0; y < y_size; y++) {
10  for (x = 0; x < x_size; x++) {
11  *(image2 + y + x * MAX_IMAGESIZE) = (unsigned char)
12  (MAX_BRIGHTNESS - *(image1 + y + x * MAX_IMAGESIZE));
13  }
14  }
15 
16  return 0;
17 }
#define MAX_IMAGESIZE
Definition: mypgm.h:7
int make_inverse_image(unsigned char *image1, unsigned char *image2, unsigned int x_size, unsigned int y_size)
Definition: inverse.c:4
#define MAX_BRIGHTNESS
Definition: mypgm.h:8
x
Return the smallest n such that 2^n >= _x.

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13