~ubuntu-branches/ubuntu/intrepid/transcode/intrepid-proposed

« back to all changes in this revision

Viewing changes to contrib/pnmpvn/pvn.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-10-10 19:12:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010191247-uq4j6t947df71v7m
Tags: 2:1.0.1-0.0ubuntu1
* New upstream release.
* debian/:
  + Remove 03_rescale.c and 04_average.c dpatches, applied upstream.
  + Force amd64 to link against the correct _pic libs, fixing FTBFS.
  + Disable mjpegtools support on ppc until post-Breezy (FTBFS).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* pvn.h by Jacob (Jack) Gryn
 
2
 
 
3
   PVN (PVB/PVG/PVP) Library
 
4
 
 
5
   * the PVN (PVB/PVG/PVP) file format, and this code
 
6
     is (c) 2003,2004 Jacob (Jack) Gryn
 
7
 
 
8
   * the author grants full rights to all who wish to use
 
9
     and distribute this code and the corresponding file
 
10
     formats on the assumption that credit is given to
 
11
     the author if asked
 
12
 
 
13
   Jacob (Jack) Gryn
 
14
 */
 
15
#include "pvnglobals.h"
 
16
 
 
17
#ifndef PVN_H
 
18
#define PVN_H
 
19
 
 
20
// we need a floating point number that will very rarely get used in the framerate field
 
21
#define UNDEF_FRAMERATE -0.99098765123
 
22
 
 
23
#ifdef __cplusplus
 
24
  namespace std
 
25
  {
 
26
    extern "C"
 
27
    {                // or   extern "C++" {
 
28
#endif
 
29
 
 
30
typedef struct _pvnparam { char magic[5]; unsigned int width; unsigned int height; unsigned int depth; double maxcolour; double framerate; } PVNParam;
 
31
 
 
32
/* calculates the size of raster data in a PVN file based on a PVNParam
 
33
   header
 
34
 
 
35
   returns # of bytes if PV4/PV5/PV6 (a/f/d);
 
36
*/
 
37
long calcPVNSize(PVNParam p);
 
38
 
 
39
/* calculates the size of raster data of a single image within a PVN file
 
40
   based on a PVNParam header
 
41
 
 
42
   returns # of bytes if PV4/PV5/PV6 (a/f/d);
 
43
*/
 
44
long calcPVNPageSize(PVNParam p);
 
45
 
 
46
/* Compare two parameter sets; return EQUAL if they are equal,
 
47
   or NOTEQUAL if they are not */
 
48
int PVNParamCompare(PVNParam first, PVNParam second);
 
49
 
 
50
/* Copy src parameters to dest 
 
51
   returns VALID or ERROR */
 
52
int PVNParamCopy(PVNParam *dest, PVNParam *src);
 
53
 
 
54
/* Just retrieve the header
 
55
   returns  INVALID if it is not a PNM header
 
56
            VALID if everything is ok */
 
57
int readPVNHeader(FILE *fp, PVNParam *p);
 
58
 
 
59
/* write PVN Header to file *fp */
 
60
int writePVNHeader(FILE *fp, PVNParam p);
 
61
 
 
62
/* display the pvnparam header to stdout */
 
63
void showPVNHeader(PVNParam p);
 
64
 
 
65
/* converts a PVN to another format of PVN
 
66
 
 
67
   infile / outfile = in/output filenames
 
68
   framerate = new framerate; if framerate = NAN, use input framerate
 
69
   format = new format
 
70
   maxcolour = new maxcolour / range value (for floats/doubles)
 
71
 */
 
72
int pvnconvert(const char *infile, const char *outfile, double framerate, unsigned int format, double maxcolour);
 
73
 
 
74
#ifdef __cplusplus
 
75
    }       // end extern
 
76
  }    // end namespace
 
77
#endif
 
78
 
 
79
#endif