#include "rtsUtilities.h" char* rtsInt_to_String(int num, int min_chars) { //returns a null-terminated string representing the passed parameter //find out if the number is negative bool negative = false; if(num < 0) { negative = true; num *= -1; } //first, count the number of digits that will be in the string int num_digits = 0; int dividend = 1; while((num/dividend) != 0) { dividend*=10; num_digits++; } //calculate the number of characters required by number int num_chars = 0; if(negative) num_chars = num_digits+1; else num_chars = num_digits; //allocate memory for the string (add 1 for the NULL character) char* result; int total_chars = 0; if(num_chars > min_chars) total_chars = num_chars; else total_chars = min_chars; result = new char[total_chars + 1]; //initialize the string to 0's for(int i=0; i= start_index && (j < start_index + num_length)) { filename[j] = number[j - start_index]; } //otherwise output the mask value else filename[j] = mask[j]; } filename[length] = 0; result[i] = filename; } return result; } unsigned char* rtsCalculateDifferenceImage(int length, unsigned char* a, unsigned char* b) { //calculates the difference between two images and returns the absolute value unsigned char* result = new unsigned char[length]; for(int i=0; i