Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa521922c9 |
@@ -78,45 +78,84 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# CPython 64 bits
|
||||
# CPython 64 bits manylinux_2_28
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 64 bits
|
||||
- build: CPython 3.7 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp37-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.8 64 bits
|
||||
- build: CPython 3.8 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp38-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.9 64 bits
|
||||
- build: CPython 3.9 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp39-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.10 64 bits
|
||||
- build: CPython 3.10 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp310-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.11 64 bits
|
||||
- build: CPython 3.11 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp311-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.12 64 bits
|
||||
- build: CPython 3.12 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp312-manylinux*
|
||||
arch: x86_64
|
||||
# -------------------------------------------------------------------
|
||||
# CPython ARM 64 bits
|
||||
# CPython 64 bits manylinux2014
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 ARM 64 bits
|
||||
- build: CPython 3.7 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp37-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.8 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp38-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.9 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp39-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.10 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp310-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.11 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp311-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.12 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp312-manylinux*
|
||||
arch: x86_64
|
||||
# -------------------------------------------------------------------
|
||||
# CPython ARM 64 bits manylinux2014
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp37-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.8 ARM 64 bits
|
||||
- build: CPython 3.8 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp38-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.9 ARM 64 bits
|
||||
- build: CPython 3.9 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp39-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.10 ARM 64 bits
|
||||
- build: CPython 3.10 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp310-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.11 ARM 64 bits
|
||||
- build: CPython 3.11 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp311-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.12 ARM 64 bits
|
||||
- build: CPython 3.12 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp312-manylinux*
|
||||
arch: aarch64
|
||||
|
||||
@@ -138,6 +177,8 @@ jobs:
|
||||
env:
|
||||
CIBW_BUILD: ${{ matrix.python }}
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
|
||||
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }}
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ endif()
|
||||
# Project definition.
|
||||
|
||||
project(OpenColorIO
|
||||
VERSION 2.3.1
|
||||
VERSION 2.3.2
|
||||
DESCRIPTION "OpenColorIO (OCIO) is a complete color management solution"
|
||||
HOMEPAGE_URL https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
LANGUAGES CXX C)
|
||||
|
||||
@@ -26,10 +26,6 @@ test-command = [
|
||||
"ociocheck"
|
||||
]
|
||||
|
||||
manylinux-x86_64-image = "manylinux2014"
|
||||
manylinux-i686-image = "manylinux2014"
|
||||
manylinux-aarch64-image = "manylinux2014"
|
||||
|
||||
[tool.cibuildwheel.linux]
|
||||
before-build = "share/ci/scripts/linux/yum/install_docs_env.sh"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ endif()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -msse3")
|
||||
set(CMAKE_CXX_FLAGS "-w -mssse3")
|
||||
endif()
|
||||
|
||||
if (APPLE AND __universal_build)
|
||||
|
||||
@@ -107,10 +107,10 @@ CPUInfo::CPUInfo()
|
||||
flags |= X86_CPU_FLAG_SSE42;
|
||||
|
||||
/* Check OSXSAVE and AVX bits */
|
||||
if (info.reg.ecx & 0x18000000)
|
||||
if ((info.reg.ecx & 0x18000000) == 0x18000000)
|
||||
{
|
||||
xcr = xgetbv();
|
||||
if(xcr & 0x6) {
|
||||
if((xcr & 0x6) == 0x6) {
|
||||
flags |= X86_CPU_FLAG_AVX;
|
||||
|
||||
if(info.reg.ecx & 0x20000000) {
|
||||
@@ -129,7 +129,7 @@ CPUInfo::CPUInfo()
|
||||
|
||||
/* OPMASK/ZMM state */
|
||||
if ((xcr & 0xe0) == 0xe0) {
|
||||
if ((flags & X86_CPU_FLAG_AVX2) && (info.reg.ebx & 0xd0030000))
|
||||
if ((flags & X86_CPU_FLAG_AVX2) && ((info.reg.ebx & 0xd0030000) == 0xd0030000))
|
||||
flags |= X86_CPU_FLAG_AVX512;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
#include <pystring.h>
|
||||
|
||||
#include "ConfigUtils.h"
|
||||
#include "MathUtils.h"
|
||||
#include "pystring/pystring.h"
|
||||
#include "utils/StringUtils.h"
|
||||
|
||||
namespace OCIO_NAMESPACE
|
||||
|
||||
+134
-47
@@ -50,12 +50,16 @@ public:
|
||||
void setGPU(OCIO::ConstGPUProcessorRcPtr gpu)
|
||||
{
|
||||
m_gpu = gpu;
|
||||
m_oglApp = OCIO::OglApp::CreateOglApp("ociochecklut", 256, 20);
|
||||
|
||||
if (m_verbose)
|
||||
if (!m_oglApp)
|
||||
{
|
||||
m_oglApp->printGLInfo();
|
||||
m_oglApp = OCIO::OglApp::CreateOglApp("ociochecklut", 256, 20);
|
||||
|
||||
if (m_verbose)
|
||||
{
|
||||
m_oglApp->printGLInfo();
|
||||
}
|
||||
}
|
||||
|
||||
m_oglApp->setPrintShader(m_verbose);
|
||||
float image[4]{ 0.f, 0.f, 0.f, 0.f };
|
||||
m_oglApp->initImage(1, 1, OCIO::OglApp::COMPONENTS_RGBA, image);
|
||||
@@ -191,6 +195,7 @@ int main (int argc, const char* argv[])
|
||||
bool usegpu = false;
|
||||
bool usegpuLegacy = false;
|
||||
bool outputgpuInfo = false;
|
||||
bool stepInfo = false;
|
||||
|
||||
ArgParse ap;
|
||||
ap.options("ociochecklut -- check any LUT file and optionally convert a pixel\n\n"
|
||||
@@ -199,6 +204,7 @@ int main (int argc, const char* argv[])
|
||||
"<SEPARATOR>", "Options:",
|
||||
"-t", &test, "Test a set a predefined RGB values",
|
||||
"-v", &verbose, "Verbose",
|
||||
"-s", &stepInfo, "Print the output after each step in a multi - transform LUT",
|
||||
"--help", &help, "Print help message",
|
||||
"--inv", &invlut, "Apply LUT in inverse direction",
|
||||
"--gpu", &usegpu, "Use GPU instead of CPU",
|
||||
@@ -346,7 +352,7 @@ int main (int argc, const char* argv[])
|
||||
0.f, 1.f, 0.f,
|
||||
0.f, 0.f, 1.f };
|
||||
|
||||
if (verbose)
|
||||
if (verbose || stepInfo)
|
||||
{
|
||||
std::cout << std::endl;
|
||||
}
|
||||
@@ -357,59 +363,140 @@ int main (int argc, const char* argv[])
|
||||
{
|
||||
std::vector<float> pixel = { input[curPix], input[curPix+1], input[curPix+2],
|
||||
comp == 3 ? 0.0f : input[curPix + 3] };
|
||||
try
|
||||
{
|
||||
proc.apply(pixel);
|
||||
}
|
||||
catch (const OCIO::Exception & e)
|
||||
{
|
||||
std::cerr << "ERROR: Processing pixel: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "ERROR: Unknown error encountered while processing pixel." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Print to string so that in & out values can be aligned if needed.
|
||||
|
||||
std::vector<std::string> out;
|
||||
ToString(out, pixel, 0, comp);
|
||||
|
||||
if (verbose)
|
||||
if (stepInfo)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
ToString(in, input, curPix, comp);
|
||||
|
||||
std::cout << "Input [R G B";
|
||||
if (comp == 4)
|
||||
// Process each step in a multi - transform LUT
|
||||
try
|
||||
{
|
||||
std::cout << " A";
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(in, out, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
// Create GroupTransform so that each can be processed one at a time.
|
||||
auto processor = config->getProcessor(t);
|
||||
auto transform = processor->createGroupTransform();
|
||||
std::vector<float> inputPixel = pixel;
|
||||
std::vector<float> outputPixel = pixel;
|
||||
const auto numTransforms = transform->getNumTransforms();
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
std::cout << "Output [R G B";
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " A";
|
||||
for (int i = 0; i < numTransforms; ++i)
|
||||
{
|
||||
auto transformStep = transform->getTransform(i);
|
||||
auto processorStep = config->getProcessor(transformStep);
|
||||
|
||||
if (usegpu || usegpuLegacy)
|
||||
{
|
||||
proc.setGPU(usegpuLegacy ? processorStep->getOptimizedLegacyGPUProcessor(OCIO::OPTIMIZATION_DEFAULT, 32)
|
||||
: processorStep->getDefaultGPUProcessor());
|
||||
}
|
||||
else
|
||||
{
|
||||
proc.setCPU(processorStep->getDefaultCPUProcessor());
|
||||
}
|
||||
|
||||
// Process the pixel
|
||||
proc.apply(outputPixel);
|
||||
|
||||
// Print the input/output pixel
|
||||
std::vector<std::string> in;
|
||||
ToString(in, inputPixel, 0, comp);
|
||||
|
||||
std::vector<std::string> out;
|
||||
ToString(out, outputPixel, 0, comp);
|
||||
|
||||
std::cout << "\n" << *(transform->getTransform(i)) << std::endl;
|
||||
std::cout << "Input [R G B";
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " A";
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(in, out, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
|
||||
std::cout << "Output [R G B";
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " A";
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(out, in, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
|
||||
inputPixel = outputPixel;
|
||||
}
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(out, in, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
catch (const OCIO::Exception& exception)
|
||||
{
|
||||
std::cerr << "ERROR: " << exception.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "ERROR: Unknown error encountered while processing single step operator." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
curPix += comp;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << out[0] << " " << out[1] << " " << out[2];
|
||||
if (comp == 4)
|
||||
// Process in a single step
|
||||
try
|
||||
{
|
||||
std::cout << " " << out[3];
|
||||
proc.apply(pixel);
|
||||
}
|
||||
catch (const OCIO::Exception& e)
|
||||
{
|
||||
std::cerr << "ERROR: Processing pixel: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "ERROR: Unknown error encountered while processing pixel." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Print to string so that in & out values can be aligned if needed.
|
||||
|
||||
std::vector<std::string> out;
|
||||
ToString(out, pixel, 0, comp);
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
curPix += comp;
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
ToString(in, input, curPix, comp);
|
||||
|
||||
std::cout << "Input [R G B";
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " A";
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(in, out, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
|
||||
std::cout << "Output [R G B";
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " A";
|
||||
}
|
||||
std::cout << "]: [";
|
||||
PrintAlignedVec(out, in, comp);
|
||||
std::cout << "]" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << out[0] << " " << out[1] << " " << out[2];
|
||||
if (comp == 4)
|
||||
{
|
||||
std::cout << " " << out[3];
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
curPix += comp;
|
||||
}
|
||||
}
|
||||
else if (test)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ OCIO_ADD_TEST(StringUtils, trim)
|
||||
|
||||
{
|
||||
// Test that no assert happens when the Trim argument is not an unsigned char (see issue #1874).
|
||||
constexpr char ref2[]{ -1, -2, -3, '\0' };
|
||||
constexpr char ref2[]{ char(-1), char(-2), char(-3), '\0' };
|
||||
const std::string str = StringUtils::Trim(ref2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user