Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: LV7_LCDtest LV7_Grupa5_Tim003_Zadatak1 lv7_Grupa5_Tim008_zad1 LV7_PAI_Grupa5_tim10_Zadatak1 ... more
Revision 41:6c046786be6c, committed 2017-03-08
- Comitter:
- valavanisalex
- Date:
- Wed Mar 08 16:13:08 2017 +0000
- Parent:
- 40:c9262294f2e1
- Child:
- 42:596c207519de
- Commit message:
- Fix Bitmap error checking
Changed in this revision
| Bitmap.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Bitmap.cpp Wed Mar 08 15:48:48 2017 +0000
+++ b/Bitmap.cpp Wed Mar 08 16:13:08 2017 +0000
@@ -13,10 +13,10 @@
_width(width)
{
// Perform a quick sanity check of the dimensions
- if (_contents.size() != height * height) {
+ if (_contents.size() != height * width) {
std::cerr << "Contents of bitmap has size " << _contents.size()
<< " pixels, but its dimensions were specified as "
- << width << " * " << height << " = " << width * height;
+ << width << " * " << height << " = " << width * height << std::endl;
}
for(unsigned int i = 0; i < height*width; ++i) _contents[i] = contents[i];
@@ -33,7 +33,7 @@
{
std::cerr << "The requested pixel with index " << row << "," << column
<< "is outside the bitmap dimensions: " << _width << ","
- << _height;
+ << _height << std::endl;
}
// Now return the pixel value, using row-major indexing
