Skip to content

Commit

Permalink
- Conditionally enable latest Libraw features.
Browse files Browse the repository at this point in the history
- Remove obsolete BUILD_MISSING_DEPS from master Makefile.
  Use CMake option directly: make OpenImageIO_BUILD_MISSING_DEPS=all
- During the 'Refind' step, explicitly pass locally installed version to find_packege().
  This avoids the situation where CMake may still pick system version of the library
  which does not match minimum version requirements specified in externalpackages.cmake.


Signed-off-by: kuba <[email protected]>
  • Loading branch information
kaarrot committed Oct 20, 2024
1 parent a946288 commit 42b282e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ ifneq (${CLANG_FORMAT_EXCLUDES},)
MY_CMAKE_FLAGS += -DCLANG_FORMAT_EXCLUDES:STRING=${CLANG_FORMAT_EXCLUDES}
endif

ifneq (${BUILD_MISSING_DEPS},)
MY_CMAKE_FLAGS += -DBUILD_MISSING_DEPS:BOOL=${BUILD_MISSING_DEPS}
endif


#$(info MY_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})

Expand Down Expand Up @@ -395,7 +390,6 @@ help:
@echo " 0, sse2, sse3, ssse3, sse4.1, sse4.2, f16c,"
@echo " avx, avx2, avx512f)"
@echo " TEX_BATCH_SIZE=16 Override TextureSystem SIMD batch size"
@echo " BUILD_MISSING_DEPS=1 Try to download/build missing dependencies"
@echo " make test, extra options:"
@echo " TEST=regex Run only tests matching the regex"
@echo ""
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/dependency_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ macro (checked_find_package pkgname)
# ${pkgname}_REFIND_ARGS : additional arguments to pass to find_package
if (${pkgname}_REFIND)
message (STATUS "Refinding ${pkgname} with ${pkgname}_ROOT=${${pkgname}_ROOT}")
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS} ${${pkgname}_REFIND_ARGS})
find_package (${pkgname} ${${pkgname}_REFIND_VERSION} REQUIRED ${_pkg_UNPARSED_ARGUMENTS} ${${pkgname}_REFIND_ARGS})
unset (${pkgname}_REFIND)
endif()
# It's all downhill from here: if we found the package, follow the
Expand Down
18 changes: 15 additions & 3 deletions src/raw.imageio/rawinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,11 @@ RawInput::open_raw(bool unpack, const std::string& name,
// Output 16 bit images
m_processor->imgdata.params.output_bps = 16;

#if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 21, 0)
// Exposing max_raw_memory_mb setting. Default max is 2048.
m_processor->imgdata.rawparams.max_raw_memory_mb
= config.get_int_attribute("raw:max_raw_memory_mb", 2048);

#endif

// Disable exposure correction (unless config "raw:auto_bright" == 1)
m_processor->imgdata.params.no_auto_bright
Expand Down Expand Up @@ -715,15 +716,26 @@ RawInput::open_raw(bool unpack, const std::string& name,
crop_top = p->get_int_indexed(1);
crop_width = p->get_int_indexed(2);
crop_height = p->get_int_indexed(3);
} else if (m_processor->imgdata.sizes.raw_inset_crops[0].cwidth != 0) {
}
#if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 21, 0)
else if (m_processor->imgdata.sizes.raw_inset_crops[0].cwidth != 0) {
crop_left = m_processor->imgdata.sizes.raw_inset_crops[0].cleft;
crop_top = m_processor->imgdata.sizes.raw_inset_crops[0].ctop;
crop_width = m_processor->imgdata.sizes.raw_inset_crops[0].cwidth;
crop_height = m_processor->imgdata.sizes.raw_inset_crops[0].cheight;
left_margin = m_processor->imgdata.sizes.left_margin;
top_margin = m_processor->imgdata.sizes.top_margin;
}

#else
else if (m_processor->imgdata.sizes.raw_inset_crop.cwidth != 0) {
crop_left = m_processor->imgdata.sizes.raw_inset_crop.cleft;
crop_top = m_processor->imgdata.sizes.raw_inset_crop.ctop;
crop_width = m_processor->imgdata.sizes.raw_inset_crop.cwidth;
crop_height = m_processor->imgdata.sizes.raw_inset_crop.cheight;
left_margin = m_processor->imgdata.sizes.left_margin;
top_margin = m_processor->imgdata.sizes.top_margin;
}
#endif
if (crop_width > 0 && crop_height > 0) {
ushort image_width = m_processor->imgdata.sizes.width;
ushort image_height = m_processor->imgdata.sizes.height;
Expand Down

0 comments on commit 42b282e

Please sign in to comment.