Skip to content

Commit 904d73f

Browse files
togelgritz
authored andcommitted
deps: use get_plane2 introduced by libheif 1.20.2 (AcademySoftwareFoundation#4851)
libheif 1.20.2 introduces `get_plane2()` for compatibility. [ref](strukturag/libheif#1566) Because `get_plane()` has been marked as deprecated, we should use `get_plane2()` instead. --------- Signed-off-by: toge <toge.mail@gmail.com>
1 parent 39157e3 commit 904d73f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/heif.imageio/heifinput.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,13 @@ HeifInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
398398
#else
399399
int ystride = 0;
400400
#endif
401+
#if LIBHEIF_NUMERIC_VERSION >= MAKE_LIBHEIF_VERSION(1, 20, 2, 0)
402+
const uint8_t* hdata = m_himage.get_plane2(heif_channel_interleaved,
403+
&ystride);
404+
#else
401405
const uint8_t* hdata = m_himage.get_plane(heif_channel_interleaved,
402406
&ystride);
407+
#endif
403408
if (!hdata) {
404409
errorf("Unknown read error");
405410
return false;

src/heif.imageio/heifoutput.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,11 @@ HeifOutput::write_scanline(int y, int /*z*/, TypeDesc format, const void* data,
161161
#else
162162
int hystride = 0;
163163
#endif
164+
#if LIBHEIF_NUMERIC_VERSION >= MAKE_LIBHEIF_VERSION(1, 20, 2, 0)
165+
uint8_t* hdata = m_himage.get_plane2(heif_channel_interleaved, &hystride);
166+
#else
164167
uint8_t* hdata = m_himage.get_plane(heif_channel_interleaved, &hystride);
168+
#endif
165169
hdata += hystride * (y - m_spec.y);
166170
memcpy(hdata, data, hystride);
167171
return true;

0 commit comments

Comments
 (0)