Commit 6c090416 for libheif

commit 6c090416c74951e21d25291e17dc1d79bee752ee
Author: Dirk Farin <dirk.farin@gmail.com>
Date:   Fri Feb 27 14:03:36 2026 +0100

    move component-access function to public API (heif_uncompressed.h)

diff --git a/heifio/decoder_tiff.cc b/heifio/decoder_tiff.cc
index ba3ce92d..aaf24e9f 100644
--- a/heifio/decoder_tiff.cc
+++ b/heifio/decoder_tiff.cc
@@ -38,7 +38,6 @@ extern "C" {
 }

 #include "decoder_tiff.h"
-#include "libheif/heif_experimental.h"
 #include "libheif/heif_uncompressed.h"

 static struct heif_error heif_error_ok = {heif_error_Ok, heif_suberror_Unspecified, "Success"};
@@ -547,6 +546,7 @@ heif_error readBandInterleave(TIFF *tif, uint16_t samplesPerPixel, bool hasAlpha
 }


+#if WITH_UNCOMPRESSED_CODEC
 static heif_error readMonoFloat(TIFF* tif, heif_image** image)
 {
   uint32_t width, height;
@@ -587,6 +587,7 @@ static heif_error readMonoFloat(TIFF* tif, heif_image** image)

   return heif_error_ok;
 }
+#endif


 static void suppress_warnings(const char* module, const char* fmt, va_list ap) {
@@ -664,6 +665,7 @@ static heif_error readTiledContiguous(TIFF* tif, uint32_t width, uint32_t height
   bool isFloat = (sampleFormat == SAMPLEFORMAT_IEEEFP);

   if (isFloat) {
+#if WITH_UNCOMPRESSED_CODEC
     heif_error err = heif_image_create((int)width, (int)height, heif_colorspace_nonvisual, heif_chroma_undefined, out_image);
     if (err.code != heif_error_Ok) return err;

@@ -714,6 +716,10 @@ static heif_error readTiledContiguous(TIFF* tif, uint32_t width, uint32_t height
     }

     return heif_error_ok;
+#else
+    return {heif_error_Unsupported_feature, heif_suberror_Unspecified,
+            "Floating point TIFF requires uncompressed codec support (WITH_UNCOMPRESSED_CODEC)."};
+#endif
   }

   uint16_t outSpp = (samplesPerPixel == 4 && !hasAlpha) ? 3 : samplesPerPixel;
@@ -822,9 +828,14 @@ static heif_error readTiledSeparate(TIFF* tif, uint32_t width, uint32_t height,
 {
   // For mono float, separate layout is the same as contiguous (1 sample)
   if (sampleFormat == SAMPLEFORMAT_IEEEFP) {
+#if WITH_UNCOMPRESSED_CODEC
     return readTiledContiguous(tif, width, height, tile_width, tile_height,
                                samplesPerPixel, hasAlpha, bps, output_bit_depth,
                                sampleFormat, out_image);
+#else
+    return {heif_error_Unsupported_feature, heif_suberror_Unspecified,
+            "Floating point TIFF requires uncompressed codec support (WITH_UNCOMPRESSED_CODEC)."};
+#endif
   }

   uint16_t outSpp = (samplesPerPixel == 4 && !hasAlpha) ? 3 : samplesPerPixel;
@@ -943,7 +954,12 @@ heif_error loadTIFF(const char* filename, int output_bit_depth, InputImage *inpu
   }
   else {
     if (isFloat) {
+#if WITH_UNCOMPRESSED_CODEC
       err = readMonoFloat(tif, &image);
+#else
+      return {heif_error_Unsupported_feature, heif_suberror_Unspecified,
+              "Floating point TIFF requires uncompressed codec support (WITH_UNCOMPRESSED_CODEC)."};
+#endif
     }
     else {
       switch (config) {
@@ -1116,6 +1132,7 @@ heif_error TiledTiffReader::readTile(uint32_t tx, uint32_t ty, int output_bit_de
   uint32_t actual_h = std::min(m_tile_height, m_image_height - ty * m_tile_height);

   if (m_sample_format == SAMPLEFORMAT_IEEEFP) {
+#if WITH_UNCOMPRESSED_CODEC
     heif_error err = heif_image_create((int)actual_w, (int)actual_h, heif_colorspace_nonvisual, heif_chroma_undefined, out_image);
     if (err.code != heif_error_Ok) return err;

@@ -1155,6 +1172,10 @@ heif_error TiledTiffReader::readTile(uint32_t tx, uint32_t ty, int output_bit_de
     }

     return heif_error_ok;
+#else
+    return {heif_error_Unsupported_feature, heif_suberror_Unspecified,
+            "Floating point TIFF requires uncompressed codec support (WITH_UNCOMPRESSED_CODEC)."};
+#endif
   }

   int effectiveBitDepth = (m_bits_per_sample <= 8) ? 8 : output_bit_depth;
diff --git a/heifio/decoder_tiff.h b/heifio/decoder_tiff.h
index ebdf6575..1a9782c6 100644
--- a/heifio/decoder_tiff.h
+++ b/heifio/decoder_tiff.h
@@ -29,7 +29,6 @@

 #include "decoder.h"
 #include "libheif/heif.h"
-#include "libheif/heif_experimental.h"
 #include <memory>
 #include <cstdint>
 #include <vector>
diff --git a/libheif/api/libheif/heif_experimental.cc b/libheif/api/libheif/heif_experimental.cc
index 9fedd7bc..5f4be4b6 100644
--- a/libheif/api/libheif/heif_experimental.cc
+++ b/libheif/api/libheif/heif_experimental.cc
@@ -340,164 +340,6 @@ void heif_pyramid_layer_info_release(heif_pyramid_layer_info* infos)
 }


-// --- index-based component access
-
-uint32_t heif_image_get_number_of_used_components(const heif_image* image)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_number_of_used_components();
-}
-
-
-uint32_t heif_image_get_total_number_of_cmpd_components(const heif_image* image)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_total_number_of_cmpd_components();
-}
-
-
-void heif_image_get_used_component_indices(const heif_image* image, uint32_t* out_component_indices)
-{
-  if (!image || !image->image || !out_component_indices) {
-    return;
-  }
-
-  auto indices = image->image->get_used_component_indices();
-  for (size_t i = 0; i < indices.size(); i++) {
-    out_component_indices[i] = indices[i];
-  }
-}
-
-
-heif_channel heif_image_get_component_channel(const heif_image* image, uint32_t component_idx)
-{
-  if (!image || !image->image) {
-    return heif_channel_Y;
-  }
-  return image->image->get_component_channel(component_idx);
-}
-
-
-uint32_t heif_image_get_component_width(const heif_image* image, uint32_t component_idx)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_component_width(component_idx);
-}
-
-
-uint32_t heif_image_get_component_height(const heif_image* image, uint32_t component_idx)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_component_height(component_idx);
-}
-
-
-int heif_image_get_component_bits_per_pixel(const heif_image* image, uint32_t component_idx)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_component_bits_per_pixel(component_idx);
-}
-
-
-uint16_t heif_image_get_component_type(const heif_image* image, uint32_t component_idx)
-{
-  if (!image || !image->image) {
-    return 0;
-  }
-  return image->image->get_component_type(component_idx);
-}
-
-
-heif_error heif_image_add_component(heif_image* image,
-                                    int width, int height,
-                                    uint16_t component_type,
-                                    heif_channel_datatype datatype,
-                                    int bit_depth,
-                                    uint32_t* out_component_idx)
-{
-  if (!image || !image->image) {
-    return heif_error_null_pointer_argument;
-  }
-
-  auto result = image->image->add_component(width, height, component_type, datatype, bit_depth, nullptr);
-  if (!result) {
-    return result.error_struct(image->image.get());
-  }
-
-  if (out_component_idx) {
-    *out_component_idx = *result;
-  }
-
-  return heif_error_success;
-}
-
-
-const uint8_t* heif_image_get_component_readonly(const heif_image* image, uint32_t component_idx, size_t* out_stride)
-{
-  if (!image || !image->image) {
-    if (out_stride) *out_stride = 0;
-    return nullptr;
-  }
-  return image->image->get_component(component_idx, out_stride);
-}
-
-
-uint8_t* heif_image_get_component(heif_image* image, uint32_t component_idx, size_t* out_stride)
-{
-  if (!image || !image->image) {
-    if (out_stride) *out_stride = 0;
-    return nullptr;
-  }
-  return image->image->get_component(component_idx, out_stride);
-}
-
-
-#define heif_image_get_component_X(name, type) \
-const type* heif_image_get_component_ ## name ## _readonly(const struct heif_image* image, \
-                                                            uint32_t component_idx, \
-                                                            size_t* out_stride) \
-{                                                            \
-  if (!image || !image->image) {                             \
-    if (out_stride) *out_stride = 0;                         \
-    return nullptr;                                          \
-  }                                                          \
-  return image->image->get_component_data<type>(component_idx, out_stride); \
-}                                                            \
-                                                             \
-type* heif_image_get_component_ ## name (struct heif_image* image, \
-                                         uint32_t component_idx,  \
-                                         size_t* out_stride)      \
-{                                                            \
-  if (!image || !image->image) {                             \
-    if (out_stride) *out_stride = 0;                         \
-    return nullptr;                                          \
-  }                                                          \
-  return image->image->get_component_data<type>(component_idx, out_stride); \
-}
-
-heif_image_get_component_X(uint16, uint16_t)
-heif_image_get_component_X(uint32, uint32_t)
-heif_image_get_component_X(uint64, uint64_t)
-heif_image_get_component_X(int8, int8_t)
-heif_image_get_component_X(int16, int16_t)
-heif_image_get_component_X(int32, int32_t)
-heif_image_get_component_X(int64, int64_t)
-heif_image_get_component_X(float32, float)
-heif_image_get_component_X(float64, double)
-heif_image_get_component_X(complex32, heif_complex32)
-heif_image_get_component_X(complex64, heif_complex64)
-
-
 #endif


diff --git a/libheif/api/libheif/heif_experimental.h b/libheif/api/libheif/heif_experimental.h
index d2d7a546..e2d35d4c 100644
--- a/libheif/api/libheif/heif_experimental.h
+++ b/libheif/api/libheif/heif_experimental.h
@@ -177,140 +177,6 @@ LIBHEIF_API
 void heif_pyramid_layer_info_release(heif_pyramid_layer_info*);
 #endif

-// --- other pixel datatype support
-
-typedef enum heif_channel_datatype
-{
-  heif_channel_datatype_undefined = 0,
-  heif_channel_datatype_unsigned_integer = 1,
-  heif_channel_datatype_signed_integer = 2,
-  heif_channel_datatype_floating_point = 3,
-  heif_channel_datatype_complex_number = 4
-} heif_channel_datatype;
-
-typedef struct heif_complex32
-{
-  float real, imaginary;
-} heif_complex32;
-
-typedef struct heif_complex64
-{
-  double real, imaginary;
-} heif_complex64;
-
-#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
-
-// --- index-based component access (for ISO 23001-17 multi-component images)
-
-// Returns the number of components that have pixel data (planes) in this image.
-LIBHEIF_API
-uint32_t heif_image_get_number_of_used_components(const heif_image*);
-
-// Returns the total number of components declared in the cmpd box.
-LIBHEIF_API
-uint32_t heif_image_get_total_number_of_cmpd_components(const heif_image*);
-
-// Fills `out_component_indices` with the valid component indices.
-// The caller must allocate an array of at least heif_image_get_number_of_used_components() elements.
-LIBHEIF_API
-void heif_image_get_used_component_indices(const heif_image*, uint32_t* out_component_indices);
-
-LIBHEIF_API
-enum heif_channel heif_image_get_component_channel(const heif_image*, uint32_t component_idx);
-
-LIBHEIF_API
-uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_idx);
-
-LIBHEIF_API
-uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_idx);
-
-LIBHEIF_API
-int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_idx);
-
-LIBHEIF_API
-uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_idx);
-
-LIBHEIF_API
-heif_error heif_image_add_component(heif_image* image,
-                                    int width, int height,
-                                    uint16_t component_type,
-                                    heif_channel_datatype datatype,
-                                    int bit_depth,
-                                    uint32_t* out_component_idx);
-
-LIBHEIF_API
-const uint8_t* heif_image_get_component_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-uint8_t* heif_image_get_component(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const uint16_t* heif_image_get_component_uint16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const uint32_t* heif_image_get_component_uint32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const uint64_t* heif_image_get_component_uint64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const int8_t* heif_image_get_component_int8_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const int16_t* heif_image_get_component_int16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const int32_t* heif_image_get_component_int32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const int64_t* heif_image_get_component_int64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-float* heif_image_get_component_float32(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-double* heif_image_get_component_float64(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const heif_complex32* heif_image_get_component_complex32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-const heif_complex64* heif_image_get_component_complex64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
-
-LIBHEIF_API
-heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_idx, size_t* out_stride);
-
-#endif

 #ifdef __cplusplus
 }
diff --git a/libheif/api/libheif/heif_uncompressed.cc b/libheif/api/libheif/heif_uncompressed.cc
index c231a533..b1169a72 100644
--- a/libheif/api/libheif/heif_uncompressed.cc
+++ b/libheif/api/libheif/heif_uncompressed.cc
@@ -605,6 +605,164 @@ void heif_unci_image_parameters_release(heif_unci_image_parameters* params)
 }


+// --- index-based component access
+
+uint32_t heif_image_get_number_of_used_components(const heif_image* image)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_number_of_used_components();
+}
+
+
+uint32_t heif_image_get_total_number_of_cmpd_components(const heif_image* image)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_total_number_of_cmpd_components();
+}
+
+
+void heif_image_get_used_component_indices(const heif_image* image, uint32_t* out_component_indices)
+{
+  if (!image || !image->image || !out_component_indices) {
+    return;
+  }
+
+  auto indices = image->image->get_used_component_indices();
+  for (size_t i = 0; i < indices.size(); i++) {
+    out_component_indices[i] = indices[i];
+  }
+}
+
+
+heif_channel heif_image_get_component_channel(const heif_image* image, uint32_t component_idx)
+{
+  if (!image || !image->image) {
+    return heif_channel_Y;
+  }
+  return image->image->get_component_channel(component_idx);
+}
+
+
+uint32_t heif_image_get_component_width(const heif_image* image, uint32_t component_idx)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_component_width(component_idx);
+}
+
+
+uint32_t heif_image_get_component_height(const heif_image* image, uint32_t component_idx)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_component_height(component_idx);
+}
+
+
+int heif_image_get_component_bits_per_pixel(const heif_image* image, uint32_t component_idx)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_component_bits_per_pixel(component_idx);
+}
+
+
+uint16_t heif_image_get_component_type(const heif_image* image, uint32_t component_idx)
+{
+  if (!image || !image->image) {
+    return 0;
+  }
+  return image->image->get_component_type(component_idx);
+}
+
+
+heif_error heif_image_add_component(heif_image* image,
+                                    int width, int height,
+                                    uint16_t component_type,
+                                    heif_channel_datatype datatype,
+                                    int bit_depth,
+                                    uint32_t* out_component_idx)
+{
+  if (!image || !image->image) {
+    return heif_error_null_pointer_argument;
+  }
+
+  auto result = image->image->add_component(width, height, component_type, datatype, bit_depth, nullptr);
+  if (!result) {
+    return result.error_struct(image->image.get());
+  }
+
+  if (out_component_idx) {
+    *out_component_idx = *result;
+  }
+
+  return heif_error_success;
+}
+
+
+const uint8_t* heif_image_get_component_readonly(const heif_image* image, uint32_t component_idx, size_t* out_stride)
+{
+  if (!image || !image->image) {
+    if (out_stride) *out_stride = 0;
+    return nullptr;
+  }
+  return image->image->get_component(component_idx, out_stride);
+}
+
+
+uint8_t* heif_image_get_component(heif_image* image, uint32_t component_idx, size_t* out_stride)
+{
+  if (!image || !image->image) {
+    if (out_stride) *out_stride = 0;
+    return nullptr;
+  }
+  return image->image->get_component(component_idx, out_stride);
+}
+
+
+#define heif_image_get_component_X(name, type) \
+const type* heif_image_get_component_ ## name ## _readonly(const struct heif_image* image, \
+                                                            uint32_t component_idx, \
+                                                            size_t* out_stride) \
+{                                                            \
+  if (!image || !image->image) {                             \
+    if (out_stride) *out_stride = 0;                         \
+    return nullptr;                                          \
+  }                                                          \
+  return image->image->get_component_data<type>(component_idx, out_stride); \
+}                                                            \
+                                                             \
+type* heif_image_get_component_ ## name (struct heif_image* image, \
+                                         uint32_t component_idx,  \
+                                         size_t* out_stride)      \
+{                                                            \
+  if (!image || !image->image) {                             \
+    if (out_stride) *out_stride = 0;                         \
+    return nullptr;                                          \
+  }                                                          \
+  return image->image->get_component_data<type>(component_idx, out_stride); \
+}
+
+heif_image_get_component_X(uint16, uint16_t)
+heif_image_get_component_X(uint32, uint32_t)
+heif_image_get_component_X(uint64, uint64_t)
+heif_image_get_component_X(int8, int8_t)
+heif_image_get_component_X(int16, int16_t)
+heif_image_get_component_X(int32, int32_t)
+heif_image_get_component_X(int64, int64_t)
+heif_image_get_component_X(float32, float)
+heif_image_get_component_X(float64, double)
+heif_image_get_component_X(complex32, heif_complex32)
+heif_image_get_component_X(complex64, heif_complex64)
+
+
 heif_error heif_context_add_empty_unci_image(heif_context* ctx,
                                                     const heif_unci_image_parameters* parameters,
                                                     const heif_encoding_options* encoding_options,
diff --git a/libheif/api/libheif/heif_uncompressed.h b/libheif/api/libheif/heif_uncompressed.h
index 26b020b0..9e299d7f 100644
--- a/libheif/api/libheif/heif_uncompressed.h
+++ b/libheif/api/libheif/heif_uncompressed.h
@@ -346,6 +346,138 @@ heif_error heif_context_add_empty_unci_image(heif_context* ctx,
                                              const heif_image* prototype,
                                              heif_image_handle** out_unci_image_handle);

+// --- pixel datatype support
+
+typedef enum heif_channel_datatype
+{
+  heif_channel_datatype_undefined = 0,
+  heif_channel_datatype_unsigned_integer = 1,
+  heif_channel_datatype_signed_integer = 2,
+  heif_channel_datatype_floating_point = 3,
+  heif_channel_datatype_complex_number = 4
+} heif_channel_datatype;
+
+typedef struct heif_complex32
+{
+  float real, imaginary;
+} heif_complex32;
+
+typedef struct heif_complex64
+{
+  double real, imaginary;
+} heif_complex64;
+
+
+// --- index-based component access (for ISO 23001-17 multi-component images)
+
+// Returns the number of components that have pixel data (planes) in this image.
+LIBHEIF_API
+uint32_t heif_image_get_number_of_used_components(const heif_image*);
+
+// Returns the total number of components declared in the cmpd box.
+LIBHEIF_API
+uint32_t heif_image_get_total_number_of_cmpd_components(const heif_image*);
+
+// Fills `out_component_indices` with the valid component indices.
+// The caller must allocate an array of at least heif_image_get_number_of_used_components() elements.
+LIBHEIF_API
+void heif_image_get_used_component_indices(const heif_image*, uint32_t* out_component_indices);
+
+LIBHEIF_API
+enum heif_channel heif_image_get_component_channel(const heif_image*, uint32_t component_idx);
+
+LIBHEIF_API
+uint32_t heif_image_get_component_width(const heif_image*, uint32_t component_idx);
+
+LIBHEIF_API
+uint32_t heif_image_get_component_height(const heif_image*, uint32_t component_idx);
+
+LIBHEIF_API
+int heif_image_get_component_bits_per_pixel(const heif_image*, uint32_t component_idx);
+
+LIBHEIF_API
+uint16_t heif_image_get_component_type(const heif_image*, uint32_t component_idx);
+
+LIBHEIF_API
+heif_error heif_image_add_component(heif_image* image,
+                                    int width, int height,
+                                    uint16_t component_type,
+                                    heif_channel_datatype datatype,
+                                    int bit_depth,
+                                    uint32_t* out_component_idx);
+
+LIBHEIF_API
+const uint8_t* heif_image_get_component_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+uint8_t* heif_image_get_component(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const uint16_t* heif_image_get_component_uint16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+uint16_t* heif_image_get_component_uint16(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const uint32_t* heif_image_get_component_uint32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+uint32_t* heif_image_get_component_uint32(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const uint64_t* heif_image_get_component_uint64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+uint64_t* heif_image_get_component_uint64(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const int8_t* heif_image_get_component_int8_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+int8_t* heif_image_get_component_int8(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const int16_t* heif_image_get_component_int16_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+int16_t* heif_image_get_component_int16(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const int32_t* heif_image_get_component_int32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+int32_t* heif_image_get_component_int32(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const int64_t* heif_image_get_component_int64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+int64_t* heif_image_get_component_int64(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const float* heif_image_get_component_float32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+float* heif_image_get_component_float32(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const double* heif_image_get_component_float64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+double* heif_image_get_component_float64(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const heif_complex32* heif_image_get_component_complex32_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+heif_complex32* heif_image_get_component_complex32(heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+const heif_complex64* heif_image_get_component_complex64_readonly(const heif_image*, uint32_t component_idx, size_t* out_stride);
+
+LIBHEIF_API
+heif_complex64* heif_image_get_component_complex64(heif_image*, uint32_t component_idx, size_t* out_stride);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/libheif/codecs/uncompressed/unc_codec.cc b/libheif/codecs/uncompressed/unc_codec.cc
index 66326b7f..c042b6c4 100644
--- a/libheif/codecs/uncompressed/unc_codec.cc
+++ b/libheif/codecs/uncompressed/unc_codec.cc
@@ -36,6 +36,7 @@
 #include <map>
 #include <sstream>
 #include "security_limits.h"
+#include <utility>


 Error UncompressedImageCodec::get_heif_chroma_uncompressed(const std::shared_ptr<const Box_uncC>& uncC,
diff --git a/libheif/codecs/uncompressed/unc_decoder.cc b/libheif/codecs/uncompressed/unc_decoder.cc
index 3aebb37e..1272e57a 100644
--- a/libheif/codecs/uncompressed/unc_decoder.cc
+++ b/libheif/codecs/uncompressed/unc_decoder.cc
@@ -36,6 +36,7 @@
 #include "compression.h"
 #include "codecs/decoder.h"
 #include "security_limits.h"
+#include <string>


 static Error validate_component_indices(const std::vector<uint32_t>& indices,
diff --git a/tests/uncompressed_encode_multicomponent.cc b/tests/uncompressed_encode_multicomponent.cc
index b531a9d8..13df6c1b 100644
--- a/tests/uncompressed_encode_multicomponent.cc
+++ b/tests/uncompressed_encode_multicomponent.cc
@@ -26,7 +26,7 @@

 #include "catch_amalgamated.hpp"
 #include "libheif/heif.h"
-#include "libheif/heif_experimental.h"
+#include "libheif/heif_uncompressed.h"
 #include "test_utils.h"
 #include <cstdint>
 #include <cstring>