implement export/import ppbr
This commit is contained in:
@@ -197,9 +197,9 @@ Image Image::resize_squared(const glm::u8vec4& bg) const
|
||||
bool Image::read(BinaryStreamReader& r)
|
||||
{
|
||||
Serializer::Descriptor d;
|
||||
r >> d;
|
||||
if (d.class_id != "image_png")
|
||||
return false;
|
||||
r >> d;
|
||||
d.value<Serializer::Integer>("width", width);
|
||||
d.value<Serializer::Integer>("height", height);
|
||||
d.value<Serializer::Integer>("comp", comp);
|
||||
@@ -230,7 +230,7 @@ void Image::write(BinaryStreamWriter& w) const
|
||||
stbi_write_png_to_func([](void* context, void* data, int size) {
|
||||
Serializer::Descriptor& d = *static_cast<Serializer::Descriptor*>(context);
|
||||
d.props["data"] = std::make_shared<Serializer::RawData>(std::vector<uint8_t>((uint8_t*)data, (uint8_t*)data + size));
|
||||
}, &d, width, height, comp, m_data.get(), 0);
|
||||
}, &d, width, height, comp, m_data.get(), 0);
|
||||
|
||||
w << d;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user