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

// system include files
//
#include <string.h>

// isip include files
//
#include "image_analysis.h"
#include <ppm.h>

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

// method: dent_sum_cc
//
// arguments: none
//
// return: a logical_1 value indicating status
//
// this method computes a histogram on a PPM image file.
//
logical_1 Image_analysis::dent_sum_cc() {

  // declare local variables
  //
  float_8 sum_r = 0;
  float_8 sum_g = 0;
  float_8 sum_b = 0;
  
  // compute the sum of the diff and the freq
  //
  for (int_4 i=0; i < dent_r_nbins_d; i++) {
    
    sum_r += dent_t_red_d[i] * i;
    sum_g += dent_t_grn_d[i] * i;
    sum_b += dent_t_blu_d[i] * i;
  }

  // final sum of the entropies
  //
  dent_t_sumred_d = sum_r;
  dent_t_sumgrn_d = sum_g;
  dent_t_sumblu_d = sum_b;
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
