diff --git a/main/main.cpp b/main/main.cpp index d3a7806..9c4b509 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -76,7 +76,7 @@ int main(){ std::cout <<"picture" << std::endl; vkvm::Color backgroundColor = vkvm::getBackgroundColor(); for(int i = 0; i<1000; i++) { - Imagedisplay imagedisplay("../src/P6.bmp"); + Imagedisplay imagedisplay("../src/P7.bmp"); for (int w = 0; w < vkvm::getWidth(); w++) { for (int h = 0; h < vkvm::getHeight(); h++) { unsigned int a ; @@ -89,7 +89,7 @@ int main(){ sleep(5); vkvm::setDefaultValues(); - Imagedisplay imagedisplay2("../src/P7.bmp"); + Imagedisplay imagedisplay2("../src/P6.bmp"); for (int w = 0; w < vkvm::getWidth(); w++) { for (int h = 0; h < vkvm::getHeight(); h++) { @@ -101,28 +101,28 @@ int main(){ sleep(5); vkvm::setDefaultValues(); - Imagedisplay imagedisplay3("../src/P6.bmp"); - for (int w = 0; w < vkvm::getWidth(); w++) { - for (int h = 0; h < vkvm::getHeight(); h++){ - unsigned int a ; - a = imagedisplay3.getPixel(w, h); - vkvm::setPixel(w,h,vkvm::Color(a)); - } +// Imagedisplay imagedisplay3("../src/P6.bmp"); +// for (int w = 0; w < vkvm::getWidth(); w++) { +// for (int h = 0; h < vkvm::getHeight(); h++){ +// unsigned int a ; +// a = imagedisplay3.getPixel(w, h); +// vkvm::setPixel(w,h,vkvm::Color(a)); +// } +// +// } +// sleep(5); +// vkvm::setDefaultValues(); - } - sleep(5); - vkvm::setDefaultValues(); - - Imagedisplay imagedisplay4("../src/P7.bmp"); - for (int w = 0; w < vkvm::getWidth(); w++) { - for (int h = 0; h < vkvm::getHeight(); h++){ - unsigned int a ; - a = imagedisplay4.getPixel(w, h); - vkvm::setPixel(w,h,vkvm::Color(a)); - } - - } - sleep(5); +// Imagedisplay imagedisplay4("../src/P7.bmp"); +// for (int w = 0; w < vkvm::getWidth(); w++) { +// for (int h = 0; h < vkvm::getHeight(); h++){ +// unsigned int a ; +// a = imagedisplay4.getPixel(w, h); +// vkvm::setPixel(w,h,vkvm::Color(a)); +// } +// +// } +// sleep(5); } }); diff --git a/src/Imagedisplay.cpp b/src/Imagedisplay.cpp index 901777f..dd3c4e4 100644 --- a/src/Imagedisplay.cpp +++ b/src/Imagedisplay.cpp @@ -57,7 +57,7 @@ unsigned int Imagedisplay::getPixel(int x, int y) { char *ptr = getData() + ((getHeight() - 1 - y) * getWidth() + x) * (getBitsPerPixel() / 8); for(int i = 0; i < getBitsPerPixel() / 8;i++){ *((char*)&pixel+i) = ptr[i]; - std::cout<< "hi: im" << (unsigned int) ptr[i]<< std::endl; + // std::cout<< "hi: im" << (unsigned int) ptr[i]<< std::endl; } if(pixel != 0){ return pixel; diff --git a/src/P8.bmp b/src/P8.bmp new file mode 100644 index 0000000..9c8e492 Binary files /dev/null and b/src/P8.bmp differ