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

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

#include "image_analysis_constants.h"
#include <integral_constants.h>

// method: hist_display_cc
//
// arguments:
//  FILE* fp: (input) file pointer
//
// return: a logical_1 value indicating status
//
// this method displays a histogram model. it is used mainly for debugging.
//
logical_1 Image_analysis::hist_display_cc(FILE* fp_a) {
  
  // display the first block of scalar parameters
  //
  fprintf(fp_a, "%s = %f\n", "hist_r_min_d", hist_r_min_d);
  fprintf(fp_a, "%s = %f\n", "hist_r_max_d", hist_r_max_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_nbins_d", hist_r_nbins_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_redp_d", hist_r_redp_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_grnp_d", hist_r_grnp_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_blup_d", hist_r_blup_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_npxls", hist_r_npxls_d);
  fprintf(fp_a, "%s = %ld\n", "hist_r_nimages_d", hist_r_nimages_d);
  
  // display the first block of arrays
  //
  fprintf(fp_a, "red pdf:\n");
  for (int_4 i=0; i<hist_r_nbins_d; i++) {
    fprintf(fp_a, "%ld %ld: (%f) %f\n", hist_r_redp_d, i,
	    hist_r_rcval_d[i], hist_r_rpdf_d[i]);
  }

  fprintf(fp_a, "green pdf:\n");
  for (int_4 i=0; i<hist_r_nbins_d; i++) {
    fprintf(fp_a, "%ld %ld: (%f) %f\n", hist_r_grnp_d, i,
	    hist_r_gcval_d[i], hist_r_gpdf_d[i]);
  }

  fprintf(fp_a, "blue pdf:\n");
  for (int_4 i=0; i<hist_r_nbins_d; i++) {
    fprintf(fp_a, "%ld %ld: (%f) %f\n", hist_r_blup_d, i,
	    hist_r_bcval_d[i], hist_r_bpdf_d[i]);
  }

  // display the second block of scalar parameters
  //
  fprintf(fp_a, "%s = %f\n", "hist_rwgt_d", hist_rwgt_d);
  fprintf(fp_a, "%s = %f\n", "hist_gwgt_d", hist_gwgt_d);
  fprintf(fp_a, "%s = %f\n", "hist_bwgt_d", hist_bwgt_d);
  fprintf(fp_a, "%s = %f\n", "hist_ascale_d", hist_ascale_d);
  fprintf(fp_a, "%s = %f\n", "hist_bscale_d", hist_bscale_d);

  // exit gracefully
  //
  return ISIP_TRUE;
}

