From e7859956f82909d75dc49ac722859a867bdaa565 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Sat, 16 Nov 2024 20:02:16 +0100 Subject: [PATCH] rename ENABLE_EXPERIMENTAL_FEATURES to HEIF_ENABLE_EXPERIMENTAL_FEATURES to avoid name collisions in client software --- examples/heif_enc.cc | 8 ++++---- libheif/CMakeLists.txt | 2 +- libheif/api/libheif/heif_experimental.h | 16 ++++++++-------- libheif/api/libheif/heif_properties.cc | 2 +- libheif/box.cc | 6 +++--- libheif/box.h | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/heif_enc.cc b/examples/heif_enc.cc index f7808bd2f3..9e85d48824 100644 --- a/examples/heif_enc.cc +++ b/examples/heif_enc.cc @@ -210,7 +210,7 @@ void show_help(const char* argv0) << " --tiled-image-height # override image height of tiled image\n" << " --tiled-input-x-y usually, the first number in the input tile filename should be the y position.\n" << " With this option, this can be swapped so that the first number is x, the second number y.\n" -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES << " --tiling-method METHOD choose one of these methods: grid, tili, unci. The default is 'grid'.\n" << " --add-pyramid-group when several images are given, put them into a multi-resolution pyramid group.\n" #endif @@ -749,7 +749,7 @@ heif_image_handle* encode_tiled(heif_context* ctx, heif_encoder* encoder, heif_e return nullptr; } } -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES else if (tiling_method == "tili") { heif_tiled_image_parameters tiled_params{}; tiled_params.version = 1; @@ -974,7 +974,7 @@ int main(int argc, char** argv) case OPTION_TILING_METHOD: tiling_method = optarg; if (tiling_method != "grid" -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES && tiling_method != "tili" && tiling_method != "unci" #endif ) { @@ -1393,7 +1393,7 @@ int main(int argc, char** argv) heif_image_handle_release(primary_image_handle); } -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES if (add_pyramid_group && encoded_image_ids.size() > 1) { error = heif_context_add_pyramid_entity_group(context.get(), encoded_image_ids.data(), encoded_image_ids.size(), nullptr); if (error.code) { diff --git a/libheif/CMakeLists.txt b/libheif/CMakeLists.txt index 194c445586..359cb15032 100644 --- a/libheif/CMakeLists.txt +++ b/libheif/CMakeLists.txt @@ -136,7 +136,7 @@ if (ENABLE_EXPERIMENTAL_FEATURES) list(APPEND libheif_headers api/libheif/heif_experimental.h) - target_compile_definitions(heif PUBLIC ENABLE_EXPERIMENTAL_FEATURES) + target_compile_definitions(heif PUBLIC HEIF_ENABLE_EXPERIMENTAL_FEATURES) endif() # Needed to find libheif/heif_version.h while compiling the library diff --git a/libheif/api/libheif/heif_experimental.h b/libheif/api/libheif/heif_experimental.h index 359cc46ecd..7d6d1b8361 100644 --- a/libheif/api/libheif/heif_experimental.h +++ b/libheif/api/libheif/heif_experimental.h @@ -27,7 +27,7 @@ extern "C" { #endif -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES /* =================================================================================== * This file contains candidate APIs that did not make it into the public API yet. @@ -137,7 +137,7 @@ struct heif_tiled_image_parameters { uint8_t tiles_are_sequential; // TODO: can we derive this automatically }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES LIBHEIF_API struct heif_error heif_context_add_tiled_image(struct heif_context* ctx, const struct heif_tiled_image_parameters* parameters, @@ -177,7 +177,7 @@ struct heif_unci_image_parameters { // TODO: interleave type, padding }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES LIBHEIF_API struct heif_error heif_context_add_unci_image(struct heif_context* ctx, const struct heif_unci_image_parameters* parameters, @@ -195,7 +195,7 @@ struct heif_pyramid_layer_info { uint32_t tile_columns_in_layer; }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES // The input images are automatically sorted according to resolution. You can provide them in any order. LIBHEIF_API struct heif_error heif_context_add_pyramid_entity_group(struct heif_context* ctx, @@ -221,7 +221,7 @@ enum heif_channel_datatype heif_channel_datatype_complex_number = 4 }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES LIBHEIF_API struct heif_error heif_image_add_channel(struct heif_image* image, enum heif_channel channel, @@ -245,7 +245,7 @@ struct heif_complex64 { double real, imaginary; }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES LIBHEIF_API enum heif_channel_datatype heif_image_get_datatype(const struct heif_image* img, enum heif_channel channel); @@ -372,7 +372,7 @@ struct heif_tai_clock_info }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES int heif_is_tai_clock_info_drift_rate_undefined(int32_t drift_rate); @@ -404,7 +404,7 @@ struct heif_tai_timestamp_packet uint8_t timestamp_is_modified; // bool }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES // Creates a new TAI timestamp property if one doesn't already exist for itemId. // Creates a new clock info property if one doesn't already exist for itemId. diff --git a/libheif/api/libheif/heif_properties.cc b/libheif/api/libheif/heif_properties.cc index 167e0aefec..93d71c9304 100644 --- a/libheif/api/libheif/heif_properties.cc +++ b/libheif/api/libheif/heif_properties.cc @@ -358,7 +358,7 @@ struct heif_error find_property(const struct heif_context* context, } -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES const uint64_t heif_tai_clock_info_unknown_time_uncertainty = 0xFFFFFFFFFFFFFFFF; const uint64_t heif_unknown_tai_timestamp = 0xFFFFFFFFFFFFFFFF; const int32_t heif_tai_clock_info_unknown_drift_rate = 0x7FFFFFFF; diff --git a/libheif/box.cc b/libheif/box.cc index e4dd5be767..666663b954 100644 --- a/libheif/box.cc +++ b/libheif/box.cc @@ -672,7 +672,7 @@ Error Box::read(BitstreamRange& range, std::shared_ptr* result, const heif_ box = std::make_shared(); break; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES // --- TAI timestamps case fourcc("itai"): @@ -690,7 +690,7 @@ Error Box::read(BitstreamRange& range, std::shared_ptr* result, const heif_ box = std::make_shared(); break; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES case fourcc("tilC"): box = std::make_shared(); break; @@ -4618,7 +4618,7 @@ Error Box_cmex::write(StreamWriter& writer) const } -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES std::string Box_taic::dump(Indent& indent) const { std::ostringstream sstr; sstr << Box::dump(indent); diff --git a/libheif/box.h b/libheif/box.h index 551d749716..71f4504105 100644 --- a/libheif/box.h +++ b/libheif/box.h @@ -1580,7 +1580,7 @@ class Box_udes : public FullBox }; -#if ENABLE_EXPERIMENTAL_FEATURES +#if HEIF_ENABLE_EXPERIMENTAL_FEATURES class Box_taic : public FullBox { public: