2012-12-04 03:20:00 +01:00
|
|
|
// Copyright 2012 Google Inc. All Rights Reserved.
|
|
|
|
//
|
2013-06-07 08:05:58 +02:00
|
|
|
// Use of this source code is governed by a BSD-style license
|
|
|
|
// that can be found in the COPYING file in the root of the source
|
|
|
|
// tree. An additional intellectual property rights grant can be found
|
|
|
|
// in the file PATENTS. All contributing project authors may
|
|
|
|
// be found in the AUTHORS file in the root of the source tree.
|
2012-12-04 03:20:00 +01:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Metadata types and functions.
|
|
|
|
//
|
|
|
|
|
2016-07-20 01:02:55 +02:00
|
|
|
#ifndef WEBP_IMAGEIO_METADATA_H_
|
|
|
|
#define WEBP_IMAGEIO_METADATA_H_
|
2012-12-04 03:20:00 +01:00
|
|
|
|
|
|
|
#include "webp/types.h"
|
|
|
|
|
2013-11-25 23:43:12 +01:00
|
|
|
#ifdef __cplusplus
|
2012-12-04 03:20:00 +01:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct MetadataPayload {
|
|
|
|
uint8_t* bytes;
|
|
|
|
size_t size;
|
|
|
|
} MetadataPayload;
|
|
|
|
|
|
|
|
typedef struct Metadata {
|
|
|
|
MetadataPayload exif;
|
|
|
|
MetadataPayload iccp;
|
|
|
|
MetadataPayload xmp;
|
|
|
|
} Metadata;
|
|
|
|
|
|
|
|
#define METADATA_OFFSET(x) offsetof(Metadata, x)
|
|
|
|
|
2012-12-11 22:55:31 +01:00
|
|
|
void MetadataInit(Metadata* const metadata);
|
|
|
|
void MetadataPayloadDelete(MetadataPayload* const payload);
|
|
|
|
void MetadataFree(Metadata* const metadata);
|
|
|
|
|
|
|
|
// Stores 'metadata' to 'payload->bytes', returns false on allocation error.
|
|
|
|
int MetadataCopy(const char* metadata, size_t metadata_len,
|
|
|
|
MetadataPayload* const payload);
|
2012-12-04 03:20:00 +01:00
|
|
|
|
2013-11-25 23:43:12 +01:00
|
|
|
#ifdef __cplusplus
|
2012-12-04 03:20:00 +01:00
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2016-07-20 01:02:55 +02:00
|
|
|
#endif // WEBP_IMAGEIO_METADATA_H_
|