mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 12:28:26 +01:00
Merge "demux: add {Next,Prev}Frame"
This commit is contained in:
commit
81ebd37505
@ -768,9 +768,15 @@ int WebPDemuxGetFrame(const WebPDemuxer* const dmux,
|
|||||||
return SetFrame(frame, iter);
|
return SetFrame(frame, iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebPDemuxSetFrame(WebPIterator* const iter, int frame) {
|
int WebPDemuxNextFrame(WebPIterator* const iter) {
|
||||||
if (iter == NULL) return 0;
|
if (iter == NULL) return 0;
|
||||||
return SetFrame(frame, iter);
|
return SetFrame(iter->frame_num_ + 1, iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WebPDemuxPrevFrame(WebPIterator* const iter) {
|
||||||
|
if (iter == NULL) return 0;
|
||||||
|
if (iter->frame_num_ <= 1) return 0;
|
||||||
|
return SetFrame(iter->frame_num_ - 1, iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebPDemuxSetTile(WebPIterator* const iter, int tile) {
|
int WebPDemuxSetTile(WebPIterator* const iter, int tile) {
|
||||||
|
@ -546,9 +546,11 @@ typedef struct {
|
|||||||
WEBP_EXTERN(int) WebPDemuxGetFrame(
|
WEBP_EXTERN(int) WebPDemuxGetFrame(
|
||||||
const WebPDemuxer* const dmux, int frame_number, WebPIterator* const iter);
|
const WebPDemuxer* const dmux, int frame_number, WebPIterator* const iter);
|
||||||
|
|
||||||
// Sets 'iter->tile_' to point to frame number 'frame_number'.
|
// Sets 'iter->tile_' to point to the next ('iter->frame_num_' + 1) or previous
|
||||||
|
// ('iter->frame_num_' - 1) frame. These functions do not loop.
|
||||||
// Returns true on success, false otherwise.
|
// Returns true on success, false otherwise.
|
||||||
WEBP_EXTERN(int) WebPDemuxSetFrame(WebPIterator* const iter, int frame_number);
|
WEBP_EXTERN(int) WebPDemuxNextFrame(WebPIterator* const iter);
|
||||||
|
WEBP_EXTERN(int) WebPDemuxPrevFrame(WebPIterator* const iter);
|
||||||
|
|
||||||
// Sets 'iter->tile_' to reflect tile number 'tile_number'.
|
// Sets 'iter->tile_' to reflect tile number 'tile_number'.
|
||||||
// Returns true if tile 'tile_number' is present, false otherwise.
|
// Returns true if tile 'tile_number' is present, false otherwise.
|
||||||
|
Loading…
Reference in New Issue
Block a user