String representation of /Image for debugging

This commit is contained in:
Kovid Goyal 2023-09-15 11:35:35 +05:30
parent 46ad724b27
commit bfbb4f1c48
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -6,6 +6,8 @@
*/
#include "global.h"
#include <functional>
#include <string>
using namespace pdf;
@ -49,6 +51,10 @@ class Image {
}
std::size_t hash() const noexcept { return buf.size(); }
const PdfReference& reference() const noexcept { return ref; }
std::string ToString() const {
std::hash<std::string> s;
return "Image(ref=" + ref.ToString() + ", width="s + std::to_string(width) + ", height="s + std::to_string(height) + ", smask="s + smask.ToString() + ", digest=" + std::to_string(s(buf)) + ")";
}
};
struct ImageHasher {