4 int sharpen(
unsigned char *image1,
unsigned char *image2,
unsigned int x_size,
unsigned int y_size)
10 int weight[3][3] = {{ 1, 1, 1 },
13 const double alpha = 0.2;
19 for (y = 0; y < y_size; y++) {
20 for (x = 0; x < x_size; x++) {
26 for (y = 1; y < y_size - 1; y++) {
27 for (x = 1; x < x_size - 1; x++) {
29 for (j = - 1; j < 2; j++) {
30 for (i = -1; i < 2; i++) {
31 pixel_value += weight[j + 1][i + 1] * *(image1 + (y + j) + (x + i) *
MAX_IMAGESIZE);
34 new_value = (int)(*(image1 + y + x *
MAX_IMAGESIZE) - alpha * pixel_value);
35 if (new_value < 0) new_value = 0;
int sharpen(unsigned char *image1, unsigned char *image2, unsigned int x_size, unsigned int y_size)
x
Return the smallest n such that 2^n >= _x.