Enhance Bitmap class with error handling and code improvements
- Introduced BitmapError class for more specific error handling in the Bitmap class. - Updated data checks to use `empty()` for clarity and consistency. - Improved pixel data handling by ensuring proper type usage and modifying loop constructs for better performance. - Refactored constructor and method implementations for improved readability and maintainability.
This commit is contained in:
@@ -151,7 +151,7 @@ class Bitmap {
|
||||
int width() const { return width_; }
|
||||
int height() const { return height_; }
|
||||
int depth() const { return depth_; }
|
||||
int size() const { return data_.size(); }
|
||||
auto size() const { return data_.size(); }
|
||||
const uint8_t *data() const { return data_.data(); }
|
||||
std::vector<uint8_t> &mutable_data() { return data_; }
|
||||
SDL_Surface *surface() const { return surface_; }
|
||||
|
||||
Reference in New Issue
Block a user