// file: $USFS/class/image_analysis/v3.0/imaga_ent_02.cc
//

// isip include files
//
#include "image_analysis.h"
#include "image_analysis_constants.h"

// method: ent_train_cc
//
// arguments:
//  char_1* image_fname: (input) the image filename
//
// return:
//  a logical_1 value indicating status
//
// this method computes the entropy in the training mode
//
logical_1 Image_analysis::ent_train_cc(char_1* image_fname_a) {
  
  // compute the standard deviaiton
  //
  if (ent_compute_cc(image_fname_a) == ISIP_FALSE) {
    error_handler_cc((char_1*)"ent_train_cc",
		     (char_1*)"error while computing the entropy");
    return ISIP_FALSE;
  }

  // provide some debugging information
  //
  if (debug_level_d > ISIP_DEBUG_BRIEF) {
    fprintf(stdout, "<%s> %s = %ld\n", "Image_analysis::ent_compute_cc",
	    "ent_npxls", huf_r_npxls_d);
    fprintf(stdout, "<%s> %s = %ld\n", "Image_analysis::ent_compute_cc",
	    "huf_r_nimages_d", huf_r_nimages_d);
    
    fprintf(stdout, "%s\n", "the values of the entropy are");
    
    fprintf(stdout, "rent = %f\tgent = %f\tbent = %f\t\n", huf_t_red_d,
	    huf_t_grn_d, huf_t_blu_d);
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
