| 441 | } |
| 442 | |
| 443 | void ColorSpace::setAllocationVars(int numvars, const float * vars) |
| 444 | { |
| 445 | if (numvars < 0) |
| 446 | { |
| 447 | throw Exception("setAllocationVars: numvars must not be negative."); |
| 448 | } |
| 449 | if (numvars > 0 && !vars) |
| 450 | { |
| 451 | throw Exception("setAllocationVars: vars must not be null when numvars is positive."); |
| 452 | } |
| 453 | |
| 454 | getImpl()->m_allocationVars.resize(numvars); |
| 455 | |
| 456 | if(!getImpl()->m_allocationVars.empty()) |
| 457 | { |
| 458 | memcpy(&getImpl()->m_allocationVars[0], |
| 459 | vars, |
| 460 | numvars*sizeof(float)); |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | ConstTransformRcPtr ColorSpace::getTransform(ColorSpaceDirection dir) const noexcept |
| 465 | { |