1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// Example program
#include <iostream>
#include <string>
int scaling(int imag[], int rows, int colns, int imga[]);
int main()
{
int imag[]={4,8,16,4,8,4,32,64,4,40,44,48,88,92,12,8,4,8,16,4,8,4,32,64,4,40,44,48,88,92,12,8};
scaling(imag, 8, 8);
std::cout<<imag[13];
}
int scaling(int imag[], int rows, int colns, int imga[]){
for(int r=0;r<rows;r++)
for(int c=0;c<colns;c++)
int imga[]*=(imag[(r*colns)+c]+imag[((r*colns)+c)+1]+imag[((r*colns)+c)+2]+imag[((r*colns)+c)+3])/4;
return imga[4];
}
|