#include "../const.h"
#include "Init_para.h"
#include "Image.h"
#include "PrintResults.h"

// This function shows all found features on the expanded original image
void
PrintResults(const Image& mouth, const Image& eye_left, const Image& eye_right, const Image& eyebrow_left, const Image& eyebrow_right, const Image& im_exp, int counter)
{

Image result, temp;
char name[MAX_LENGTH_FILE];

#ifdef FUNC_TRACK
PRN(("Starting PrintResults\n"));
#endif

temp = Image(im_exp.width, im_exp.height, im_exp.offsetX, im_exp.offsetY);
if (temp.data == NULL)
   return;

MergeComp(temp, mouth, im_exp, result);
FreeImg(temp);
CopyImage(result, temp);
FreeImg(result);

MergeComp(temp, eye_left, im_exp, result);
FreeImg(temp);
CopyImage(result, temp);
FreeImg(result);

MergeComp(temp, eye_right, im_exp, result);
FreeImg(temp);
CopyImage(result, temp);
FreeImg(result);

MergeComp(temp, eyebrow_left, im_exp, result);
FreeImg(temp);
CopyImage(result, temp);
FreeImg(result);

MergeComp(temp, eyebrow_right, im_exp, result);

if (result.data != NULL) {
      sprintf(name, "%sRES%04d.BMP", DATA_FOLDER, counter);
      ShowComp(name, im_exp, result);
}

FreeImg(temp);
FreeImg(result);

#ifdef FUNC_TRACK
PRN(("Ending PrintResults\n"));
#endif

return;


}
