Пример #1
0
EXRImageFileWriter::EXRImageFileWriter(
    const size_t            thread_count)
    : m_thread_count(static_cast<int>(thread_count))
{
    // Set the total maximum number of threads that are spawned for I/O operations.
    setGlobalThreadCount(m_thread_count);
}
void testCompositeDeepScanLine (const std::string & tempDir)
{
    
    cout << "\n\nTesting deep compositing interface basic functionality:\n" << endl;

    int passes=2;
    if (!ILMTHREAD_NAMESPACE::supportsThreads ())
    {
            passes=1;
    }
  

    srand(1);
    
    for(int pass=0;pass<2;pass++)
    {

        test_parts<float>(0, 1, true,  true,  tempDir);
        test_parts<float>(0, 1, false, false, tempDir);
        test_parts<half> (0, 1, true,  false, tempDir);
        test_parts<half> (0, 1, false, true,  tempDir);

        //
        // test pattern 1: tested by confirming data is written correctly and
        // then reading correct results in Nuke
        //
        test_parts<float>(1, 1, true,  false, tempDir);
        test_parts<float>(1, 1, false, true,  tempDir);
        test_parts<half> (1, 1, true,  true,  tempDir);
        test_parts<half> (1, 1, false, false, tempDir);


        cout << "Testing deep compositing across multiple parts:\n" << endl;

        test_parts<float>(0, 5, true,  false, tempDir);
        test_parts<float>(0, 5, false, true,  tempDir);
        test_parts<half> (0, 5, true,  false, tempDir);
        test_parts<half> (0, 5, false, true,  tempDir);

        test_parts<float>(1, 3, true,  true,  tempDir);
        test_parts<float>(1, 3, false, false, tempDir);
        test_parts<half> (1, 3, true,  true,  tempDir);
        test_parts<half> (1, 3, false, false, tempDir);

        test_parts<float>(1, 4, true,  true,  tempDir);
        test_parts<float>(1, 4, false, false, tempDir);
        test_parts<half> (1, 4, true,  false, tempDir);
        test_parts<half> (1, 4, false, true,  tempDir);

        if(passes==2 && pass==0)
        {
            cout << " testing with multithreading...\n";
            setGlobalThreadCount(64);
        }
    }
    cout << " ok\n" << endl;
}