// file: $USFS/class/ppm/v1.0/ppm_asgn_0.cc
//
 
// isip include files
//
#include "ppm.h"
 
#include <integral_constants.h>
#include "ppm_constants.h"
 
// method: assign_cc
//
// arguments:
//  int_4 width_a : (input) width of the image
//  int_4 height_a : (input) height of the image
//  int_4 max_colors_a : (input) max_color level of the image
//
// return: none
//
// this method assigns the header parameters to the class
//
logical_1 Ppm::assign_cc(int_4 width_a, int_4 height_a, int_4 max_colors_a) {
    
  // assign the magic number to be safe
  //
  if (magic_number_d != (char_1*)NULL) {
    delete [] magic_number_d;
  }
  
  magic_number_d = new char_1[strlen((char*)PPM_MAGIC_NUMBER)+1];
  strcpy((char*)magic_number_d, (char*)PPM_MAGIC_NUMBER);

  // assign the magic_number, width, height and max_color
  //
  height_d = height_a;
  width_d = width_a;
  max_colors_d = max_colors_a;
 
  // exit gracefully
  //
  return ISIP_TRUE;
}
