diff options
author | Neil <nyamatongwe@gmail.com> | 2020-03-24 10:33:47 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-03-24 10:33:47 +1100 |
commit | ae9dd542f45fb64c97361737dd9d4896949644c8 (patch) | |
tree | dc27e89b39d4b9507c5a128d8c8646a4b38d643a /src/XPM.h | |
parent | 192cc29136ec5bb161669909c73a427d86533713 (diff) | |
download | scintilla-mirror-ae9dd542f45fb64c97361737dd9d4896949644c8.tar.gz |
Use noexcept where possible.
Diffstat (limited to 'src/XPM.h')
-rw-r--r-- | src/XPM.h | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -20,7 +20,7 @@ class XPM { std::vector<unsigned char> pixels; ColourDesired colourCodeTable[256]; char codeTransparent=' '; - ColourDesired ColourFromCode(int ch) const; + ColourDesired ColourFromCode(int ch) const noexcept; void FillRun(Surface *surface, int code, int startX, int y, int x) const; public: explicit XPM(const char *textForm); @@ -34,9 +34,9 @@ public: void Init(const char *const *linesForm); /// Decompose image into runs and use FillRectangle for each run void Draw(Surface *surface, const PRectangle &rc); - int GetHeight() const { return height; } - int GetWidth() const { return width; } - void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const; + int GetHeight() const noexcept { return height; } + int GetWidth() const noexcept { return width; } + void PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const noexcept; private: static std::vector<const char *>LinesFormFromTextForm(const char *textForm); }; @@ -58,14 +58,14 @@ public: RGBAImage &operator=(const RGBAImage &) = default; RGBAImage &operator=(RGBAImage &&) noexcept = default; virtual ~RGBAImage(); - int GetHeight() const { return height; } - int GetWidth() const { return width; } - float GetScale() const { return scale; } - float GetScaledHeight() const { return height / scale; } - float GetScaledWidth() const { return width / scale; } - int CountBytes() const; - const unsigned char *Pixels() const; - void SetPixel(int x, int y, ColourDesired colour, int alpha); + int GetHeight() const noexcept { return height; } + int GetWidth() const noexcept { return width; } + float GetScale() const noexcept { return scale; } + float GetScaledHeight() const noexcept { return height / scale; } + float GetScaledWidth() const noexcept { return width / scale; } + int CountBytes() const noexcept; + const unsigned char *Pixels() const noexcept; + void SetPixel(int x, int y, ColourDesired colour, int alpha) noexcept; static void BGRAFromRGBA(unsigned char *pixelsBGRA, const unsigned char *pixelsRGBA, size_t count) noexcept; }; @@ -86,7 +86,7 @@ public: RGBAImageSet &operator=(RGBAImageSet &&) = delete; ~RGBAImageSet(); /// Remove all images. - void Clear(); + void Clear() noexcept; /// Add an image. void Add(int ident, RGBAImage *image); /// Get image by id. |