let FileReader::Read return an opaque buffer instead of std::vector.
This can later allow returning a pointer to a static buffer from a cache without creating copies.
This commit is contained in:
parent
54fb37e39e
commit
fc84579319
12 changed files with 248 additions and 85 deletions
|
|
@ -65,9 +65,9 @@ FImageSource *WebPImage_TryCreate(FileReader &file, int lumpnum)
|
|||
file.Seek(0, FileReader::SeekSet);
|
||||
auto bytes = file.Read();
|
||||
|
||||
if (WebPGetInfo(bytes.data(), bytes.size(), &width, &height))
|
||||
if (WebPGetInfo(bytes.bytes(), bytes.size(), &width, &height))
|
||||
{
|
||||
WebPData data{ bytes.data(), bytes.size() };
|
||||
WebPData data{ bytes.bytes(), bytes.size() };
|
||||
WebPData chunk_data;
|
||||
auto mux = WebPMuxCreate(&data, 0);
|
||||
if (mux)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue