| 251 | }; |
| 252 | |
| 253 | class vtkColor4ub : public vtkColor4<unsigned char> |
| 254 | { |
| 255 | public: |
| 256 | vtkColor4ub() = default; |
| 257 | explicit vtkColor4ub(unsigned char scalar) |
| 258 | : vtkColor4<unsigned char>(scalar) |
| 259 | { |
| 260 | } |
| 261 | explicit vtkColor4ub(const unsigned char* init) |
| 262 | : vtkColor4<unsigned char>(init) |
| 263 | { |
| 264 | } |
| 265 | |
| 266 | ///@{ |
| 267 | /** |
| 268 | * Construct a color from a hexadecimal representation such as 0x0000FFAA |
| 269 | * (opaque blue). |
| 270 | */ |
| 271 | explicit vtkColor4ub(int hexSigned) |
| 272 | { |
| 273 | unsigned int hex = static_cast<unsigned int>(hexSigned); |
| 274 | this->Data[3] = hex & 0xff; |
| 275 | hex >>= 8; |
| 276 | this->Data[2] = hex & 0xff; |
| 277 | hex >>= 8; |
| 278 | this->Data[1] = hex & 0xff; |
| 279 | hex >>= 8; |
| 280 | this->Data[0] = hex & 0xff; |
| 281 | } |
| 282 | ///@} |
| 283 | |
| 284 | vtkColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 255) |
| 285 | : vtkColor4<unsigned char>(r, g, b, a) |
| 286 | { |
| 287 | } |
| 288 | vtkColor4ub(const vtkColor3ub& c) |
| 289 | : vtkColor4<unsigned char>(c[0], c[1], c[2], 255) |
| 290 | { |
| 291 | } |
| 292 | }; |
| 293 | |
| 294 | class vtkColor4f : public vtkColor4<float> |
| 295 | { |
no outgoing calls