| 151 | } |
| 152 | |
| 153 | void XPM::PixelAt(int x, int y, ColourDesired &colour, bool &transparent) const { |
| 154 | if (pixels.empty() || (x<0) || (x >= width) || (y<0) || (y >= height)) { |
| 155 | colour = 0; |
| 156 | transparent = true; |
| 157 | return; |
| 158 | } |
| 159 | int code = pixels[y * width + x]; |
| 160 | transparent = code == codeTransparent; |
| 161 | if (transparent) { |
| 162 | colour = 0; |
| 163 | } else { |
| 164 | colour = ColourFromCode(code).AsLong(); |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | std::vector<const char *> XPM::LinesFormFromTextForm(const char *textForm) { |
| 169 | // Build the lines form out of the text form |