MCPcopy Create free account
hub / github.com/AOMediaCodec/libavif / avifImageCopyAltImageMetadata

Function avifImageCopyAltImageMetadata

src/write.c:1050–1065  ·  view source on GitHub ↗

Sets altImageMetadata's metadata values to represent the "alternate" image as if applying the gain map to the base image. For grid images, imageWithGainMap is the metadata of the first cell. gridWidth and gridHeight are the dimensions of the full image.

Source from the content-addressed store, hash-verified

1048// For grid images, imageWithGainMap is the metadata of the first cell. gridWidth and gridHeight are the dimensions of the
1049// full image.
1050static avifResult avifImageCopyAltImageMetadata(avifImage * altImageMetadata, const avifImage * imageWithGainMap, uint32_t gridWidth, uint32_t gridHeight)
1051{
1052 altImageMetadata->width = gridWidth;
1053 altImageMetadata->height = gridHeight;
1054 AVIF_CHECKRES(avifRWDataSet(&altImageMetadata->icc, imageWithGainMap->gainMap->altICC.data, imageWithGainMap->gainMap->altICC.size));
1055 altImageMetadata->colorPrimaries = imageWithGainMap->gainMap->altColorPrimaries;
1056 altImageMetadata->transferCharacteristics = imageWithGainMap->gainMap->altTransferCharacteristics;
1057 altImageMetadata->matrixCoefficients = imageWithGainMap->gainMap->altMatrixCoefficients;
1058 altImageMetadata->yuvRange = imageWithGainMap->gainMap->altYUVRange;
1059 altImageMetadata->depth = imageWithGainMap->gainMap->altDepth
1060 ? imageWithGainMap->gainMap->altDepth
1061 : AVIF_MAX(imageWithGainMap->depth, imageWithGainMap->gainMap->image->depth);
1062 altImageMetadata->yuvFormat = (imageWithGainMap->gainMap->altPlaneCount == 1) ? AVIF_PIXEL_FORMAT_YUV400 : AVIF_PIXEL_FORMAT_YUV444;
1063 altImageMetadata->clli = imageWithGainMap->gainMap->altCLLI;
1064 return AVIF_RESULT_OK;
1065}
1066
1067static avifResult avifEncoderWriteSampleTransformTokens(avifRWStream * s, const avifSampleTransformExpression * expression)
1068{

Callers 1

Calls 1

avifRWDataSetFunction · 0.85

Tested by

no test coverage detected