So I am to loop through copyFrom.pixelData and copy it into pixelData.
I realize that I need to check the conditions of i and j, and have them not copy past the boundaries of pixelData[x][y],
I need another 2 loops for that? I tried this, but was getting segmentation fault.. Is this the right approach?
void Image::insert(int xoff, int yoff, const Image& copyFrom, Color notCopy)
{
for (int x = xoff; x < xoff+copyFrom.width; x++) {
for (int y = yoff; y < yoff+copyFrom.height; y++) {
for (int i = 0; i<width; i++) {
for (int j = 0; j<height; j++) {
if (copyFrom.pixelData[i][j].colorDistance(notCopy) > 20)
pixelData[x][y]=copyFrom.pixelData[i][j];
}
}
}
}
}
}