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.
Diff: PixelBuffer.h
- Revision:
- 46:2374900f8845
- Parent:
- 32:64c391617f6c
- Child:
- 49:27d8f1d43ca9
--- a/PixelBuffer.h Sat Dec 17 00:23:44 2016 +0000 +++ b/PixelBuffer.h Tue Dec 20 03:22:01 2016 +0000 @@ -44,10 +44,10 @@ */ RGBPixels(RGBColor *buffer = nullptr, int maxPixels = MAX_PIXELS); RGBPixels(int maxPixels = MAX_PIXELS); - ~RGBPixels(); + virtual ~RGBPixels(); void setPixelBuffer(RGBColor *buffer, int maxPixels); - int maxPixels() { return _maxPixels; } + int maxPixels() { return _max_pixels; } int numPixels(int value = -1); void setPixels(int index, RGBColor *color, int len); @@ -55,6 +55,11 @@ void setPixels(RGBColor *color, int len) { setPixels(0, color, len); } void setPixels(HSVColor *color, int len) { setPixels(0, color, len); } + void setGammaPixels(int index, RGBColor *color, int len); + void setGammaPixels(int index, HSVColor *color, int len); + void setGammaPixels(RGBColor *color, int len) { setGammaPixels(0, color, len); } + void setGammaPixels(HSVColor *color, int len) { setGammaPixels(0, color, len); } + void fillPixels(int index, const RGBColor color, int len); void fillPixels(int index, const HSVColor color, int len); void fillPixels(int index, const int color, int len) { fillPixels(index, (RGBColor)color, len); } @@ -85,16 +90,16 @@ RGBColor operator[](int index) const { - if (_pixels && (uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _num_pixels) return _pixels[index]; - return _dummyPixel; + return _dummy_pixel; } RGBColor& operator[](int index) { - if (_pixels && (uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _num_pixels) return _pixels[index]; - return _dummyPixel; + return _dummy_pixel; } RGBPixels& operator=(const RGBPixels& rhs); @@ -102,13 +107,13 @@ operator RGBColor*() const { return _pixels; } protected: - uint16_t _maxPixels; - uint16_t _numPixels; + uint16_t _max_pixels; + uint16_t _num_pixels; RGBColor *_pixels; + RGBColor _dummy_pixel; private: bool _owned_buffer; - RGBColor _dummyPixel; }; @@ -127,10 +132,10 @@ */ HSVPixels(HSVColor *buffer = nullptr, int maxPixels = MAX_PIXELS); HSVPixels(int maxPixels = MAX_PIXELS); - ~HSVPixels(); + virtual ~HSVPixels(); void setPixelBuffer(HSVColor *buffer, int maxPixels); - int maxPixels() { return _maxPixels; } + int maxPixels() { return _max_pixels; } int numPixels(int value = -1); void setPixels(int index, HSVColor *color, int len); @@ -168,16 +173,16 @@ HSVColor operator[](int index) const { - if (_pixels && (uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _num_pixels) return _pixels[index]; - return _dummyPixel; + return _dummy_pixel; } HSVColor& operator[](int index) { - if (_pixels && (uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _num_pixels) return _pixels[index]; - return _dummyPixel; + return _dummy_pixel; } HSVPixels& operator=(const HSVPixels& rhs); @@ -185,13 +190,13 @@ operator HSVColor*() const { return _pixels; } protected: - uint16_t _maxPixels; - uint16_t _numPixels; + uint16_t _max_pixels; + uint16_t _num_pixels; HSVColor *_pixels; + HSVColor _dummy_pixel; private: bool _owned_buffer; - HSVColor _dummyPixel; };