| 257 | } |
| 258 | |
| 259 | void Prepare2ECDynamic(OCIOGPUTest & test, bool firstDyn, bool secondDyn) |
| 260 | { |
| 261 | // See also OCIO_ADD_TEST(ExposureContrastTransform, processor_several_ec). |
| 262 | OCIO::ExposureContrastTransformRcPtr ec1 = OCIO::ExposureContrastTransform::Create(); |
| 263 | ec1->setStyle(OCIO::EXPOSURE_CONTRAST_LOGARITHMIC); |
| 264 | |
| 265 | ec1->setExposure(0.8); |
| 266 | ec1->setContrast(0.5); |
| 267 | ec1->setGamma(1.5); |
| 268 | |
| 269 | OCIO::ExposureContrastTransformRcPtr ec2 = OCIO::ExposureContrastTransform::Create(); |
| 270 | ec2->setStyle(OCIO::EXPOSURE_CONTRAST_LOGARITHMIC); |
| 271 | |
| 272 | ec2->setExposure(0.8); |
| 273 | ec2->setContrast(0.5); |
| 274 | ec2->setGamma(1.5); |
| 275 | |
| 276 | if (firstDyn) ec1->makeContrastDynamic(); |
| 277 | if (secondDyn) ec2->makeExposureDynamic(); |
| 278 | |
| 279 | OCIO::GroupTransformRcPtr grp = OCIO::GroupTransform::Create(); |
| 280 | grp->appendTransform(ec1); |
| 281 | grp->appendTransform(ec2); |
| 282 | |
| 283 | test.setProcessor(grp); |
| 284 | |
| 285 | class MyECRetest : public ECRetest |
| 286 | { |
| 287 | public: |
| 288 | MyECRetest(OCIOGPUTest & test) : ECRetest(test) {} |
| 289 | |
| 290 | void retest1() |
| 291 | { |
| 292 | initializeGPUDynamicProperties(); |
| 293 | |
| 294 | if (m_contrastCPU) |
| 295 | { |
| 296 | m_contrastCPU->setValue(0.5); |
| 297 | m_contrastGPU->setValue(m_contrastCPU->getValue()); |
| 298 | } |
| 299 | if (m_exposureCPU) |
| 300 | { |
| 301 | m_exposureCPU->setValue(1.1); |
| 302 | m_exposureGPU->setValue(m_exposureCPU->getValue()); |
| 303 | } |
| 304 | } |
| 305 | void retest2() |
| 306 | { |
| 307 | if (m_contrastCPU) |
| 308 | { |
| 309 | m_contrastCPU->setValue(0.7); |
| 310 | m_contrastGPU->setValue(m_contrastCPU->getValue()); |
| 311 | } |
| 312 | if (m_exposureCPU) |
| 313 | { |
| 314 | m_exposureCPU->setValue(2.1); |
| 315 | m_exposureGPU->setValue(m_exposureCPU->getValue()); |
| 316 | } |
no test coverage detected