| Exiv2

Loading...
Searching...
No Matches
helper_functions.hpp
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#ifndef HELPER_FUNCTIONS_HPP
4#define HELPER_FUNCTIONS_HPP
5
6#include <string>
7#include "basicio.hpp"
8#include "types.hpp"
24std::string string_from_unterminated(const char* data, size_t data_length);
25
26 namespace Exiv2 {
27
28 static constexpr size_t BYTE = 0x1;
29 static constexpr size_t WCHAR = 0x2;
30 static constexpr size_t WORD = 0X2;
31 static constexpr size_t DWORD = 0x4;
32 static constexpr size_t QWORD = 0x8;
33 static constexpr size_t GUID = 0x10;
34
35[[nodiscard]] uint64_t readQWORDTag(const Exiv2::BasicIo::UniquePtr& io);
36
37[[nodiscard]] uint32_t readDWORDTag(const Exiv2::BasicIo::UniquePtr& io);
38
39[[nodiscard]] uint16_t readWORDTag(const Exiv2::BasicIo::UniquePtr& io);
40
41[[nodiscard]] std::string readStringWcharTag(const Exiv2::BasicIo::UniquePtr& io, size_t length);
42
43[[nodiscard]] std::string readStringTag(const Exiv2::BasicIo::UniquePtr& io, size_t length = DWORD);
44
48[[nodiscard]] std::string getAspectRatio(uint64_t width, uint64_t height);
49
50} // namespace Exiv2
51#endif // HELPER_FUNCTIONS_HPP
Exiv2::BasicIo::UniquePtr
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition basicio.hpp:38
Exiv2
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::getAspectRatio
std::string getAspectRatio(uint64_t width, uint64_t height)
Calculates Aspect Ratio of a video.
Definition helper_functions.cpp:56