Blame extras/extras.h

Packit 9c6abc
// Copyright 2015 Google Inc. All Rights Reserved.
Packit 9c6abc
//
Packit 9c6abc
// Use of this source code is governed by a BSD-style license
Packit 9c6abc
// that can be found in the COPYING file in the root of the source
Packit 9c6abc
// tree. An additional intellectual property rights grant can be found
Packit 9c6abc
// in the file PATENTS. All contributing project authors may
Packit 9c6abc
// be found in the AUTHORS file in the root of the source tree.
Packit 9c6abc
// -----------------------------------------------------------------------------
Packit 9c6abc
//
Packit 9c6abc
Packit 9c6abc
#ifndef WEBP_EXTRAS_EXTRAS_H_
Packit 9c6abc
#define WEBP_EXTRAS_EXTRAS_H_
Packit 9c6abc
Packit 9c6abc
#include "webp/types.h"
Packit 9c6abc
Packit 9c6abc
#ifdef __cplusplus
Packit 9c6abc
extern "C" {
Packit 9c6abc
#endif
Packit 9c6abc
Packit 9c6abc
#include "webp/encode.h"
Packit 9c6abc
Packit 9c6abc
#define WEBP_EXTRAS_ABI_VERSION 0x0001    // MAJOR(8b) + MINOR(8b)
Packit 9c6abc
Packit 9c6abc
//------------------------------------------------------------------------------
Packit 9c6abc
Packit 9c6abc
// Returns the version number of the extras library, packed in hexadecimal using
Packit 9c6abc
// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.
Packit 9c6abc
WEBP_EXTERN int WebPGetExtrasVersion(void);
Packit 9c6abc
Packit 9c6abc
//------------------------------------------------------------------------------
Packit 9c6abc
// Ad-hoc colorspace importers.
Packit 9c6abc
Packit 9c6abc
// Import luma sample (gray scale image) into 'picture'. The 'picture'
Packit 9c6abc
// width and height must be set prior to calling this function.
Packit 9c6abc
WEBP_EXTERN int WebPImportGray(const uint8_t* gray, WebPPicture* picture);
Packit 9c6abc
Packit 9c6abc
// Import rgb sample in RGB565 packed format into 'picture'. The 'picture'
Packit 9c6abc
// width and height must be set prior to calling this function.
Packit 9c6abc
WEBP_EXTERN int WebPImportRGB565(const uint8_t* rgb565, WebPPicture* pic);
Packit 9c6abc
Packit 9c6abc
// Import rgb sample in RGB4444 packed format into 'picture'. The 'picture'
Packit 9c6abc
// width and height must be set prior to calling this function.
Packit 9c6abc
WEBP_EXTERN int WebPImportRGB4444(const uint8_t* rgb4444, WebPPicture* pic);
Packit 9c6abc
Packit 9c6abc
// Import a color mapped image. The number of colors is less or equal to
Packit 9c6abc
// MAX_PALETTE_SIZE. 'pic' must have been initialized. Its content, if any,
Packit 9c6abc
// will be discarded. Returns 'false' in case of error, or if indexed[] contains
Packit 9c6abc
// invalid indices.
Packit 9c6abc
WEBP_EXTERN int
Packit 9c6abc
WebPImportColorMappedARGB(const uint8_t* indexed, int indexed_stride,
Packit 9c6abc
                          const uint32_t palette[], int palette_size,
Packit 9c6abc
                          WebPPicture* pic);
Packit 9c6abc
Packit 9c6abc
//------------------------------------------------------------------------------
Packit 9c6abc
Packit 9c6abc
// Parse a bitstream, search for VP8 (lossy) header and report a
Packit 9c6abc
// rough estimation of the quality factor used for compressing the bitstream.
Packit 9c6abc
// If the bitstream is in lossless format, the special value '101' is returned.
Packit 9c6abc
// Otherwise (lossy bitstream), the returned value is in the range [0..100].
Packit 9c6abc
// Any error (invalid bitstream, animated WebP, incomplete header, etc.)
Packit 9c6abc
// will return a value of -1.
Packit 9c6abc
WEBP_EXTERN int VP8EstimateQuality(const uint8_t* const data, size_t size);
Packit 9c6abc
Packit 9c6abc
//------------------------------------------------------------------------------
Packit 9c6abc
Packit 9c6abc
#ifdef __cplusplus
Packit 9c6abc
}    // extern "C"
Packit 9c6abc
#endif
Packit 9c6abc
Packit 9c6abc
#endif  /* WEBP_EXTRAS_EXTRAS_H_ */