Skip to content

Commit

Permalink
rename 'to_fourcc()' to 'fourcc_to_string()'
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 2, 2024
1 parent 1bb435c commit fa791d0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions libheif/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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: ";

Expand All @@ -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";

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion libheif/codecs/tild.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions libheif/codecs/uncompressed/unc_boxes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion libheif/common_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<char>((code >> 24) & 0xFF);
Expand Down
2 changes: 1 addition & 1 deletion libheif/common_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion libheif/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ Error HeifContext::interpret_heif_file()

std::shared_ptr<ImageMetadata> metadata = std::make_shared<ImageMetadata>();
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;

Expand Down
2 changes: 1 addition & 1 deletion libheif/nclx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fa791d0

Please sign in to comment.