From fa791d0719c10a20a62553f3921d32b1de576cf3 Mon Sep 17 00:00:00 2001 From: Dirk Farin Date: Thu, 3 Oct 2024 01:12:28 +0200 Subject: [PATCH] rename 'to_fourcc()' to 'fourcc_to_string()' --- libheif/box.cc | 12 ++++++------ libheif/codecs/tild.cc | 2 +- libheif/codecs/uncompressed/unc_boxes.cc | 4 ++-- libheif/common_utils.cc | 2 +- libheif/common_utils.h | 2 +- libheif/context.cc | 2 +- libheif/nclx.cc | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libheif/box.cc b/libheif/box.cc index b71fbad530..2183478dc1 100644 --- a/libheif/box.cc +++ b/libheif/box.cc @@ -202,7 +202,7 @@ std::string BoxHeader::get_type_string() const return sstr.str(); } else { - return to_fourcc(m_type); + return fourcc_to_string(m_type); } } @@ -1005,7 +1005,7 @@ std::string Box_other::dump(Indent& indent) const std::string Box_Error::dump(Indent& indent) const { std::ostringstream sstr; - sstr << indent << '\'' << to_fourcc(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n"; + sstr << indent << '\'' << fourcc_to_string(m_box_type_with_parse_error) << "' parse error: " << m_error.message << "\n"; sstr << indent << "fatality: "; switch (m_fatality) { case parse_error_fatality::fatal: sstr << "fatal\n"; @@ -1060,7 +1060,7 @@ std::string Box_ftyp::dump(Indent& indent) const sstr << BoxHeader::dump(indent); - sstr << indent << "major brand: " << to_fourcc(m_major_brand) << "\n" + sstr << indent << "major brand: " << fourcc_to_string(m_major_brand) << "\n" << indent << "minor version: " << m_minor_version << "\n" << indent << "compatible brands: "; @@ -1069,7 +1069,7 @@ std::string Box_ftyp::dump(Indent& indent) const if (first) { first = false; } else { sstr << ','; } - sstr << to_fourcc(brand); + sstr << fourcc_to_string(brand); } sstr << "\n"; @@ -1171,7 +1171,7 @@ std::string Box_hdlr::dump(Indent& indent) const std::ostringstream sstr; sstr << Box::dump(indent); sstr << indent << "pre_defined: " << m_pre_defined << "\n" - << indent << "handler_type: " << to_fourcc(m_handler_type) << "\n" + << indent << "handler_type: " << fourcc_to_string(m_handler_type) << "\n" << indent << "name: " << m_name << "\n"; return sstr.str(); @@ -2166,7 +2166,7 @@ std::string Box_infe::dump(Indent& indent) const sstr << indent << "item_ID: " << m_item_ID << "\n" << indent << "item_protection_index: " << m_item_protection_index << "\n" - << indent << "item_type: " << to_fourcc(m_item_type_4cc) << "\n" + << indent << "item_type: " << fourcc_to_string(m_item_type_4cc) << "\n" << indent << "item_name: " << m_item_name << "\n"; if (m_item_type_4cc == fourcc("mime")) { diff --git a/libheif/codecs/tild.cc b/libheif/codecs/tild.cc index 9d7e69dfcf..5792ac6935 100644 --- a/libheif/codecs/tild.cc +++ b/libheif/codecs/tild.cc @@ -150,7 +150,7 @@ std::string Box_tilC::dump(Indent& indent) const sstr << indent << "version: " << ((int) get_version()) << "\n" //<< indent << "image size: " << m_parameters.image_width << "x" << m_parameters.image_height << "\n" << indent << "tile size: " << m_parameters.tile_width << "x" << m_parameters.tile_height << "\n" - << indent << "compression: " << to_fourcc(m_parameters.compression_type_fourcc) << "\n" + << indent << "compression: " << fourcc_to_string(m_parameters.compression_type_fourcc) << "\n" << indent << "tiles are sequential: " << (m_parameters.tiles_are_sequential ? "yes" : "no") << "\n" << indent << "offset field length: " << ((int) m_parameters.offset_field_length) << " bits\n" << indent << "size field length: " << ((int) m_parameters.size_field_length) << " bits\n" diff --git a/libheif/codecs/uncompressed/unc_boxes.cc b/libheif/codecs/uncompressed/unc_boxes.cc index f5f7447404..28afcfda89 100644 --- a/libheif/codecs/uncompressed/unc_boxes.cc +++ b/libheif/codecs/uncompressed/unc_boxes.cc @@ -288,7 +288,7 @@ std::string Box_uncC::dump(Indent& indent) const sstr << indent << "profile: " << m_profile; if (m_profile != 0) { - sstr << " (" << to_fourcc(m_profile) << ")"; + sstr << " (" << fourcc_to_string(m_profile) << ")"; } sstr << "\n"; if (get_version() == 0) { @@ -420,7 +420,7 @@ std::string Box_cmpC::dump(Indent& indent) const { std::ostringstream sstr; sstr << Box::dump(indent); - sstr << indent << "compression_type: " << to_fourcc(m_compression_type) << "\n"; + sstr << indent << "compression_type: " << fourcc_to_string(m_compression_type) << "\n"; sstr << indent << "compressed_entity_type: " << (int)m_compressed_unit_type << "\n"; return sstr.str(); } diff --git a/libheif/common_utils.cc b/libheif/common_utils.cc index 6346537de6..2a204e49ac 100644 --- a/libheif/common_utils.cc +++ b/libheif/common_utils.cc @@ -102,7 +102,7 @@ uint8_t compute_avif_profile(int bits_per_pixel, heif_chroma chroma) } -std::string to_fourcc(uint32_t code) +std::string fourcc_to_string(uint32_t code) { std::string str(" "); str[0] = static_cast((code >> 24) & 0xFF); diff --git a/libheif/common_utils.h b/libheif/common_utils.h index b61fd2c1a4..180880ae29 100644 --- a/libheif/common_utils.h +++ b/libheif/common_utils.h @@ -40,7 +40,7 @@ constexpr inline uint32_t fourcc(const char* id) ((((uint32_t) id[3])&0xFF) << 0)); } -std::string to_fourcc(uint32_t code); +std::string fourcc_to_string(uint32_t code); // Functions for common use in libheif and the plugins. diff --git a/libheif/context.cc b/libheif/context.cc index 70f68202cc..3f7af72cb5 100644 --- a/libheif/context.cc +++ b/libheif/context.cc @@ -713,7 +713,7 @@ Error HeifContext::interpret_heif_file() std::shared_ptr metadata = std::make_shared(); metadata->item_id = id; - metadata->item_type = to_fourcc(item_type); + metadata->item_type = fourcc_to_string(item_type); metadata->content_type = content_type; metadata->item_uri_type = item_uri_type; diff --git a/libheif/nclx.cc b/libheif/nclx.cc index 1e455aed0c..80535c4e68 100644 --- a/libheif/nclx.cc +++ b/libheif/nclx.cc @@ -414,7 +414,7 @@ std::string Box_colr::dump(Indent& indent) const sstr << Box::dump(indent); if (m_color_profile) { - sstr << indent << "colour_type: " << to_fourcc(get_color_profile_type()) << "\n"; + sstr << indent << "colour_type: " << fourcc_to_string(get_color_profile_type()) << "\n"; sstr << m_color_profile->dump(indent); } else {