Skip to content

Commit

Permalink
code7
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoura505 committed Nov 24, 2023
1 parent 910d945 commit 57bc949
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions image8bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,18 @@ int ImageLocateSubImage(Image img1, int* px, int* py, Image img2) { ///
assert (img1 != NULL);
assert (img2 != NULL);
// Insert your code here!
for (int i = 0; i < img1->height; i++) {
for (int j = 0; j < img1->width; j++) {
// Check if img2 matches at the current position
if (ImageMatchSubImage(img1, j, i, img2)) {
// Update the variables with the matching position
*px = j;
*py = i;
return 1; // Match found
}
}
}
return 0; // No match found
}


Expand Down

0 comments on commit 57bc949

Please sign in to comment.