source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/src/march/shd.h @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.3 KB
Line 
1/********** shading - 3-d shading map **********/
2
3/* Copyright 1990 by Marc Levoy - all rights reserved */
4
5/* The following declarations show the layout of the .shd file.              */
6/* If changed, the version number must be incremented and code               */
7/* written to handle loading of both old and current versions.               */
8
9                                /* Version for new .shd files:               */
10#define SHD_CUR_VERSION 1       /*   Initial release                         */
11short shd_version;              /* Version of this .shd file                 */
12
13short shd_len[NM];              /* Size of this shading map                  */
14
15long shd_length;                /* Total number of shades & opacities in map */
16                                /*   (= (ICSIZE+1) * product of lens)        */
17PIXEL *shd_address;             /* Pointer to shading map                    */
18
19/* End of layout of .shd file.                                               */
20
21                                /* Subscripted access to shading map         */
22                                /*   (ICSIZE+1 chars at each IX,IY,IZ)       */
23#define SHD_ADDRESS(IZ,IY,IX,C) (shd_address+\
24                                 (((IZ)*shd_len[Y]+(IY))*shd_len[X]+(IX))*\
25                                 (ICSIZE+1)+(C))
26#define SHD(IZ,IY,IX,C)         (*SHD_ADDRESS(IZ,IY,IX,C))
27
28short out_shd_len[NM];          /* Size of output shading map                */
29long out_shd_length;            /* Total number of shades & opacities in map */
30PIXEL *out_shd_address;         /* Pointer to map                            */
31
32                                /* Subscripted access to output map          */
33#define OUT_SHD_ADDRESS(IZ,IY,IX,C)     \
34                                (out_shd_address+\
35                                 (((IZ)*out_shd_len[Y]+\
36                                   (IY))*out_shd_len[X]+\
37                                  (IX))*(ICSIZE+1)+(C))
38#define OUT_SHD(IZ,IY,IX,C)     (*OUT_SHD_ADDRESS(IZ,IY,IX,C))
39
40short acc_shd_len[NM];          /* Size of 3-d shading accumulator           */
41long acc_shd_length;            /* Total number of shades & opacities        */
42WPIXELSUM *acc_shd_address;     /* Pointer to accumulator                    */
43
44                                /* Subscripted access to accumulator         */
45#define ACC_SHD_ADDRESS(IZ,IY,IX,C)     \
46                                (acc_shd_address+\
47                                 (((IZ)*acc_shd_len[Y]+\
48                                   (IY))*acc_shd_len[X]+\
49                                  (IX))*(ICSIZE+1)+(C))
50#define ACC_SHD(IZ,IY,IX,C)     (*ACC_SHD_ADDRESS(IZ,IY,IX,C))
51
52BOOLEAN shd_histogram_exists;                   /* True if histogram exists  */
53long shading_color_histogram[MAX_PIXEL+1];      /* Histogram of shading map  */
54long shading_opacity_histogram[MAX_PIXEL+1];    /*                           */
Note: See TracBrowser for help on using the repository browser.