Skip to content

Commit ce28ee5

Browse files
togelgritz
authored andcommitted
deps: use get_plane2 introduced by libheif 1.20.2 (#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 <[email protected]>
1 parent 7dfb8b7 commit ce28ee5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/heif.imageio/heifinput.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,13 @@ HeifInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
390390
#else
391391
int ystride = 0;
392392
#endif
393+
#if LIBHEIF_NUMERIC_VERSION >= MAKE_LIBHEIF_VERSION(1, 20, 2, 0)
394+
const uint8_t* hdata = m_himage.get_plane2(heif_channel_interleaved,
395+
&ystride);
396+
#else
393397
const uint8_t* hdata = m_himage.get_plane(heif_channel_interleaved,
394398
&ystride);
399+
#endif
395400
if (!hdata) {
396401
errorfmt("Unknown read error");
397402
return false;

src/heif.imageio/heifoutput.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ HeifOutput::write_scanline(int y, int /*z*/, TypeDesc format, const void* data,
155155
#else
156156
int hystride = 0;
157157
#endif
158+
#if LIBHEIF_NUMERIC_VERSION >= MAKE_LIBHEIF_VERSION(1, 20, 2, 0)
159+
uint8_t* hdata = m_himage.get_plane2(heif_channel_interleaved, &hystride);
160+
#else
158161
uint8_t* hdata = m_himage.get_plane(heif_channel_interleaved, &hystride);
162+
#endif
159163
hdata += hystride * (y - m_spec.y);
160164
memcpy(hdata, data, hystride);
161165
return true;

0 commit comments

Comments
 (0)