img print
This commit is contained in:
parent
9d150c04c5
commit
e824d7fdea
1 changed files with 12 additions and 5 deletions
17
image.c
17
image.c
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
|
|
||||||
|
|
@ -21,11 +23,16 @@ void img_print (Img* img) {
|
||||||
|
|
||||||
//print the image
|
//print the image
|
||||||
matrix_print(img->pixel_values);
|
matrix_print(img->pixel_values);
|
||||||
|
//print the number of the image
|
||||||
//print the label of the image
|
printf("Number it is supposed to be: %d\n", img->image_label);
|
||||||
printf("%d", img->image_label);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void img_free (Img* img) {
|
void img_free (Img* img) {
|
||||||
|
matrix_free(img->pixel_values);
|
||||||
|
free(img);
|
||||||
|
}
|
||||||
|
void images_free (Img** images, int quantity){
|
||||||
|
for(int i=0;i<quantity;i++){
|
||||||
|
img_free(images[i]);
|
||||||
|
}
|
||||||
|
free(images);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue