go-libwebp

Experimental translation from libwebp to Go source.
Log | Files | Refs | README | LICENSE

pnmdec.h (1195B)


      1 // Copyright 2017 Google Inc. All Rights Reserved.
      2 //
      3 // Use of this source code is governed by a BSD-style license
      4 // that can be found in the COPYING file in the root of the source
      5 // tree. An additional intellectual property rights grant can be found
      6 // in the file PATENTS. All contributing project authors may
      7 // be found in the AUTHORS file in the root of the source tree.
      8 // -----------------------------------------------------------------------------
      9 //
     10 // partial PNM format decoder (ppm/pgm)
     11 
     12 #ifndef WEBP_IMAGEIO_PNMDEC_H_
     13 #define WEBP_IMAGEIO_PNMDEC_H_
     14 
     15 #include <stddef.h>
     16 
     17 #include "webp/types.h"
     18 
     19 #ifdef __cplusplus
     20 extern "C" {
     21 #endif
     22 
     23 struct Metadata;
     24 struct WebPPicture;
     25 
     26 // Reads a PNM file from 'data', returning the decoded output in 'pic'.
     27 // The output is RGB or YUV depending on pic->use_argb value.
     28 // Returns true on success.
     29 // 'metadata' has no effect, but is kept for coherence with other signatures
     30 // for image readers.
     31 int ReadPNM(const uint8_t* const data, size_t data_size,
     32             struct WebPPicture* const pic, int keep_alpha,
     33             struct Metadata* const metadata);
     34 
     35 #ifdef __cplusplus
     36 }    // extern "C"
     37 #endif
     38 
     39 #endif  // WEBP_IMAGEIO_PNMDEC_H_