| 391 | } |
| 392 | |
| 393 | void Lut1DOpData::validate() const |
| 394 | { |
| 395 | if (m_hueAdjust == HUE_WYPN) |
| 396 | { |
| 397 | throw Exception("1D LUT HUE_WYPN hue adjust style is not implemented."); |
| 398 | } |
| 399 | |
| 400 | if (!IsValidInterpolation(m_interpolation)) |
| 401 | { |
| 402 | std::ostringstream oss; |
| 403 | oss << "1D LUT does not support interpolation algorithm: "; |
| 404 | oss << InterpolationToString(getInterpolation()); |
| 405 | oss << "."; |
| 406 | throw Exception(oss.str().c_str()); |
| 407 | } |
| 408 | |
| 409 | try |
| 410 | { |
| 411 | getArray().validate(); |
| 412 | } |
| 413 | catch (const Exception& e) |
| 414 | { |
| 415 | std::ostringstream oss; |
| 416 | oss << "1D LUT content array issue: "; |
| 417 | oss << e.what(); |
| 418 | |
| 419 | throw Exception(oss.str().c_str()); |
| 420 | } |
| 421 | |
| 422 | // If isHalfDomain is set, we need to make sure we have 65536 entries. |
| 423 | if (isInputHalfDomain() && getArray().getLength() |
| 424 | != HALF_DOMAIN_REQUIRED_ENTRIES) |
| 425 | { |
| 426 | std::ostringstream oss; |
| 427 | oss << "1D LUT: "; |
| 428 | oss << getArray().getLength(); |
| 429 | oss << " entries found, "; |
| 430 | oss << HALF_DOMAIN_REQUIRED_ENTRIES; |
| 431 | oss << " required for halfDomain 1D LUT."; |
| 432 | |
| 433 | throw Exception(oss.str().c_str()); |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | unsigned long Lut1DOpData::GetLutIdealSize(BitDepth incomingBitDepth) |
| 438 | { |
no test coverage detected