Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge gainmap.h with avif.h #1603

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,6 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES include/avif/avif.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/avif")
if(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
install(FILES include/avif/gainmap.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/avif")
endif()
endif()

# ---------------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion apps/shared/avifjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "iccjpeg.h"

#if defined(AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION)
#include "avif/gainmap.h"
#include <libxml/parser.h>
#endif

Expand Down
21 changes: 21 additions & 0 deletions include/avif/avif.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,27 @@ typedef struct avifGainMap
// For an image grid, the metadata shall be identical for all cells.
avifGainMapMetadata metadata;
} avifGainMap;

// Same as avifGainMapMetadata, but with fields of type double instead of uint32_t fractions.
// Use avifGainMapMetadataDoubleToFractions() to convert this to a avifGainMapMetadata.
// See avifGainMapMetadata for detailed descriptions of fields.
typedef struct avifGainMapMetadataDouble
{
double gainMapMin[3];
double gainMapMax[3];
double gainMapGamma[3];
double offsetSdr[3];
double offsetHdr[3];
double hdrCapacityMin;
double hdrCapacityMax;
avifBool baseRenditionIsHDR;
} avifGainMapMetadataDouble;

// Converts a avifGainMapMetadataDouble to avifGainMapMetadata by converting double values
// to the closest uint32_t fractions.
// Returns AVIF_FALSE if some field values are < 0 or > UINT32_MAX.
AVIF_API avifBool avifGainMapMetadataDoubleToFractions(avifGainMapMetadata * dst, const avifGainMapMetadataDouble * src);

#endif // AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP

// ---------------------------------------------------------------------------
Expand Down
44 changes: 0 additions & 44 deletions include/avif/gainmap.h

This file was deleted.

2 changes: 0 additions & 2 deletions src/gainmap.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright 2023 Google LLC
// SPDX-License-Identifier: BSD-2-Clause

#include "avif/gainmap.h"
#include "avif/avif.h"
#include "avif/internal.h"

#if defined(AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP)
Expand Down
1 change: 0 additions & 1 deletion tests/gtest/avifgainmaptest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <fstream>

#include "avif/avif.h"
#include "avif/gainmap.h"
#include "avif/internal.h"
#include "avifincrtest_helpers.h"
#include "aviftest_helpers.h"
Expand Down