IntensityImageStudent::IntensityImageStudent(const IntensityImage &other) : IntensityImage(other.getWidth(), other.getHeight()), pixelMap(nullptr) { const int SIZE = other.getSize(); if(SIZE > 0) { pixelMap = new Intensity[SIZE]; for(int i = 0; i < SIZE; i++) { pixelMap[i] = other.getPixel(i); } } }
void IntensityImageStudent::set(const IntensityImage &other) { const int SIZE = other.getSize(); IntensityImage::set(other.getWidth(), other.getHeight()); if (SIZE > 0) { delete[] pixelMap; pixelMap = new Intensity[SIZE]; for (int i = 0; i < SIZE; i++) { pixelMap[i] = other.getPixel(i); } } }