Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R3D #4216

Merged
merged 19 commits into from
Apr 20, 2024
Merged

R3D #4216

Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions src/cmake/modules/FindR3DSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,28 @@ include (FindPackageHandleStandardArgs)
# Assuming only C++11 and 64 bit support is needed.
# Set R3DSDK_LIB_NAME before invoking this file to override.
if (NOT DEFINED R3DSDK_LIB_NAME)
set(R3DSDK_LIB_NAME R3DSDKPIC-cpp11)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(R3DSDK_LIB_NAME R3DSDKPIC-cpp11)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(R3DSDK_LIB_NAME R3DSDK-libcpp)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(R3DSDK_LIB_NAME R3DSDK-2017MT)
endif()
endif()


if(DEFINED ENV{R3DSDK_ROOT})
set(R3DSDK_ROOT $ENV{R3DSDK_ROOT})
# message("Using R3D SDK Root: " ${R3DSDK_ROOT})
message("Using R3D SDK Root: " ${R3DSDK_ROOT})
else()
# message("Looking for R3D SDK")
message("Looking for R3D SDK")

# The R3D SDK is supplied as a zip file that you can unpack anywhere.
# So try some plausible locations and hope for the best.
# Use a glob to try and avoid dealing with exact SDK version numbers.

file(GLOB R3DSDK_PATHS "/opt/R3DSDKv*"
"/Library/R3DSDKv*"
"C:/R3DSDKv*"
${CMAKE_CURRENT_SOURCE_DIR}/../R3DSDKv*
${CMAKE_CURRENT_SOURCE_DIR}/../../R3DSDKv*
Expand All @@ -46,23 +53,36 @@ else()
endif()

set(R3DSDK_INCLUDE_DIR ${R3DSDK_ROOT}/Include)
find_library(R3DSDK_LIBRARY NAMES ${R3DSDK_LIB_NAME}
PATHS ${R3DSDK_ROOT}/Lib/linux64/
${R3DSDK_ROOT}/Lib/win64/
NO_DEFAULT_PATH
)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_library(R3DSDK_LIBRARY NAMES ${R3DSDK_LIB_NAME}
PATHS ${R3DSDK_ROOT}/Lib/linux64/
lgritz marked this conversation as resolved.
Show resolved Hide resolved
NO_DEFAULT_PATH
)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
find_library(R3DSDK_LIBRARY NAMES ${R3DSDK_LIB_NAME}
PATHS ${R3DSDK_ROOT}/Lib/mac64/
NO_DEFAULT_PATH
)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
find_library(R3DSDK_LIBRARY NAMES ${R3DSDK_LIB_NAME}
PATHS ${R3DSDK_ROOT}/Lib/win64/
NO_DEFAULT_PATH
)
endif()

# handle the QUIETLY and REQUIRED arguments and set R3DSDK_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(R3DSDK DEFAULT_MSG R3DSDK_LIBRARY R3DSDK_INCLUDE_DIR)


# TODO : Ask somebody with a Mac to add support.
if(R3DSDK_FOUND)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(R3DSDK_LIBRARIES ${R3DSDK_LIBRARY} dl)
set(R3DSDK_RUNTIME_LIBRARIES ${R3DSDK_ROOT}/Redistributable/linux)
else()
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(R3DSDK_LIBRARIES ${R3DSDK_LIBRARY} dl)
set(R3DSDK_RUNTIME_LIBRARIES ${R3DSDK_ROOT}/Redistributable/mac)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(R3DSDK_LIBRARIES ${R3DSDK_LIBRARY})
set(R3DSDK_RUNTIME_LIBRARIES ${R3DSDK_ROOT}/Redistributable/win)
endif()
Expand Down
3 changes: 2 additions & 1 deletion src/iv/imageviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IsSpecSrgb(const ImageSpec& spec)
static const char *s_file_filters = ""
"Image Files (*.bmp *.cin *.dcm *.dds *.dpx *.fits *.gif *.hdr *.ico *.iff "
"*.jpg *.jpe *.jpeg *.jif *.jfif *.jfi *.jp2 *.j2k *.jxl *.exr *.png *.pbm *.pgm "
"*.ppm *.psd *.ptex *.rla *.sgi *.rgb *.rgba *.bw *.int *.inta *.pic *.tga "
"*.ppm *.psd *.ptex *.R3D *.r3d *.rla *.sgi *.rgb *.rgba *.bw *.int *.inta *.pic *.tga "
lgritz marked this conversation as resolved.
Show resolved Hide resolved
"*.tpic *.tif *.tiff *.tx *.env *.sm *.vsm *.vdb *.webp *.zfile);;"
"BMP (*.bmp);;"
"Cineon (*.cin);;"
Expand All @@ -85,6 +85,7 @@ static const char *s_file_filters = ""
"Portable Network Graphics (*.png);;"
"PNM / Netpbm (*.pbm *.pgm *.ppm);;"
"Ptex (*.ptex);;"
"R3D (*.R3D *.r3d);;"
"RLA (*.rla);;"
"SGI (*.sgi *.rgb *.rgba *.bw *.int *.inta);;"
"Softimage PIC (*.pic);;"
Expand Down
4 changes: 4 additions & 0 deletions src/libOpenImageIO/imageioplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ PLUGENTRY(png);
PLUGENTRY(pnm);
PLUGENTRY_RO(psd);
PLUGENTRY_RO(ptex);
PLUGENTRY_RO(r3d);
PLUGENTRY_RO(raw);
PLUGENTRY(rla);
PLUGENTRY(sgi);
Expand Down Expand Up @@ -404,6 +405,9 @@ catalog_builtin_plugins()
#if defined(USE_PTEX) && !defined(DISABLE_PTEX)
DECLAREPLUG_RO (ptex);
#endif
#if defined(USE_R3DSDK) && !defined(DISABLE_R3D)
DECLAREPLUG_RO (r3d);
#endif
#if defined(USE_LIBRAW) && !defined(DISABLE_RAW)
DECLAREPLUG_RO (raw);
#endif
Expand Down
Loading
Loading