diff options
Diffstat (limited to 'src/XPM.cxx')
-rw-r--r-- | src/XPM.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index ef2ba961a..ca4804e5d 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -60,17 +60,17 @@ unsigned int ValueOfHex(const char ch) noexcept { return 0; } -ColourAlpha ColourFromHex(const char *val) noexcept { +ColourRGBA ColourFromHex(const char *val) noexcept { const unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]); const unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]); const unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]); - return ColourAlpha(r, g, b); + return ColourRGBA(r, g, b); } } -ColourAlpha XPM::ColourFromCode(int ch) const noexcept { +ColourRGBA XPM::ColourFromCode(int ch) const noexcept { return colourCodeTable[ch]; } @@ -116,7 +116,7 @@ void XPM::Init(const char *const *linesForm) { if (!linesForm) return; - std::fill(colourCodeTable, std::end(colourCodeTable), ColourAlpha(0, 0, 0)); + std::fill(colourCodeTable, std::end(colourCodeTable), ColourRGBA(0, 0, 0)); const char *line0 = linesForm[0]; width = atoi(line0); line0 = NextField(line0); @@ -134,7 +134,7 @@ void XPM::Init(const char *const *linesForm) { const char *colourDef = linesForm[c+1]; const char code = colourDef[0]; colourDef += 4; - ColourAlpha colour(0, 0, 0, 0); + ColourRGBA colour(0, 0, 0, 0); if (*colourDef == '#') { colour = ColourFromHex(colourDef+1); } else { @@ -173,10 +173,10 @@ void XPM::Draw(Surface *surface, const PRectangle &rc) { } } -ColourAlpha XPM::PixelAt(int x, int y) const noexcept { +ColourRGBA XPM::PixelAt(int x, int y) const noexcept { if (pixels.empty() || (x < 0) || (x >= width) || (y < 0) || (y >= height)) { // Out of bounds -> transparent black - return ColourAlpha(0, 0, 0, 0); + return ColourRGBA(0, 0, 0, 0); } const int code = pixels[y * width + x]; return ColourFromCode(code); @@ -249,7 +249,7 @@ const unsigned char *RGBAImage::Pixels() const noexcept { return &pixelBytes[0]; } -void RGBAImage::SetPixel(int x, int y, ColourAlpha colour) noexcept { +void RGBAImage::SetPixel(int x, int y, ColourRGBA colour) noexcept { unsigned char *pixel = &pixelBytes[0] + (y * width + x) * 4; // RGBA pixel[0] = colour.GetRed(); |