Add a Bitmap::detachBytes method This allows us to share bitmap bytes with code that doesn't have a depency on rive_decoders. Diffs= 58cc49580 Add a Bitmap::detachBytes method (#5763) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index bca50bc..1e13964 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -30351d475a956cf0fd13dbe26257e057cc14524f +58cc495802007c308ee4aa7b27dd755baaff7492
diff --git a/decoders/include/rive/decoders/bitmap_decoder.hpp b/decoders/include/rive/decoders/bitmap_decoder.hpp index 94a69f5..05e295d 100644 --- a/decoders/include/rive/decoders/bitmap_decoder.hpp +++ b/decoders/include/rive/decoders/bitmap_decoder.hpp
@@ -36,6 +36,7 @@ uint32_t height() const { return m_Height; } PixelFormat pixelFormat() const { return m_PixelFormat; } const uint8_t* bytes() const { return m_Bytes.get(); } + std::unique_ptr<const uint8_t[]> detachBytes() { return std::move(m_Bytes); } size_t byteSize() const; size_t byteSize(PixelFormat format) const; size_t bytesPerPixel(PixelFormat format) const;