You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Please I need to use your repo and use lena.PNG as input image, so I read the image in this way, but this not correct how can read the image in correct way?
ifstream im;
im.open("lena.PNG",std::ios_base::binary);
if (im.is_open())
{
cout<< "function success\n";
}
else
{
cout<< "unable to open file";
}
//get length of file:
im.seekg(0, im.end);
int n = im.tellg();
im.seekg (0, im.beg);
//allocate memory:
///char* image = new char[n];
const auto width = 512;
const auto height = 512;
// RGB: one byte each for red, green, blue
const auto bytesPerPixel = 3;
// allocate memory
auto image = new char[width * height * bytesPerPixel];
//read data as a block:
im.read( (image), n);
The text was updated successfully, but these errors were encountered:
Hello,
Please I need to use your repo and use lena.PNG as input image, so I read the image in this way, but this not correct how can read the image in correct way?
The text was updated successfully, but these errors were encountered: