| 358 | } |
| 359 | |
| 360 | void Lut3DOpData::validate() const |
| 361 | { |
| 362 | if (!IsValidInterpolation(m_interpolation)) |
| 363 | { |
| 364 | std::ostringstream oss; |
| 365 | oss << "Lut3D does not support interpolation algorithm: "; |
| 366 | oss << InterpolationToString(getInterpolation()); |
| 367 | oss << "."; |
| 368 | throw Exception(oss.str().c_str()); |
| 369 | } |
| 370 | |
| 371 | try |
| 372 | { |
| 373 | getArray().validate(); |
| 374 | } |
| 375 | catch (const Exception& e) |
| 376 | { |
| 377 | std::ostringstream oss; |
| 378 | oss << "Lut3D content array issue: "; |
| 379 | oss << e.what(); |
| 380 | |
| 381 | throw Exception(oss.str().c_str()); |
| 382 | } |
| 383 | |
| 384 | if (getArray().getNumColorComponents() != 3) |
| 385 | { |
| 386 | throw Exception("Lut3D has an incorrect number of color components. "); |
| 387 | } |
| 388 | |
| 389 | if (getArray().getLength()>Max3DLUTLength) |
| 390 | { |
| 391 | // This should never happen. Enforced by resize. |
| 392 | std::ostringstream oss; |
| 393 | oss << "Lut3D length: " << getArray().getLength(); |
| 394 | oss << " is not supported. "; |
| 395 | |
| 396 | throw Exception(oss.str().c_str()); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | bool Lut3DOpData::isNoOp() const |
| 401 | { |
no test coverage detected