chromium/third_party/libavif/src/src/avif.c

// Copyright 2019 Joe Drago. All rights reserved.
// SPDX-License-Identifier: BSD-2-Clause

#include "avif/internal.h"

#include <assert.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>

#define STR_HELPER(x)
#define STR(x)
#define AVIF_VERSION_STRING

const char * avifVersion(void)
{}

const char * avifPixelFormatToString(avifPixelFormat format)
{}

void avifGetPixelFormatInfo(avifPixelFormat format, avifPixelFormatInfo * info)
{}

const char * avifResultToString(avifResult result)
{}

const char * avifProgressiveStateToString(avifProgressiveState progressiveState)
{}

void avifImageSetDefaults(avifImage * image)
{}

avifImage * avifImageCreate(uint32_t width, uint32_t height, uint32_t depth, avifPixelFormat yuvFormat)
{}

avifImage * avifImageCreateEmpty(void)
{}

void avifImageCopyNoAlloc(avifImage * dstImage, const avifImage * srcImage)
{}

void avifImageCopySamples(avifImage * dstImage, const avifImage * srcImage, avifPlanesFlags planes)
{}

avifResult avifImageCopy(avifImage * dstImage, const avifImage * srcImage, avifPlanesFlags planes)
{}

avifResult avifImageSetViewRect(avifImage * dstImage, const avifImage * srcImage, const avifCropRect * rect)
{}

void avifImageDestroy(avifImage * image)
{}

avifResult avifImageSetProfileICC(avifImage * image, const uint8_t * icc, size_t iccSize)
{}

avifResult avifImageSetMetadataXMP(avifImage * image, const uint8_t * xmp, size_t xmpSize)
{}

avifResult avifImageAllocatePlanes(avifImage * image, avifPlanesFlags planes)
{}

void avifImageFreePlanes(avifImage * image, avifPlanesFlags planes)
{}

void avifImageStealPlanes(avifImage * dstImage, avifImage * srcImage, avifPlanesFlags planes)
{}

avifBool avifImageUsesU16(const avifImage * image)
{}

avifBool avifImageIsOpaque(const avifImage * image)
{}

uint8_t * avifImagePlane(const avifImage * image, int channel)
{}

uint32_t avifImagePlaneRowBytes(const avifImage * image, int channel)
{}

uint32_t avifImagePlaneWidth(const avifImage * image, int channel)
{}

uint32_t avifImagePlaneHeight(const avifImage * image, int channel)
{}

avifBool avifDimensionsTooLarge(uint32_t width, uint32_t height, uint32_t imageSizeLimit, uint32_t imageDimensionLimit)
{}

// avifCodecCreate*() functions are in their respective codec_*.c files

void avifCodecDestroy(avifCodec * codec)
{}

// ---------------------------------------------------------------------------
// avifRGBImage

avifBool avifRGBFormatHasAlpha(avifRGBFormat format)
{}

uint32_t avifRGBFormatChannelCount(avifRGBFormat format)
{}

uint32_t avifRGBImagePixelSize(const avifRGBImage * rgb)
{}

void avifRGBImageSetDefaults(avifRGBImage * rgb, const avifImage * image)
{}

avifResult avifRGBImageAllocatePixels(avifRGBImage * rgb)
{}

void avifRGBImageFreePixels(avifRGBImage * rgb)
{}

// ---------------------------------------------------------------------------
// avifCropRect

static avifFraction calcCenter(int32_t dim)
{}

static avifBool overflowsInt32(int64_t x)
{}

static avifBool avifCropRectIsValid(const avifCropRect * cropRect, uint32_t imageW, uint32_t imageH, avifPixelFormat yuvFormat, avifDiagnostics * diag)

{}

avifBool avifCropRectConvertCleanApertureBox(avifCropRect * cropRect,
                                             const avifCleanApertureBox * clap,
                                             uint32_t imageW,
                                             uint32_t imageH,
                                             avifPixelFormat yuvFormat,
                                             avifDiagnostics * diag)
{}

avifBool avifCleanApertureBoxConvertCropRect(avifCleanApertureBox * clap,
                                             const avifCropRect * cropRect,
                                             uint32_t imageW,
                                             uint32_t imageH,
                                             avifPixelFormat yuvFormat,
                                             avifDiagnostics * diag)
{}

// ---------------------------------------------------------------------------

avifBool avifIsAlpha(avifItemCategory itemCategory)
{}

// ---------------------------------------------------------------------------

avifBool avifAreGridDimensionsValid(avifPixelFormat yuvFormat, uint32_t imageW, uint32_t imageH, uint32_t tileW, uint32_t tileH, avifDiagnostics * diag)
{}

// ---------------------------------------------------------------------------
// avifCodecSpecificOption

// Returns NULL if a memory allocation failed.
static char * avifStrdup(const char * str)
{}

avifCodecSpecificOptions * avifCodecSpecificOptionsCreate(void)
{}

void avifCodecSpecificOptionsClear(avifCodecSpecificOptions * csOptions)
{}

void avifCodecSpecificOptionsDestroy(avifCodecSpecificOptions * csOptions)
{}

avifResult avifCodecSpecificOptionsSet(avifCodecSpecificOptions * csOptions, const char * key, const char * value)
{}

// ---------------------------------------------------------------------------
// Codec availability and versions

versionFunc;
avifCodecCreateFunc;

struct AvailableCodec
{};

// This is the main codec table; it determines all usage/availability in libavif.

static struct AvailableCodec availableCodecs[] =;

static const int availableCodecsCount =;

static struct AvailableCodec * findAvailableCodec(avifCodecChoice choice, avifCodecFlags requiredFlags)
{}

const char * avifCodecName(avifCodecChoice choice, avifCodecFlags requiredFlags)
{}

avifCodecType avifCodecTypeFromChoice(avifCodecChoice choice, avifCodecFlags requiredFlags)
{}

avifCodecChoice avifCodecChoiceFromName(const char * name)
{}

avifResult avifCodecCreate(avifCodecChoice choice, avifCodecFlags requiredFlags, avifCodec ** codec)
{}

static void append(char ** writePos, size_t * remainingLen, const char * appendStr)
{}

void avifCodecVersions(char outBuffer[256])
{}

#if defined(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
avifGainMap * avifGainMapCreate(void)
{}

void avifGainMapDestroy(avifGainMap * gainMap)
{}
#endif // AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP