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 | e0a93ade98c1e193cde2592263b538ce1fd89bcb (patch) | |
| tree | d4b64530182666cc8a64764422e2f2e3bf46b58b /src/XPM.h | |
| parent | 96962eeb0c0ed87e1aa2bcf016cd5cd23bc111f2 (diff) | |
| download | scintilla-mirror-e0a93ade98c1e193cde2592263b538ce1fd89bcb.tar.gz | |
Backport: Use noexcept where possible.
Backport of changeset 8022:658a23dc7b4e.
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 &&) = 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. |
