int getCell(RGBTRIPLE image[i][j]){
int add;
add += image[i][j].rgbtRed;
add += image[i][j].rgbtBlue;
add += image[i][j].rgbtGreen;
return add;
}
void blur(int height, int width, RGBTRIPLE image[height][width])
{
int red;
int green;
int blue;
int sum;
float average;
for (int i = 0; i < height; ++i)
{
for (int j = 0; j < width; ++j)
{
if(i == 0 && j == 0){
sum += getCell(image[i][j]); // itself
sum += getCell(image[i][j+1]); // right
sum += getCell(image[i+1][j]); // bottom
sum += getCell(image[i+1][j+1]); // right
sum = sum / 4;
image[i][j].rgbtRed = sum;
image[i][j].rgbtBlue = sum;
image[i][j].rgbtGreen = sum;
}
How do I pass the matrix that is passed into blur to another function called getCell? I'm not sure if I'm doing it correctly.