Open main menu

CDOT Wiki β

Changes

GroupNumberUndefined

1,012 bytes removed, 16:43, 26 March 2017
Assignment 2
For assignment two we will be doing image processing. Choose to do the function enlarge() which basically makes the given image bigger. This is it's current implementation :
void Image::enlargeImage(int value, Image& oldImage)/*enlarges Image and stores it in tempImage, resizes oldImage and stores the larger image in oldImage*/{ int rows, cols, gray; int pixel; int enlargeRow, enlargeCol; rows = oldImage.N * value; cols = oldImage.M * value; gray = oldImage.Q; Image tempImage(rows, cols, gray); for(int i = 0; i < oldImage.N; i++) { for(int j = 0; j < oldImage.M; j++) { pixel = oldImage.pixelVal[i][j]; enlargeRow = i * value; enlargeCol = j * value; for(int c = enlargeRow; c < (enlargeRow + value); c++) { for(int d = enlargeCol; d < (enlargeCol + value); d++) { tempImageFile:EnlargeImage.pixelVal[cPNG][d] = pixel; } } } } oldImage = tempImage;}
And this is the kernal implementation :
62
edits