From edd0078709eea4896cf49c59c6d046b703b112d2 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Sun, 6 Oct 2024 16:35:25 +0200 Subject: [PATCH] remove obsolete heif_image_handle_get_tile_size() --- libheif/api/libheif/heif.cc | 5 ++++- libheif/api/libheif/heif.h | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/libheif/api/libheif/heif.cc b/libheif/api/libheif/heif.cc index 3f41b0606f..5e6cab5ac2 100644 --- a/libheif/api/libheif/heif.cc +++ b/libheif/api/libheif/heif.cc @@ -881,7 +881,7 @@ heif_error heif_image_handle_get_image_tiling(const struct heif_image_handle* ha } -heif_item_id heif_image_handle_get_image_tile_id(const struct heif_image_handle* handle, uint32_t tile_x, uint32_t tile_y) +heif_item_id heif_image_handle_get_grid_image_tile_id(const struct heif_image_handle* handle, uint32_t tile_x, uint32_t tile_y) { if (!handle) { return 0; @@ -901,6 +901,8 @@ heif_item_id heif_image_handle_get_image_tile_id(const struct heif_image_handle* } +#if 0 +// TODO: do we need this ? This does not handle rotations. We can use heif_image_handle_get_image_tiling() to get the same information. struct heif_error heif_image_handle_get_tile_size(const struct heif_image_handle* handle, uint32_t* tile_width, uint32_t* tile_height) { @@ -923,6 +925,7 @@ struct heif_error heif_image_handle_get_tile_size(const struct heif_image_handle return heif_error_success; } +#endif struct heif_entity_group* heif_context_get_entity_groups(const struct heif_context* ctx, diff --git a/libheif/api/libheif/heif.h b/libheif/api/libheif/heif.h index bd40c4090c..6c3fcdc115 100644 --- a/libheif/api/libheif/heif.h +++ b/libheif/api/libheif/heif.h @@ -1204,28 +1204,30 @@ struct heif_image_tiling }; -// If 'process_image_transformations' is true, this returns modified sizes. If it is true, the top_left_x/y_position will always be (0;0). +// If 'process_image_transformations' is true, this returns modified sizes. If it is false, the top_left_x/y_position will always be (0;0). LIBHEIF_API struct heif_error heif_image_handle_get_image_tiling(const struct heif_image_handle* handle, int process_image_transformations, struct heif_image_tiling* out_tiling); -// TODO: we may also need the valid area of the tile because it may be partly cut off at the image border + +// For grid images, return the image item ID of a specific grid tile. Note that the tile position is given in +// the original, non-transformed image. LIBHEIF_API -heif_item_id heif_image_handle_get_image_tile_id(const struct heif_image_handle* handle, uint32_t tile_x, uint32_t tile_y); +heif_item_id heif_image_handle_get_grid_image_tile_id(const struct heif_image_handle* handle, + uint32_t tile_x, uint32_t tile_y); struct heif_decoding_options; +// The tile position is given in tile indices, not in pixel coordinates. +// If the image transformations are processed (option->ignore_image_transformations==false), the tile position +// is given in the transformed coordinates. LIBHEIF_API struct heif_error heif_image_handle_decode_image_tile(const struct heif_image_handle* in_handle, - struct heif_image** out_img, - enum heif_colorspace colorspace, - enum heif_chroma chroma, - const struct heif_decoding_options* options, - uint32_t x0, uint32_t y0); - -LIBHEIF_API -struct heif_error heif_image_handle_get_tile_size(const struct heif_image_handle* in_handle, - uint32_t* tile_width, uint32_t* tile_height); + struct heif_image** out_img, + enum heif_colorspace colorspace, + enum heif_chroma chroma, + const struct heif_decoding_options* options, + uint32_t tile_x, uint32_t tile_y); // ------------------------- entity groups ------------------------