Changes

Jump to: navigation, search

TudyBert

665 bytes added, 10:13, 19 April 2013
Assignment 1 Revisted
1.07 2.78 0.03 4194304 0.00 0.00 Image::getPixelVal(int, int)
The code for enlarge imageenlargeImage():
void Image::enlargeImage(int value, Image& oldImage)
{
int rows, cols, gray;
int pixel;
}
oldImage = tempImage;
 
The four for loops look like they could be parallelized since they just serve as counters. From the flat file, it seems that the majority of the time is spent in the overloaded operator=() method. The code for this is:
 
 
 
 
void Image::operator=(const Image& oldImage)
 
/*copies oldImage into whatever you = it to*/
 
{
 
N = oldImage.N;
 
M = oldImage.M;
 
Q = oldImage.Q;
 
 
if(dim1 != NULL)
 
{
 
delete[] dim1;
 
}
 
 
 
pixelVal = new int* [N];
 
dim1 = new int[N*M];
 
 
 
for(int i = 0; i < N; i++)
 
{
 
pixelVal[i] = new int [M];
 
for(int j = 0; j < M; j++)
 
{
 
pixelVal[i][j] = oldImage.pixelVal[i][j];
 
dim1[i*N + j] = oldImage.dim1[i*N + j];
 
}
 
}
 
}
 
=== Assignment 3 ===
1
edit

Navigation menu