ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/normcodec.h
Revision: 2.2
Committed: Fri Jul 19 02:25:02 2019 UTC (4 years, 9 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.1: +4 -4 lines
Log Message:
Fixed comments mentioning depths rather than normals

File Contents

# User Rev Content
1 greg 2.2 /* RCSid $Id: normcodec.h,v 2.1 2019/07/19 02:18:44 greg Exp $ */
2 greg 2.1 /*
3     * Definitions and declarations for 32-bit vector normal encode/decode
4     *
5     * Include after stdio.h and fvect.h
6     * Includes resolu.h
7     */
8    
9     #ifndef _RAD_NORMALCODEC_H_
10     #define _RAD_NORMALCODEC_H_
11    
12     #include "resolu.h"
13    
14     #ifdef __cplusplus
15     extern "C" {
16     #endif
17    
18     #define NORMAL32FMT "32-bit_encoded_normal"
19    
20     #define HF_HEADIN 0x1
21     #define HF_HEADOUT 0x2
22     #define HF_RESIN 0x4
23     #define HF_RESOUT 0x8
24     #define HF_ALL 0xf
25     #define HF_ENCODE 0x10
26    
27 greg 2.2 /* Structure for encoding/decoding normals */
28 greg 2.1 typedef struct {
29     FILE *finp; /* input stream */
30     const char *inpname; /* input name */
31     int format; /* decoded format */
32     long dstart; /* start of data */
33     long curpos; /* current input position */
34     int hdrflags; /* header i/o flags */
35     char inpfmt[MAXFMTLEN]; /* format from header */
36     RESOLU res; /* input resolution */
37     } NORMCODEC;
38    
39     /* Set codec defaults */
40     extern void set_nc_defaults(NORMCODEC *ncp);
41    
42     /* Load/copy header */
43     extern int process_nc_header(NORMCODEC *ncp, int ac, char *av[]);
44    
45 greg 2.2 /* Check that we have what we need to decode normals */
46 greg 2.1 extern int check_decode_normals(NORMCODEC *ncp);
47    
48     /* Decode next normal from input */
49     extern int decode_normal_next(FVECT nrm, NORMCODEC *ncp);
50    
51     /* Seek to the indicated pixel position */
52     extern int seek_nc_pix(NORMCODEC *ncp, int x, int y);
53    
54 greg 2.2 /* Read and decode normal for the given pixel */
55 greg 2.1 extern int decode_normal_pix(FVECT nrm, NORMCODEC *ncp, int x, int y);
56    
57     extern char *progname; /* global argv[0] (set by main) */
58    
59     #ifdef __cplusplus
60     }
61     #endif
62     #endif /* _RAD_NORMALCODEC_H_ */