d6cfb1f1创建于 4月27日历史提交
/*
 * Copyright (c) 2026 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

//
// APNG support definitions
// These are needed when libpng doesn't have APNG support built-in
//

#pragma once

#include "png.h"
#include "pngconf.h"

#ifdef __cplusplus
extern "C" {
#endif

// APNG dispose operation constants
#ifndef PNG_DISPOSE_OP_NONE
#define PNG_DISPOSE_OP_NONE 0x00
#endif
#ifndef PNG_DISPOSE_OP_BACKGROUND
#define PNG_DISPOSE_OP_BACKGROUND 0x01
#endif
#ifndef PNG_DISPOSE_OP_PREVIOUS
#define PNG_DISPOSE_OP_PREVIOUS 0x02
#endif

// APNG blend operation constants
#ifndef PNG_BLEND_OP_SOURCE
#define PNG_BLEND_OP_SOURCE 0x00
#endif
#ifndef PNG_BLEND_OP_OVER
#define PNG_BLEND_OP_OVER 0x01
#endif

// APNG declarations aligned with libpng APNG API when built without APNG (stubs in apng_stub.cpp).
#ifndef PNG_APNG_SUPPORTED
PNG_EXPORT_TYPE(png_uint_32)
PNGAPI png_get_acTL PNGARG((png_const_structrp pngPtr, png_inforp infoPtr, png_uint_32 *numFrames,
    png_uint_32 *numPlays));

PNG_EXPORT_TYPE(png_uint_32)
PNGAPI png_get_next_frame_fcTL PNGARG((png_structrp pngPtr, png_inforp infoPtr, png_uint_32 *width,
    png_uint_32 *height, png_uint_32 *xOffset, png_uint_32 *yOffset, png_uint_16 *delayNum, png_uint_16 *delayDen,
    png_byte *disposeOp, png_byte *blendOp));

PNG_EXPORT_TYPE(void) PNGAPI png_read_frame_head PNGARG((png_structrp pngPtr, png_inforp infoPtr));

PNG_EXPORT_TYPE(png_uint_32)
PNGAPI png_get_first_frame_is_hidden PNGARG((png_const_structrp pngPtr, png_const_inforp infoPtr));
#endif /* !PNG_APNG_SUPPORTED */

#ifdef __cplusplus
}
#endif