Skip to content

Commit eeda132

Browse files
committed
unci tiling is not experimental anymore
1 parent 9237338 commit eeda132

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

examples/heif_enc.cc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,17 @@ void show_help(const char* argv0)
261261
<< " --tiled-image-height # override image height of tiled image\n"
262262
<< " --tiled-input-x-y usually, the first number in the input tile filename should be the y position.\n"
263263
<< " With this option, this can be swapped so that the first number is x, the second number y.\n"
264+
#if HEIF_ENABLE_EXPERIMENTAL_FEATURES || WITH_UNCOMPRESSED_CODEC
265+
<< " --tiling-method METHOD choose one of these methods: grid"
266+
#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
267+
", tili"
268+
#endif
269+
#if WITH_UNCOMPRESSED_CODEC
270+
", unci"
271+
#endif
272+
". The default is 'grid'.\n"
273+
#endif
264274
#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
265-
<< " --tiling-method METHOD choose one of these methods: grid, tili, unci. The default is 'grid'.\n"
266275
<< " --add-pyramid-group when several images are given, put them into a multi-resolution pyramid group.\n"
267276
<< "\n"
268277
<< "sequences:\n"
@@ -892,6 +901,7 @@ heif_image_handle* encode_tiled(heif_context* ctx, heif_encoder* encoder, heif_e
892901
return nullptr;
893902
}
894903
}
904+
#endif
895905
else if (tiling_method == "unci") {
896906
heif_unci_image_parameters params{};
897907
params.version = 1;
@@ -903,13 +913,12 @@ heif_image_handle* encode_tiled(heif_context* ctx, heif_encoder* encoder, heif_e
903913

904914
InputImage prototype_image = tile_generator->get_image(0,0, output_bit_depth);
905915

906-
heif_error error = heif_context_add_unci_image(ctx, &params, options, prototype_image.image.get(), &tiled_image);
916+
heif_error error = heif_context_add_empty_unci_image(ctx, &params, options, prototype_image.image.get(), &tiled_image);
907917
if (error.code != 0) {
908918
std::cerr << "Could not generate unci image: " << error.message << "\n";
909919
return nullptr;
910920
}
911921
}
912-
#endif
913922
else {
914923
assert(false);
915924
exit(10);
@@ -1085,8 +1094,9 @@ int main(int argc, char** argv)
10851094
case OPTION_TILING_METHOD:
10861095
tiling_method = optarg;
10871096
if (tiling_method != "grid"
1097+
&& tiling_method != "unci"
10881098
#if HEIF_ENABLE_EXPERIMENTAL_FEATURES
1089-
&& tiling_method != "tili" && tiling_method != "unci"
1099+
&& tiling_method != "tili"
10901100
#endif
10911101
) {
10921102
std::cerr << "Invalid tiling method '" << tiling_method << "'\n";

libheif/api/libheif/heif_uncompressed.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ void heif_unci_image_parameters_release(struct heif_unci_image_parameters* param
7676
}
7777

7878

79-
struct heif_error heif_context_add_unci_image(struct heif_context* ctx,
80-
const struct heif_unci_image_parameters* parameters,
81-
const struct heif_encoding_options* encoding_options,
82-
const heif_image* prototype,
83-
struct heif_image_handle** out_unci_image_handle)
79+
struct heif_error heif_context_add_empty_unci_image(struct heif_context* ctx,
80+
const struct heif_unci_image_parameters* parameters,
81+
const struct heif_encoding_options* encoding_options,
82+
const heif_image* prototype,
83+
struct heif_image_handle** out_unci_image_handle)
8484
{
8585
#if WITH_UNCOMPRESSED_CODEC
8686
if (prototype == nullptr) {

libheif/api/libheif/heif_uncompressed.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void heif_unci_image_parameters_release(struct heif_unci_image_parameters*);
7878

7979
/*
8080
* This adds an empty iso23001-17 (uncompressed) image to the HEIF file.
81-
* The actual image data is addded later using heif_context_add_image_tile().
81+
* The actual image data is added later using heif_context_add_image_tile().
8282
* If you do not need tiling, you can use heif_context_encode_image() instead.
8383
* However, this will by default disable any compression and any control about
8484
* the data layout.
@@ -95,11 +95,11 @@ void heif_unci_image_parameters_release(struct heif_unci_image_parameters*);
9595
* If ISO23001-17 images are not supported, returns heif_error_Unsupported_feature.
9696
*/
9797
LIBHEIF_API
98-
struct heif_error heif_context_add_unci_image(struct heif_context* ctx,
99-
const struct heif_unci_image_parameters* parameters,
100-
const struct heif_encoding_options* encoding_options,
101-
const struct heif_image* prototype,
102-
struct heif_image_handle** out_unci_image_handle);
98+
struct heif_error heif_context_add_empty_unci_image(struct heif_context* ctx,
99+
const struct heif_unci_image_parameters* parameters,
100+
const struct heif_encoding_options* encoding_options,
101+
const struct heif_image* prototype,
102+
struct heif_image_handle** out_unci_image_handle);
103103

104104
#ifdef __cplusplus
105105
}

0 commit comments

Comments
 (0)