2
0
David Rose 24 жил өмнө
parent
commit
3141f00890

+ 1 - 1
panda/src/chancfg/chancfg.I

@@ -17,7 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
   INLINE PT_NamedNode ChanConfig::get_group_node(const int node_index) const {
   INLINE PT_NamedNode ChanConfig::get_group_node(const int node_index) const {
-	 return _group_node[node_index];
+         return _group_node[node_index];
   }
   }
   INLINE int ChanConfig::get_group_membership(const int dr_index) const {
   INLINE int ChanConfig::get_group_membership(const int dr_index) const {
     return _group_membership[dr_index];
     return _group_membership[dr_index];

+ 2 - 2
panda/src/chancfg/chancfg.h

@@ -112,8 +112,8 @@ private:
   std::vector<int> _group_membership;
   std::vector<int> _group_membership;
   PT(GraphicsWindow) _graphics_window;
   PT(GraphicsWindow) _graphics_window;
   void chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, 
   void chan_eval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, 
-	 SVec& S, ChanViewport& V, int hw_offset, 
-	 int xsize, int ysize, Node *render, bool want_cameras);
+         SVec& S, ChanViewport& V, int hw_offset, 
+         int xsize, int ysize, Node *render, bool want_cameras);
 PUBLISHED:
 PUBLISHED:
   ChanConfig(GraphicsPipe*, std::string, Node *render,
   ChanConfig(GraphicsPipe*, std::string, Node *render,
     ChanCfgOverrides& = ChanOverrideNone);
     ChanCfgOverrides& = ChanOverrideNone);

+ 2 - 2
panda/src/downloader/downloader.cxx

@@ -93,11 +93,11 @@ Downloader::
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 int Downloader::
 int Downloader::
 connect_to_server_by_proxy(const string &proxy_name, uint proxy_port,
 connect_to_server_by_proxy(const string &proxy_name, uint proxy_port,
-			   const string &server_name) {
+                           const string &server_name) {
   if (connect_to_server(proxy_name, proxy_port) != EU_success) {
   if (connect_to_server(proxy_name, proxy_port) != EU_success) {
     downloader_cat.error()
     downloader_cat.error()
       << "Downloader::connect_to_server_by_proxy() - could not connect to: "
       << "Downloader::connect_to_server_by_proxy() - could not connect to: "
-      << proxy_name << endl;	
+      << proxy_name << endl;
     return EU_error_abort;
     return EU_error_abort;
   }
   }
   
   

+ 1 - 1
panda/src/downloader/downloader.h

@@ -47,7 +47,7 @@ PUBLISHED:
   virtual ~Downloader(void);
   virtual ~Downloader(void);
 
 
   int connect_to_server_by_proxy(const string &proxy_name, uint proxy_port,
   int connect_to_server_by_proxy(const string &proxy_name, uint proxy_port,
-		const string &server_name);
+                const string &server_name);
   int connect_to_server(const string &name, uint port=80);
   int connect_to_server(const string &name, uint port=80);
   void disconnect_from_server(void);
   void disconnect_from_server(void);
 
 

+ 2 - 2
panda/src/glgsg/glext.h

@@ -2932,8 +2932,8 @@ typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolea
 /* Extensions */
 /* Extensions */
 #define GL_ARB_texture_border_clamp       1
 #define GL_ARB_texture_border_clamp       1
 #define GL_NV_evaluators                  1
 #define GL_NV_evaluators                  1
-#define GL_NV_fence						  1
-#define GL_NV_packed_depth_stencil		  1
+#define GL_NV_fence                                               1
+#define GL_NV_packed_depth_stencil                1
 #define GL_NV_register_combiners2         1
 #define GL_NV_register_combiners2         1
 #define GL_NV_texture_rectangle           1
 #define GL_NV_texture_rectangle           1
 #define GL_NV_texture_shader              1
 #define GL_NV_texture_shader              1

+ 46 - 46
panda/src/sgraph/camera.cxx

@@ -185,82 +185,82 @@ remove_display_region(DisplayRegion *display_region) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void Camera::
 void Camera::
 set_projection(const Projection &projection) {
 set_projection(const Projection &projection) {
-	ProjectionNode::set_projection(projection);
-	if(has_name()) {
-	  throw_event(_CHANGE_CAM,get_name());
-	}
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_projection(projection);
+        if(has_name()) {
+          throw_event(_CHANGE_CAM,get_name());
+        }
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_fov(float hfov) {
 set_fov(float hfov) {
-	ProjectionNode::set_fov(hfov);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_fov(hfov);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_fov(float hfov, float vfov) {
 set_fov(float hfov, float vfov) {
-	ProjectionNode::set_fov(hfov, vfov);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_fov(hfov, vfov);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_hfov(float hfov) {
 set_hfov(float hfov) {
-	ProjectionNode::set_hfov(hfov);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_hfov(hfov);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_vfov(float vfov) {
 set_vfov(float vfov) {
-	ProjectionNode::set_vfov(vfov);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_vfov(vfov);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_aspect(float aspect) {
 set_aspect(float aspect) {
-	ProjectionNode::set_aspect(aspect);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_aspect(aspect);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_near_far(float cnear, float cfar) {
 set_near_far(float cnear, float cfar) {
-	ProjectionNode::set_near_far(cnear,cfar);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_near_far(cnear,cfar);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_near(float cnear) {
 set_near(float cnear) {
-	ProjectionNode::set_near(cnear);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_near(cnear);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }
 
 
 void Camera::
 void Camera::
 set_far(float cfar) {
 set_far(float cfar) {
-	ProjectionNode::set_far(cfar);
-	if(has_name())
-	  throw_event(_CHANGE_CAM,get_name());
-	else
-	  throw_event(_CHANGE_CAM,std::string(""));
+        ProjectionNode::set_far(cfar);
+        if(has_name())
+          throw_event(_CHANGE_CAM,get_name());
+        else
+          throw_event(_CHANGE_CAM,std::string(""));
 }
 }

+ 8 - 8
panda/src/tiff/port.h

@@ -1,10 +1,10 @@
 /*
 /*
  * Warning, this file was automatically created by the TIFF configure script
  * Warning, this file was automatically created by the TIFF configure script
- * VERSION:	 v3.5.6
+ * VERSION:      v3.5.6
  * RELEASE:    beta
  * RELEASE:    beta
- * DATE:	 Wed Jun 13 22:00:21 2001
- * TARGET:	
- * CCOMPILER:	 /bin/gcc-2.9.cygwin-990830
+ * DATE:         Wed Jun 13 22:00:21 2001
+ * TARGET:
+ * CCOMPILER:    /bin/gcc-2.9.cygwin-990830
  */
  */
 #ifndef _PORT_
 #ifndef _PORT_
 #define _PORT_ 1
 #define _PORT_ 1
@@ -13,7 +13,7 @@ extern "C" {
 #endif
 #endif
 #include <sys/types.h>
 #include <sys/types.h>
 #define HOST_FILLORDER FILLORDER_MSB2LSB
 #define HOST_FILLORDER FILLORDER_MSB2LSB
-#define HOST_BIGENDIAN	0
+#define HOST_BIGENDIAN  0
 #include <stdio.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <string.h>
 #include <string.h>
@@ -22,14 +22,14 @@ extern "C" {
 typedef double dblparam_t;
 typedef double dblparam_t;
 #ifdef __GNUCC__
 #ifdef __GNUCC__
 #ifdef __STRICT_ANSI__
 #ifdef __STRICT_ANSI__
-#define	INLINE	__inline__
+#define INLINE  __inline__
 #else
 #else
-#define	INLINE	inline
+#define INLINE  inline
 #endif
 #endif
 #else
 #else
 #define INLINE
 #define INLINE
 #endif
 #endif
-#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME
+#define GLOBALDATA(TYPE,NAME)   extern TYPE NAME
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 229 - 229
panda/src/tiff/t4.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _T4_
 #ifndef _T4_
-#define	_T4_
+#define _T4_
 /*
 /*
  * CCITT T.4 1D Huffman runlength codes and
  * CCITT T.4 1D Huffman runlength codes and
  * related definitions.  Given the small sizes
  * related definitions.  Given the small sizes
@@ -33,18 +33,18 @@
  * worthwhile to make code & length 8 bits.
  * worthwhile to make code & length 8 bits.
  */
  */
 typedef struct tableentry {
 typedef struct tableentry {
-    unsigned short length;	/* bit length of g3 code */
-    unsigned short code;	/* g3 code */
-    short	runlen;		/* run length in bits */
+    unsigned short length;      /* bit length of g3 code */
+    unsigned short code;        /* g3 code */
+    short       runlen;         /* run length in bits */
 } tableentry;
 } tableentry;
 
 
-#define	EOL	0x001	/* EOL code value - 0000 0000 0000 1 */
+#define EOL     0x001   /* EOL code value - 0000 0000 0000 1 */
 
 
 /* status values returned instead of a run length */
 /* status values returned instead of a run length */
-#define	G3CODE_EOL	-1	/* NB: ACT_EOL - ACT_WRUNT */
-#define	G3CODE_INVALID	-2	/* NB: ACT_INVALID - ACT_WRUNT */
-#define	G3CODE_EOF	-3	/* end of input data */
-#define	G3CODE_INCOMP	-4	/* incomplete run code */
+#define G3CODE_EOL      -1      /* NB: ACT_EOL - ACT_WRUNT */
+#define G3CODE_INVALID  -2      /* NB: ACT_INVALID - ACT_WRUNT */
+#define G3CODE_EOF      -3      /* end of input data */
+#define G3CODE_INCOMP   -4      /* incomplete run code */
 
 
 /*
 /*
  * Note that these tables are ordered such that the
  * Note that these tables are ordered such that the
@@ -56,230 +56,230 @@ typedef struct tableentry {
  */
  */
 #ifdef G3CODES
 #ifdef G3CODES
 const tableentry TIFFFaxWhiteCodes[] = {
 const tableentry TIFFFaxWhiteCodes[] = {
-    { 8, 0x35, 0 },	/* 0011 0101 */
-    { 6, 0x7, 1 },	/* 0001 11 */
-    { 4, 0x7, 2 },	/* 0111 */
-    { 4, 0x8, 3 },	/* 1000 */
-    { 4, 0xB, 4 },	/* 1011 */
-    { 4, 0xC, 5 },	/* 1100 */
-    { 4, 0xE, 6 },	/* 1110 */
-    { 4, 0xF, 7 },	/* 1111 */
-    { 5, 0x13, 8 },	/* 1001 1 */
-    { 5, 0x14, 9 },	/* 1010 0 */
-    { 5, 0x7, 10 },	/* 0011 1 */
-    { 5, 0x8, 11 },	/* 0100 0 */
-    { 6, 0x8, 12 },	/* 0010 00 */
-    { 6, 0x3, 13 },	/* 0000 11 */
-    { 6, 0x34, 14 },	/* 1101 00 */
-    { 6, 0x35, 15 },	/* 1101 01 */
-    { 6, 0x2A, 16 },	/* 1010 10 */
-    { 6, 0x2B, 17 },	/* 1010 11 */
-    { 7, 0x27, 18 },	/* 0100 111 */
-    { 7, 0xC, 19 },	/* 0001 100 */
-    { 7, 0x8, 20 },	/* 0001 000 */
-    { 7, 0x17, 21 },	/* 0010 111 */
-    { 7, 0x3, 22 },	/* 0000 011 */
-    { 7, 0x4, 23 },	/* 0000 100 */
-    { 7, 0x28, 24 },	/* 0101 000 */
-    { 7, 0x2B, 25 },	/* 0101 011 */
-    { 7, 0x13, 26 },	/* 0010 011 */
-    { 7, 0x24, 27 },	/* 0100 100 */
-    { 7, 0x18, 28 },	/* 0011 000 */
-    { 8, 0x2, 29 },	/* 0000 0010 */
-    { 8, 0x3, 30 },	/* 0000 0011 */
-    { 8, 0x1A, 31 },	/* 0001 1010 */
-    { 8, 0x1B, 32 },	/* 0001 1011 */
-    { 8, 0x12, 33 },	/* 0001 0010 */
-    { 8, 0x13, 34 },	/* 0001 0011 */
-    { 8, 0x14, 35 },	/* 0001 0100 */
-    { 8, 0x15, 36 },	/* 0001 0101 */
-    { 8, 0x16, 37 },	/* 0001 0110 */
-    { 8, 0x17, 38 },	/* 0001 0111 */
-    { 8, 0x28, 39 },	/* 0010 1000 */
-    { 8, 0x29, 40 },	/* 0010 1001 */
-    { 8, 0x2A, 41 },	/* 0010 1010 */
-    { 8, 0x2B, 42 },	/* 0010 1011 */
-    { 8, 0x2C, 43 },	/* 0010 1100 */
-    { 8, 0x2D, 44 },	/* 0010 1101 */
-    { 8, 0x4, 45 },	/* 0000 0100 */
-    { 8, 0x5, 46 },	/* 0000 0101 */
-    { 8, 0xA, 47 },	/* 0000 1010 */
-    { 8, 0xB, 48 },	/* 0000 1011 */
-    { 8, 0x52, 49 },	/* 0101 0010 */
-    { 8, 0x53, 50 },	/* 0101 0011 */
-    { 8, 0x54, 51 },	/* 0101 0100 */
-    { 8, 0x55, 52 },	/* 0101 0101 */
-    { 8, 0x24, 53 },	/* 0010 0100 */
-    { 8, 0x25, 54 },	/* 0010 0101 */
-    { 8, 0x58, 55 },	/* 0101 1000 */
-    { 8, 0x59, 56 },	/* 0101 1001 */
-    { 8, 0x5A, 57 },	/* 0101 1010 */
-    { 8, 0x5B, 58 },	/* 0101 1011 */
-    { 8, 0x4A, 59 },	/* 0100 1010 */
-    { 8, 0x4B, 60 },	/* 0100 1011 */
-    { 8, 0x32, 61 },	/* 0011 0010 */
-    { 8, 0x33, 62 },	/* 0011 0011 */
-    { 8, 0x34, 63 },	/* 0011 0100 */
-    { 5, 0x1B, 64 },	/* 1101 1 */
-    { 5, 0x12, 128 },	/* 1001 0 */
-    { 6, 0x17, 192 },	/* 0101 11 */
-    { 7, 0x37, 256 },	/* 0110 111 */
-    { 8, 0x36, 320 },	/* 0011 0110 */
-    { 8, 0x37, 384 },	/* 0011 0111 */
-    { 8, 0x64, 448 },	/* 0110 0100 */
-    { 8, 0x65, 512 },	/* 0110 0101 */
-    { 8, 0x68, 576 },	/* 0110 1000 */
-    { 8, 0x67, 640 },	/* 0110 0111 */
-    { 9, 0xCC, 704 },	/* 0110 0110 0 */
-    { 9, 0xCD, 768 },	/* 0110 0110 1 */
-    { 9, 0xD2, 832 },	/* 0110 1001 0 */
-    { 9, 0xD3, 896 },	/* 0110 1001 1 */
-    { 9, 0xD4, 960 },	/* 0110 1010 0 */
-    { 9, 0xD5, 1024 },	/* 0110 1010 1 */
-    { 9, 0xD6, 1088 },	/* 0110 1011 0 */
-    { 9, 0xD7, 1152 },	/* 0110 1011 1 */
-    { 9, 0xD8, 1216 },	/* 0110 1100 0 */
-    { 9, 0xD9, 1280 },	/* 0110 1100 1 */
-    { 9, 0xDA, 1344 },	/* 0110 1101 0 */
-    { 9, 0xDB, 1408 },	/* 0110 1101 1 */
-    { 9, 0x98, 1472 },	/* 0100 1100 0 */
-    { 9, 0x99, 1536 },	/* 0100 1100 1 */
-    { 9, 0x9A, 1600 },	/* 0100 1101 0 */
-    { 6, 0x18, 1664 },	/* 0110 00 */
-    { 9, 0x9B, 1728 },	/* 0100 1101 1 */
-    { 11, 0x8, 1792 },	/* 0000 0001 000 */
-    { 11, 0xC, 1856 },	/* 0000 0001 100 */
-    { 11, 0xD, 1920 },	/* 0000 0001 101 */
-    { 12, 0x12, 1984 },	/* 0000 0001 0010 */
-    { 12, 0x13, 2048 },	/* 0000 0001 0011 */
-    { 12, 0x14, 2112 },	/* 0000 0001 0100 */
-    { 12, 0x15, 2176 },	/* 0000 0001 0101 */
-    { 12, 0x16, 2240 },	/* 0000 0001 0110 */
-    { 12, 0x17, 2304 },	/* 0000 0001 0111 */
-    { 12, 0x1C, 2368 },	/* 0000 0001 1100 */
-    { 12, 0x1D, 2432 },	/* 0000 0001 1101 */
-    { 12, 0x1E, 2496 },	/* 0000 0001 1110 */
-    { 12, 0x1F, 2560 },	/* 0000 0001 1111 */
-    { 12, 0x1, G3CODE_EOL },	/* 0000 0000 0001 */
-    { 9, 0x1, G3CODE_INVALID },	/* 0000 0000 1 */
-    { 10, 0x1, G3CODE_INVALID },	/* 0000 0000 01 */
-    { 11, 0x1, G3CODE_INVALID },	/* 0000 0000 001 */
-    { 12, 0x0, G3CODE_INVALID },	/* 0000 0000 0000 */
+    { 8, 0x35, 0 },     /* 0011 0101 */
+    { 6, 0x7, 1 },      /* 0001 11 */
+    { 4, 0x7, 2 },      /* 0111 */
+    { 4, 0x8, 3 },      /* 1000 */
+    { 4, 0xB, 4 },      /* 1011 */
+    { 4, 0xC, 5 },      /* 1100 */
+    { 4, 0xE, 6 },      /* 1110 */
+    { 4, 0xF, 7 },      /* 1111 */
+    { 5, 0x13, 8 },     /* 1001 1 */
+    { 5, 0x14, 9 },     /* 1010 0 */
+    { 5, 0x7, 10 },     /* 0011 1 */
+    { 5, 0x8, 11 },     /* 0100 0 */
+    { 6, 0x8, 12 },     /* 0010 00 */
+    { 6, 0x3, 13 },     /* 0000 11 */
+    { 6, 0x34, 14 },    /* 1101 00 */
+    { 6, 0x35, 15 },    /* 1101 01 */
+    { 6, 0x2A, 16 },    /* 1010 10 */
+    { 6, 0x2B, 17 },    /* 1010 11 */
+    { 7, 0x27, 18 },    /* 0100 111 */
+    { 7, 0xC, 19 },     /* 0001 100 */
+    { 7, 0x8, 20 },     /* 0001 000 */
+    { 7, 0x17, 21 },    /* 0010 111 */
+    { 7, 0x3, 22 },     /* 0000 011 */
+    { 7, 0x4, 23 },     /* 0000 100 */
+    { 7, 0x28, 24 },    /* 0101 000 */
+    { 7, 0x2B, 25 },    /* 0101 011 */
+    { 7, 0x13, 26 },    /* 0010 011 */
+    { 7, 0x24, 27 },    /* 0100 100 */
+    { 7, 0x18, 28 },    /* 0011 000 */
+    { 8, 0x2, 29 },     /* 0000 0010 */
+    { 8, 0x3, 30 },     /* 0000 0011 */
+    { 8, 0x1A, 31 },    /* 0001 1010 */
+    { 8, 0x1B, 32 },    /* 0001 1011 */
+    { 8, 0x12, 33 },    /* 0001 0010 */
+    { 8, 0x13, 34 },    /* 0001 0011 */
+    { 8, 0x14, 35 },    /* 0001 0100 */
+    { 8, 0x15, 36 },    /* 0001 0101 */
+    { 8, 0x16, 37 },    /* 0001 0110 */
+    { 8, 0x17, 38 },    /* 0001 0111 */
+    { 8, 0x28, 39 },    /* 0010 1000 */
+    { 8, 0x29, 40 },    /* 0010 1001 */
+    { 8, 0x2A, 41 },    /* 0010 1010 */
+    { 8, 0x2B, 42 },    /* 0010 1011 */
+    { 8, 0x2C, 43 },    /* 0010 1100 */
+    { 8, 0x2D, 44 },    /* 0010 1101 */
+    { 8, 0x4, 45 },     /* 0000 0100 */
+    { 8, 0x5, 46 },     /* 0000 0101 */
+    { 8, 0xA, 47 },     /* 0000 1010 */
+    { 8, 0xB, 48 },     /* 0000 1011 */
+    { 8, 0x52, 49 },    /* 0101 0010 */
+    { 8, 0x53, 50 },    /* 0101 0011 */
+    { 8, 0x54, 51 },    /* 0101 0100 */
+    { 8, 0x55, 52 },    /* 0101 0101 */
+    { 8, 0x24, 53 },    /* 0010 0100 */
+    { 8, 0x25, 54 },    /* 0010 0101 */
+    { 8, 0x58, 55 },    /* 0101 1000 */
+    { 8, 0x59, 56 },    /* 0101 1001 */
+    { 8, 0x5A, 57 },    /* 0101 1010 */
+    { 8, 0x5B, 58 },    /* 0101 1011 */
+    { 8, 0x4A, 59 },    /* 0100 1010 */
+    { 8, 0x4B, 60 },    /* 0100 1011 */
+    { 8, 0x32, 61 },    /* 0011 0010 */
+    { 8, 0x33, 62 },    /* 0011 0011 */
+    { 8, 0x34, 63 },    /* 0011 0100 */
+    { 5, 0x1B, 64 },    /* 1101 1 */
+    { 5, 0x12, 128 },   /* 1001 0 */
+    { 6, 0x17, 192 },   /* 0101 11 */
+    { 7, 0x37, 256 },   /* 0110 111 */
+    { 8, 0x36, 320 },   /* 0011 0110 */
+    { 8, 0x37, 384 },   /* 0011 0111 */
+    { 8, 0x64, 448 },   /* 0110 0100 */
+    { 8, 0x65, 512 },   /* 0110 0101 */
+    { 8, 0x68, 576 },   /* 0110 1000 */
+    { 8, 0x67, 640 },   /* 0110 0111 */
+    { 9, 0xCC, 704 },   /* 0110 0110 0 */
+    { 9, 0xCD, 768 },   /* 0110 0110 1 */
+    { 9, 0xD2, 832 },   /* 0110 1001 0 */
+    { 9, 0xD3, 896 },   /* 0110 1001 1 */
+    { 9, 0xD4, 960 },   /* 0110 1010 0 */
+    { 9, 0xD5, 1024 },  /* 0110 1010 1 */
+    { 9, 0xD6, 1088 },  /* 0110 1011 0 */
+    { 9, 0xD7, 1152 },  /* 0110 1011 1 */
+    { 9, 0xD8, 1216 },  /* 0110 1100 0 */
+    { 9, 0xD9, 1280 },  /* 0110 1100 1 */
+    { 9, 0xDA, 1344 },  /* 0110 1101 0 */
+    { 9, 0xDB, 1408 },  /* 0110 1101 1 */
+    { 9, 0x98, 1472 },  /* 0100 1100 0 */
+    { 9, 0x99, 1536 },  /* 0100 1100 1 */
+    { 9, 0x9A, 1600 },  /* 0100 1101 0 */
+    { 6, 0x18, 1664 },  /* 0110 00 */
+    { 9, 0x9B, 1728 },  /* 0100 1101 1 */
+    { 11, 0x8, 1792 },  /* 0000 0001 000 */
+    { 11, 0xC, 1856 },  /* 0000 0001 100 */
+    { 11, 0xD, 1920 },  /* 0000 0001 101 */
+    { 12, 0x12, 1984 }, /* 0000 0001 0010 */
+    { 12, 0x13, 2048 }, /* 0000 0001 0011 */
+    { 12, 0x14, 2112 }, /* 0000 0001 0100 */
+    { 12, 0x15, 2176 }, /* 0000 0001 0101 */
+    { 12, 0x16, 2240 }, /* 0000 0001 0110 */
+    { 12, 0x17, 2304 }, /* 0000 0001 0111 */
+    { 12, 0x1C, 2368 }, /* 0000 0001 1100 */
+    { 12, 0x1D, 2432 }, /* 0000 0001 1101 */
+    { 12, 0x1E, 2496 }, /* 0000 0001 1110 */
+    { 12, 0x1F, 2560 }, /* 0000 0001 1111 */
+    { 12, 0x1, G3CODE_EOL },    /* 0000 0000 0001 */
+    { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */
+    { 10, 0x1, G3CODE_INVALID },        /* 0000 0000 01 */
+    { 11, 0x1, G3CODE_INVALID },        /* 0000 0000 001 */
+    { 12, 0x0, G3CODE_INVALID },        /* 0000 0000 0000 */
 };
 };
 
 
 const tableentry TIFFFaxBlackCodes[] = {
 const tableentry TIFFFaxBlackCodes[] = {
-    { 10, 0x37, 0 },	/* 0000 1101 11 */
-    { 3, 0x2, 1 },	/* 010 */
-    { 2, 0x3, 2 },	/* 11 */
-    { 2, 0x2, 3 },	/* 10 */
-    { 3, 0x3, 4 },	/* 011 */
-    { 4, 0x3, 5 },	/* 0011 */
-    { 4, 0x2, 6 },	/* 0010 */
-    { 5, 0x3, 7 },	/* 0001 1 */
-    { 6, 0x5, 8 },	/* 0001 01 */
-    { 6, 0x4, 9 },	/* 0001 00 */
-    { 7, 0x4, 10 },	/* 0000 100 */
-    { 7, 0x5, 11 },	/* 0000 101 */
-    { 7, 0x7, 12 },	/* 0000 111 */
-    { 8, 0x4, 13 },	/* 0000 0100 */
-    { 8, 0x7, 14 },	/* 0000 0111 */
-    { 9, 0x18, 15 },	/* 0000 1100 0 */
-    { 10, 0x17, 16 },	/* 0000 0101 11 */
-    { 10, 0x18, 17 },	/* 0000 0110 00 */
-    { 10, 0x8, 18 },	/* 0000 0010 00 */
-    { 11, 0x67, 19 },	/* 0000 1100 111 */
-    { 11, 0x68, 20 },	/* 0000 1101 000 */
-    { 11, 0x6C, 21 },	/* 0000 1101 100 */
-    { 11, 0x37, 22 },	/* 0000 0110 111 */
-    { 11, 0x28, 23 },	/* 0000 0101 000 */
-    { 11, 0x17, 24 },	/* 0000 0010 111 */
-    { 11, 0x18, 25 },	/* 0000 0011 000 */
-    { 12, 0xCA, 26 },	/* 0000 1100 1010 */
-    { 12, 0xCB, 27 },	/* 0000 1100 1011 */
-    { 12, 0xCC, 28 },	/* 0000 1100 1100 */
-    { 12, 0xCD, 29 },	/* 0000 1100 1101 */
-    { 12, 0x68, 30 },	/* 0000 0110 1000 */
-    { 12, 0x69, 31 },	/* 0000 0110 1001 */
-    { 12, 0x6A, 32 },	/* 0000 0110 1010 */
-    { 12, 0x6B, 33 },	/* 0000 0110 1011 */
-    { 12, 0xD2, 34 },	/* 0000 1101 0010 */
-    { 12, 0xD3, 35 },	/* 0000 1101 0011 */
-    { 12, 0xD4, 36 },	/* 0000 1101 0100 */
-    { 12, 0xD5, 37 },	/* 0000 1101 0101 */
-    { 12, 0xD6, 38 },	/* 0000 1101 0110 */
-    { 12, 0xD7, 39 },	/* 0000 1101 0111 */
-    { 12, 0x6C, 40 },	/* 0000 0110 1100 */
-    { 12, 0x6D, 41 },	/* 0000 0110 1101 */
-    { 12, 0xDA, 42 },	/* 0000 1101 1010 */
-    { 12, 0xDB, 43 },	/* 0000 1101 1011 */
-    { 12, 0x54, 44 },	/* 0000 0101 0100 */
-    { 12, 0x55, 45 },	/* 0000 0101 0101 */
-    { 12, 0x56, 46 },	/* 0000 0101 0110 */
-    { 12, 0x57, 47 },	/* 0000 0101 0111 */
-    { 12, 0x64, 48 },	/* 0000 0110 0100 */
-    { 12, 0x65, 49 },	/* 0000 0110 0101 */
-    { 12, 0x52, 50 },	/* 0000 0101 0010 */
-    { 12, 0x53, 51 },	/* 0000 0101 0011 */
-    { 12, 0x24, 52 },	/* 0000 0010 0100 */
-    { 12, 0x37, 53 },	/* 0000 0011 0111 */
-    { 12, 0x38, 54 },	/* 0000 0011 1000 */
-    { 12, 0x27, 55 },	/* 0000 0010 0111 */
-    { 12, 0x28, 56 },	/* 0000 0010 1000 */
-    { 12, 0x58, 57 },	/* 0000 0101 1000 */
-    { 12, 0x59, 58 },	/* 0000 0101 1001 */
-    { 12, 0x2B, 59 },	/* 0000 0010 1011 */
-    { 12, 0x2C, 60 },	/* 0000 0010 1100 */
-    { 12, 0x5A, 61 },	/* 0000 0101 1010 */
-    { 12, 0x66, 62 },	/* 0000 0110 0110 */
-    { 12, 0x67, 63 },	/* 0000 0110 0111 */
-    { 10, 0xF, 64 },	/* 0000 0011 11 */
-    { 12, 0xC8, 128 },	/* 0000 1100 1000 */
-    { 12, 0xC9, 192 },	/* 0000 1100 1001 */
-    { 12, 0x5B, 256 },	/* 0000 0101 1011 */
-    { 12, 0x33, 320 },	/* 0000 0011 0011 */
-    { 12, 0x34, 384 },	/* 0000 0011 0100 */
-    { 12, 0x35, 448 },	/* 0000 0011 0101 */
-    { 13, 0x6C, 512 },	/* 0000 0011 0110 0 */
-    { 13, 0x6D, 576 },	/* 0000 0011 0110 1 */
-    { 13, 0x4A, 640 },	/* 0000 0010 0101 0 */
-    { 13, 0x4B, 704 },	/* 0000 0010 0101 1 */
-    { 13, 0x4C, 768 },	/* 0000 0010 0110 0 */
-    { 13, 0x4D, 832 },	/* 0000 0010 0110 1 */
-    { 13, 0x72, 896 },	/* 0000 0011 1001 0 */
-    { 13, 0x73, 960 },	/* 0000 0011 1001 1 */
-    { 13, 0x74, 1024 },	/* 0000 0011 1010 0 */
-    { 13, 0x75, 1088 },	/* 0000 0011 1010 1 */
-    { 13, 0x76, 1152 },	/* 0000 0011 1011 0 */
-    { 13, 0x77, 1216 },	/* 0000 0011 1011 1 */
-    { 13, 0x52, 1280 },	/* 0000 0010 1001 0 */
-    { 13, 0x53, 1344 },	/* 0000 0010 1001 1 */
-    { 13, 0x54, 1408 },	/* 0000 0010 1010 0 */
-    { 13, 0x55, 1472 },	/* 0000 0010 1010 1 */
-    { 13, 0x5A, 1536 },	/* 0000 0010 1101 0 */
-    { 13, 0x5B, 1600 },	/* 0000 0010 1101 1 */
-    { 13, 0x64, 1664 },	/* 0000 0011 0010 0 */
-    { 13, 0x65, 1728 },	/* 0000 0011 0010 1 */
-    { 11, 0x8, 1792 },	/* 0000 0001 000 */
-    { 11, 0xC, 1856 },	/* 0000 0001 100 */
-    { 11, 0xD, 1920 },	/* 0000 0001 101 */
-    { 12, 0x12, 1984 },	/* 0000 0001 0010 */
-    { 12, 0x13, 2048 },	/* 0000 0001 0011 */
-    { 12, 0x14, 2112 },	/* 0000 0001 0100 */
-    { 12, 0x15, 2176 },	/* 0000 0001 0101 */
-    { 12, 0x16, 2240 },	/* 0000 0001 0110 */
-    { 12, 0x17, 2304 },	/* 0000 0001 0111 */
-    { 12, 0x1C, 2368 },	/* 0000 0001 1100 */
-    { 12, 0x1D, 2432 },	/* 0000 0001 1101 */
-    { 12, 0x1E, 2496 },	/* 0000 0001 1110 */
-    { 12, 0x1F, 2560 },	/* 0000 0001 1111 */
-    { 12, 0x1, G3CODE_EOL },	/* 0000 0000 0001 */
-    { 9, 0x1, G3CODE_INVALID },	/* 0000 0000 1 */
-    { 10, 0x1, G3CODE_INVALID },	/* 0000 0000 01 */
-    { 11, 0x1, G3CODE_INVALID },	/* 0000 0000 001 */
-    { 12, 0x0, G3CODE_INVALID },	/* 0000 0000 0000 */
+    { 10, 0x37, 0 },    /* 0000 1101 11 */
+    { 3, 0x2, 1 },      /* 010 */
+    { 2, 0x3, 2 },      /* 11 */
+    { 2, 0x2, 3 },      /* 10 */
+    { 3, 0x3, 4 },      /* 011 */
+    { 4, 0x3, 5 },      /* 0011 */
+    { 4, 0x2, 6 },      /* 0010 */
+    { 5, 0x3, 7 },      /* 0001 1 */
+    { 6, 0x5, 8 },      /* 0001 01 */
+    { 6, 0x4, 9 },      /* 0001 00 */
+    { 7, 0x4, 10 },     /* 0000 100 */
+    { 7, 0x5, 11 },     /* 0000 101 */
+    { 7, 0x7, 12 },     /* 0000 111 */
+    { 8, 0x4, 13 },     /* 0000 0100 */
+    { 8, 0x7, 14 },     /* 0000 0111 */
+    { 9, 0x18, 15 },    /* 0000 1100 0 */
+    { 10, 0x17, 16 },   /* 0000 0101 11 */
+    { 10, 0x18, 17 },   /* 0000 0110 00 */
+    { 10, 0x8, 18 },    /* 0000 0010 00 */
+    { 11, 0x67, 19 },   /* 0000 1100 111 */
+    { 11, 0x68, 20 },   /* 0000 1101 000 */
+    { 11, 0x6C, 21 },   /* 0000 1101 100 */
+    { 11, 0x37, 22 },   /* 0000 0110 111 */
+    { 11, 0x28, 23 },   /* 0000 0101 000 */
+    { 11, 0x17, 24 },   /* 0000 0010 111 */
+    { 11, 0x18, 25 },   /* 0000 0011 000 */
+    { 12, 0xCA, 26 },   /* 0000 1100 1010 */
+    { 12, 0xCB, 27 },   /* 0000 1100 1011 */
+    { 12, 0xCC, 28 },   /* 0000 1100 1100 */
+    { 12, 0xCD, 29 },   /* 0000 1100 1101 */
+    { 12, 0x68, 30 },   /* 0000 0110 1000 */
+    { 12, 0x69, 31 },   /* 0000 0110 1001 */
+    { 12, 0x6A, 32 },   /* 0000 0110 1010 */
+    { 12, 0x6B, 33 },   /* 0000 0110 1011 */
+    { 12, 0xD2, 34 },   /* 0000 1101 0010 */
+    { 12, 0xD3, 35 },   /* 0000 1101 0011 */
+    { 12, 0xD4, 36 },   /* 0000 1101 0100 */
+    { 12, 0xD5, 37 },   /* 0000 1101 0101 */
+    { 12, 0xD6, 38 },   /* 0000 1101 0110 */
+    { 12, 0xD7, 39 },   /* 0000 1101 0111 */
+    { 12, 0x6C, 40 },   /* 0000 0110 1100 */
+    { 12, 0x6D, 41 },   /* 0000 0110 1101 */
+    { 12, 0xDA, 42 },   /* 0000 1101 1010 */
+    { 12, 0xDB, 43 },   /* 0000 1101 1011 */
+    { 12, 0x54, 44 },   /* 0000 0101 0100 */
+    { 12, 0x55, 45 },   /* 0000 0101 0101 */
+    { 12, 0x56, 46 },   /* 0000 0101 0110 */
+    { 12, 0x57, 47 },   /* 0000 0101 0111 */
+    { 12, 0x64, 48 },   /* 0000 0110 0100 */
+    { 12, 0x65, 49 },   /* 0000 0110 0101 */
+    { 12, 0x52, 50 },   /* 0000 0101 0010 */
+    { 12, 0x53, 51 },   /* 0000 0101 0011 */
+    { 12, 0x24, 52 },   /* 0000 0010 0100 */
+    { 12, 0x37, 53 },   /* 0000 0011 0111 */
+    { 12, 0x38, 54 },   /* 0000 0011 1000 */
+    { 12, 0x27, 55 },   /* 0000 0010 0111 */
+    { 12, 0x28, 56 },   /* 0000 0010 1000 */
+    { 12, 0x58, 57 },   /* 0000 0101 1000 */
+    { 12, 0x59, 58 },   /* 0000 0101 1001 */
+    { 12, 0x2B, 59 },   /* 0000 0010 1011 */
+    { 12, 0x2C, 60 },   /* 0000 0010 1100 */
+    { 12, 0x5A, 61 },   /* 0000 0101 1010 */
+    { 12, 0x66, 62 },   /* 0000 0110 0110 */
+    { 12, 0x67, 63 },   /* 0000 0110 0111 */
+    { 10, 0xF, 64 },    /* 0000 0011 11 */
+    { 12, 0xC8, 128 },  /* 0000 1100 1000 */
+    { 12, 0xC9, 192 },  /* 0000 1100 1001 */
+    { 12, 0x5B, 256 },  /* 0000 0101 1011 */
+    { 12, 0x33, 320 },  /* 0000 0011 0011 */
+    { 12, 0x34, 384 },  /* 0000 0011 0100 */
+    { 12, 0x35, 448 },  /* 0000 0011 0101 */
+    { 13, 0x6C, 512 },  /* 0000 0011 0110 0 */
+    { 13, 0x6D, 576 },  /* 0000 0011 0110 1 */
+    { 13, 0x4A, 640 },  /* 0000 0010 0101 0 */
+    { 13, 0x4B, 704 },  /* 0000 0010 0101 1 */
+    { 13, 0x4C, 768 },  /* 0000 0010 0110 0 */
+    { 13, 0x4D, 832 },  /* 0000 0010 0110 1 */
+    { 13, 0x72, 896 },  /* 0000 0011 1001 0 */
+    { 13, 0x73, 960 },  /* 0000 0011 1001 1 */
+    { 13, 0x74, 1024 }, /* 0000 0011 1010 0 */
+    { 13, 0x75, 1088 }, /* 0000 0011 1010 1 */
+    { 13, 0x76, 1152 }, /* 0000 0011 1011 0 */
+    { 13, 0x77, 1216 }, /* 0000 0011 1011 1 */
+    { 13, 0x52, 1280 }, /* 0000 0010 1001 0 */
+    { 13, 0x53, 1344 }, /* 0000 0010 1001 1 */
+    { 13, 0x54, 1408 }, /* 0000 0010 1010 0 */
+    { 13, 0x55, 1472 }, /* 0000 0010 1010 1 */
+    { 13, 0x5A, 1536 }, /* 0000 0010 1101 0 */
+    { 13, 0x5B, 1600 }, /* 0000 0010 1101 1 */
+    { 13, 0x64, 1664 }, /* 0000 0011 0010 0 */
+    { 13, 0x65, 1728 }, /* 0000 0011 0010 1 */
+    { 11, 0x8, 1792 },  /* 0000 0001 000 */
+    { 11, 0xC, 1856 },  /* 0000 0001 100 */
+    { 11, 0xD, 1920 },  /* 0000 0001 101 */
+    { 12, 0x12, 1984 }, /* 0000 0001 0010 */
+    { 12, 0x13, 2048 }, /* 0000 0001 0011 */
+    { 12, 0x14, 2112 }, /* 0000 0001 0100 */
+    { 12, 0x15, 2176 }, /* 0000 0001 0101 */
+    { 12, 0x16, 2240 }, /* 0000 0001 0110 */
+    { 12, 0x17, 2304 }, /* 0000 0001 0111 */
+    { 12, 0x1C, 2368 }, /* 0000 0001 1100 */
+    { 12, 0x1D, 2432 }, /* 0000 0001 1101 */
+    { 12, 0x1E, 2496 }, /* 0000 0001 1110 */
+    { 12, 0x1F, 2560 }, /* 0000 0001 1111 */
+    { 12, 0x1, G3CODE_EOL },    /* 0000 0000 0001 */
+    { 9, 0x1, G3CODE_INVALID }, /* 0000 0000 1 */
+    { 10, 0x1, G3CODE_INVALID },        /* 0000 0000 01 */
+    { 11, 0x1, G3CODE_INVALID },        /* 0000 0000 001 */
+    { 12, 0x0, G3CODE_INVALID },        /* 0000 0000 0000 */
 };
 };
 #else
 #else
-extern	const tableentry TIFFFaxWhiteCodes[];
-extern	const tableentry TIFFFaxBlackCodes[];
+extern  const tableentry TIFFFaxWhiteCodes[];
+extern  const tableentry TIFFFaxBlackCodes[];
 #endif
 #endif
 #endif /* _T4_ */
 #endif /* _T4_ */

+ 166 - 166
panda/src/tiff/tif_dir.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _TIFFDIR_
 #ifndef _TIFFDIR_
-#define	_TIFFDIR_
+#define _TIFFDIR_
 /*
 /*
  * ``Library-private'' Directory-related Definitions.
  * ``Library-private'' Directory-related Definitions.
  */
  */
@@ -33,91 +33,91 @@
 /*
 /*
  * Internal format of a TIFF directory entry.
  * Internal format of a TIFF directory entry.
  */
  */
-typedef	struct {
-#define	FIELD_SETLONGS	3
-	/* bit vector of fields that are set */
-	u_long	td_fieldsset[FIELD_SETLONGS];
+typedef struct {
+#define FIELD_SETLONGS  3
+        /* bit vector of fields that are set */
+        u_long  td_fieldsset[FIELD_SETLONGS];
 
 
-	uint32	td_imagewidth, td_imagelength, td_imagedepth;
-	uint32	td_tilewidth, td_tilelength, td_tiledepth;
-	uint32	td_subfiletype;
-	uint16	td_bitspersample;
-	uint16	td_sampleformat;
-	uint16	td_compression;
-	uint16	td_photometric;
-	uint16	td_threshholding;
-	uint16	td_fillorder;
-	uint16	td_orientation;
-	uint16	td_samplesperpixel;
-	uint32	td_rowsperstrip;
-	uint16	td_minsamplevalue, td_maxsamplevalue;
-	double	td_sminsamplevalue, td_smaxsamplevalue;
-	float	td_xresolution, td_yresolution;
-	uint16	td_resolutionunit;
-	uint16	td_planarconfig;
-	float	td_xposition, td_yposition;
-	uint16	td_pagenumber[2];
-	uint16*	td_colormap[3];
-	uint16	td_halftonehints[2];
-	uint16	td_extrasamples;
-	uint16*	td_sampleinfo;
-	double	td_stonits;
-	char*	td_documentname;
-	char*	td_artist;
-	char*	td_datetime;
-	char*	td_hostcomputer;
-	char*	td_imagedescription;
-	char*	td_make;
-	char*	td_model;
-	char*	td_software;
-	char*	td_pagename;
-	tstrip_t td_stripsperimage;
-	tstrip_t td_nstrips;		/* size of offset & bytecount arrays */
-	uint32*	td_stripoffset;
-	uint32*	td_stripbytecount;
+        uint32  td_imagewidth, td_imagelength, td_imagedepth;
+        uint32  td_tilewidth, td_tilelength, td_tiledepth;
+        uint32  td_subfiletype;
+        uint16  td_bitspersample;
+        uint16  td_sampleformat;
+        uint16  td_compression;
+        uint16  td_photometric;
+        uint16  td_threshholding;
+        uint16  td_fillorder;
+        uint16  td_orientation;
+        uint16  td_samplesperpixel;
+        uint32  td_rowsperstrip;
+        uint16  td_minsamplevalue, td_maxsamplevalue;
+        double  td_sminsamplevalue, td_smaxsamplevalue;
+        float   td_xresolution, td_yresolution;
+        uint16  td_resolutionunit;
+        uint16  td_planarconfig;
+        float   td_xposition, td_yposition;
+        uint16  td_pagenumber[2];
+        uint16* td_colormap[3];
+        uint16  td_halftonehints[2];
+        uint16  td_extrasamples;
+        uint16* td_sampleinfo;
+        double  td_stonits;
+        char*   td_documentname;
+        char*   td_artist;
+        char*   td_datetime;
+        char*   td_hostcomputer;
+        char*   td_imagedescription;
+        char*   td_make;
+        char*   td_model;
+        char*   td_software;
+        char*   td_pagename;
+        tstrip_t td_stripsperimage;
+        tstrip_t td_nstrips;            /* size of offset & bytecount arrays */
+        uint32* td_stripoffset;
+        uint32* td_stripbytecount;
 #if SUBIFD_SUPPORT
 #if SUBIFD_SUPPORT
-	uint16	td_nsubifd;
-	uint32*	td_subifd;
+        uint16  td_nsubifd;
+        uint32* td_subifd;
 #endif
 #endif
 #ifdef YCBCR_SUPPORT
 #ifdef YCBCR_SUPPORT
-	float*	td_ycbcrcoeffs;
-	uint16	td_ycbcrsubsampling[2];
-	uint16	td_ycbcrpositioning;
+        float*  td_ycbcrcoeffs;
+        uint16  td_ycbcrsubsampling[2];
+        uint16  td_ycbcrpositioning;
 #endif
 #endif
 #ifdef COLORIMETRY_SUPPORT
 #ifdef COLORIMETRY_SUPPORT
-	float*	td_whitepoint;
-	float*	td_primarychromas;
-	float*	td_refblackwhite;
-	uint16*	td_transferfunction[3];
+        float*  td_whitepoint;
+        float*  td_primarychromas;
+        float*  td_refblackwhite;
+        uint16* td_transferfunction[3];
 #endif
 #endif
 #ifdef CMYK_SUPPORT
 #ifdef CMYK_SUPPORT
-	uint16	td_inkset;
-	uint16	td_ninks;
-	uint16	td_dotrange[2];
-	int	td_inknameslen;
-	char*	td_inknames;
-	char*	td_targetprinter;
+        uint16  td_inkset;
+        uint16  td_ninks;
+        uint16  td_dotrange[2];
+        int     td_inknameslen;
+        char*   td_inknames;
+        char*   td_targetprinter;
 #endif
 #endif
 #ifdef ICC_SUPPORT
 #ifdef ICC_SUPPORT
-	uint32	td_profileLength;
-	void	*td_profileData;
+        uint32  td_profileLength;
+        void    *td_profileData;
 #endif
 #endif
 #ifdef PHOTOSHOP_SUPPORT
 #ifdef PHOTOSHOP_SUPPORT
-	uint32	td_photoshopLength;
-	void	*td_photoshopData;
+        uint32  td_photoshopLength;
+        void    *td_photoshopData;
 #endif
 #endif
 #ifdef IPTC_SUPPORT
 #ifdef IPTC_SUPPORT
-	uint32	td_richtiffiptcLength;
-	void	*td_richtiffiptcData;
+        uint32  td_richtiffiptcLength;
+        void    *td_richtiffiptcData;
 #endif
 #endif
         /* Begin Pixar Tag values. */
         /* Begin Pixar Tag values. */
-        uint32	td_imagefullwidth, td_imagefulllength;
- 	char*	td_textureformat;
- 	char*	td_wrapmodes;
- 	float	td_fovcot;
- 	float*	td_matrixWorldToScreen;
- 	float*	td_matrixWorldToCamera;
- 	/* End Pixar Tag Values. */
+        uint32  td_imagefullwidth, td_imagefulllength;
+        char*   td_textureformat;
+        char*   td_wrapmodes;
+        float   td_fovcot;
+        float*  td_matrixWorldToScreen;
+        float*  td_matrixWorldToCamera;
+        /* End Pixar Tag Values. */
 } TIFFDirectory;
 } TIFFDirectory;
 
 
 /*
 /*
@@ -134,75 +134,75 @@ typedef	struct {
  * this is understood by the directory reading logic
  * this is understood by the directory reading logic
  * which uses this fact to avoid special-case handling
  * which uses this fact to avoid special-case handling
  */ 
  */ 
-#define	FIELD_IGNORE			0
+#define FIELD_IGNORE                    0
 
 
 /* multi-item fields */
 /* multi-item fields */
-#define	FIELD_IMAGEDIMENSIONS		1
-#define FIELD_TILEDIMENSIONS		2
-#define	FIELD_RESOLUTION		3
-#define	FIELD_POSITION			4
+#define FIELD_IMAGEDIMENSIONS           1
+#define FIELD_TILEDIMENSIONS            2
+#define FIELD_RESOLUTION                3
+#define FIELD_POSITION                  4
 
 
 /* single-item fields */
 /* single-item fields */
-#define	FIELD_SUBFILETYPE		5
-#define	FIELD_BITSPERSAMPLE		6
-#define	FIELD_COMPRESSION		7
-#define	FIELD_PHOTOMETRIC		8
-#define	FIELD_THRESHHOLDING		9
-#define	FIELD_FILLORDER			10
-#define	FIELD_DOCUMENTNAME		11
-#define	FIELD_IMAGEDESCRIPTION		12
-#define	FIELD_MAKE			13
-#define	FIELD_MODEL			14
-#define	FIELD_ORIENTATION		15
-#define	FIELD_SAMPLESPERPIXEL		16
-#define	FIELD_ROWSPERSTRIP		17
-#define	FIELD_MINSAMPLEVALUE		18
-#define	FIELD_MAXSAMPLEVALUE		19
-#define	FIELD_PLANARCONFIG		20
-#define	FIELD_PAGENAME			21
-#define	FIELD_RESOLUTIONUNIT		22
-#define	FIELD_PAGENUMBER		23
-#define	FIELD_STRIPBYTECOUNTS		24
-#define	FIELD_STRIPOFFSETS		25
-#define	FIELD_COLORMAP			26
-#define FIELD_ARTIST			27
-#define FIELD_DATETIME			28
-#define FIELD_HOSTCOMPUTER		29
-#define FIELD_SOFTWARE			30
-#define	FIELD_EXTRASAMPLES		31
-#define FIELD_SAMPLEFORMAT		32
-#define	FIELD_SMINSAMPLEVALUE		33
-#define	FIELD_SMAXSAMPLEVALUE		34
-#define FIELD_IMAGEDEPTH		35
-#define FIELD_TILEDEPTH			36
-#define	FIELD_HALFTONEHINTS		37
-#define FIELD_YCBCRCOEFFICIENTS		38
-#define FIELD_YCBCRSUBSAMPLING		39
-#define FIELD_YCBCRPOSITIONING		40
-#define	FIELD_REFBLACKWHITE		41
-#define	FIELD_WHITEPOINT		42
-#define	FIELD_PRIMARYCHROMAS		43
-#define	FIELD_TRANSFERFUNCTION		44
-#define	FIELD_INKSET			45
-#define	FIELD_INKNAMES			46
-#define	FIELD_DOTRANGE			47
-#define	FIELD_TARGETPRINTER		48
-#define	FIELD_SUBIFD			49
-#define	FIELD_NUMBEROFINKS		50
-#define FIELD_ICCPROFILE		51
-#define FIELD_PHOTOSHOP			52
-#define FIELD_RICHTIFFIPTC		53
-#define FIELD_STONITS			54
+#define FIELD_SUBFILETYPE               5
+#define FIELD_BITSPERSAMPLE             6
+#define FIELD_COMPRESSION               7
+#define FIELD_PHOTOMETRIC               8
+#define FIELD_THRESHHOLDING             9
+#define FIELD_FILLORDER                 10
+#define FIELD_DOCUMENTNAME              11
+#define FIELD_IMAGEDESCRIPTION          12
+#define FIELD_MAKE                      13
+#define FIELD_MODEL                     14
+#define FIELD_ORIENTATION               15
+#define FIELD_SAMPLESPERPIXEL           16
+#define FIELD_ROWSPERSTRIP              17
+#define FIELD_MINSAMPLEVALUE            18
+#define FIELD_MAXSAMPLEVALUE            19
+#define FIELD_PLANARCONFIG              20
+#define FIELD_PAGENAME                  21
+#define FIELD_RESOLUTIONUNIT            22
+#define FIELD_PAGENUMBER                23
+#define FIELD_STRIPBYTECOUNTS           24
+#define FIELD_STRIPOFFSETS              25
+#define FIELD_COLORMAP                  26
+#define FIELD_ARTIST                    27
+#define FIELD_DATETIME                  28
+#define FIELD_HOSTCOMPUTER              29
+#define FIELD_SOFTWARE                  30
+#define FIELD_EXTRASAMPLES              31
+#define FIELD_SAMPLEFORMAT              32
+#define FIELD_SMINSAMPLEVALUE           33
+#define FIELD_SMAXSAMPLEVALUE           34
+#define FIELD_IMAGEDEPTH                35
+#define FIELD_TILEDEPTH                 36
+#define FIELD_HALFTONEHINTS             37
+#define FIELD_YCBCRCOEFFICIENTS         38
+#define FIELD_YCBCRSUBSAMPLING          39
+#define FIELD_YCBCRPOSITIONING          40
+#define FIELD_REFBLACKWHITE             41
+#define FIELD_WHITEPOINT                42
+#define FIELD_PRIMARYCHROMAS            43
+#define FIELD_TRANSFERFUNCTION          44
+#define FIELD_INKSET                    45
+#define FIELD_INKNAMES                  46
+#define FIELD_DOTRANGE                  47
+#define FIELD_TARGETPRINTER             48
+#define FIELD_SUBIFD                    49
+#define FIELD_NUMBEROFINKS              50
+#define FIELD_ICCPROFILE                51
+#define FIELD_PHOTOSHOP                 52
+#define FIELD_RICHTIFFIPTC              53
+#define FIELD_STONITS                   54
 /* Begin PIXAR */
 /* Begin PIXAR */
-#define	FIELD_IMAGEFULLWIDTH		55
-#define	FIELD_IMAGEFULLLENGTH		56
-#define FIELD_TEXTUREFORMAT		57
-#define FIELD_WRAPMODES			58
-#define FIELD_FOVCOT			59
-#define FIELD_MATRIX_WORLDTOSCREEN	60
-#define FIELD_MATRIX_WORLDTOCAMERA	61
+#define FIELD_IMAGEFULLWIDTH            55
+#define FIELD_IMAGEFULLLENGTH           56
+#define FIELD_TEXTUREFORMAT             57
+#define FIELD_WRAPMODES                 58
+#define FIELD_FOVCOT                    59
+#define FIELD_MATRIX_WORLDTOSCREEN      60
+#define FIELD_MATRIX_WORLDTOCAMERA      61
 /* end of support for well-known tags; codec-private tags follow */
 /* end of support for well-known tags; codec-private tags follow */
-#define	FIELD_CODEC			62	/* base of codec-private tags */
+#define FIELD_CODEC                     62      /* base of codec-private tags */
 /*
 /*
  * Pseudo-tags don't normally need field bits since they
  * Pseudo-tags don't normally need field bits since they
  * are not written to an output file (by definition).
  * are not written to an output file (by definition).
@@ -213,55 +213,55 @@ typedef	struct {
  * do using internal state flags without polluting the
  * do using internal state flags without polluting the
  * field bit space defined for real tags.
  * field bit space defined for real tags.
  */
  */
-#define	FIELD_PSEUDO			0
+#define FIELD_PSEUDO                    0
 
 
-#define	FIELD_LAST			(32*FIELD_SETLONGS-1)
+#define FIELD_LAST                      (32*FIELD_SETLONGS-1)
 
 
-#define	TIFFExtractData(tif, type, v) \
+#define TIFFExtractData(tif, type, v) \
     ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
     ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
         ((v) >> (tif)->tif_typeshift[type]) & (tif)->tif_typemask[type] : \
         ((v) >> (tif)->tif_typeshift[type]) & (tif)->tif_typemask[type] : \
-	(v) & (tif)->tif_typemask[type]))
-#define	TIFFInsertData(tif, type, v) \
+        (v) & (tif)->tif_typemask[type]))
+#define TIFFInsertData(tif, type, v) \
     ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
     ((uint32) ((tif)->tif_header.tiff_magic == TIFF_BIGENDIAN ? \
         ((v) & (tif)->tif_typemask[type]) << (tif)->tif_typeshift[type] : \
         ((v) & (tif)->tif_typemask[type]) << (tif)->tif_typeshift[type] : \
-	(v) & (tif)->tif_typemask[type]))
+        (v) & (tif)->tif_typemask[type]))
 
 
-typedef	struct {
-	ttag_t	field_tag;		/* field's tag */
-	short	field_readcount;	/* read count/TIFF_VARIABLE/TIFF_SPP */
-	short	field_writecount;	/* write count/TIFF_VARIABLE */
-	TIFFDataType field_type;	/* type of associated data */
-	u_short	field_bit;		/* bit in fieldsset bit vector */
-	u_char	field_oktochange;	/* if true, can change while writing */
-	u_char	field_passcount;	/* if true, pass dir count on set */
-	char	*field_name;		/* ASCII name */
+typedef struct {
+        ttag_t  field_tag;              /* field's tag */
+        short   field_readcount;        /* read count/TIFF_VARIABLE/TIFF_SPP */
+        short   field_writecount;       /* write count/TIFF_VARIABLE */
+        TIFFDataType field_type;        /* type of associated data */
+        u_short field_bit;              /* bit in fieldsset bit vector */
+        u_char  field_oktochange;       /* if true, can change while writing */
+        u_char  field_passcount;        /* if true, pass dir count on set */
+        char    *field_name;            /* ASCII name */
 } TIFFFieldInfo;
 } TIFFFieldInfo;
 
 
-#define	TIFF_ANY	TIFF_NOTYPE	/* for field descriptor searching */
-#define	TIFF_VARIABLE	-1		/* marker for variable length tags */
-#define	TIFF_SPP	-2		/* marker for SamplesPerPixel tags */
-#define	TIFF_VARIABLE2	-3		/* marker for uint32 var-length tags */
+#define TIFF_ANY        TIFF_NOTYPE     /* for field descriptor searching */
+#define TIFF_VARIABLE   -1              /* marker for variable length tags */
+#define TIFF_SPP        -2              /* marker for SamplesPerPixel tags */
+#define TIFF_VARIABLE2  -3              /* marker for uint32 var-length tags */
 
 
-extern	const int tiffDataWidth[];	/* table of tag datatype widths */
+extern  const int tiffDataWidth[];      /* table of tag datatype widths */
 
 
-#define BITn(n)				(((u_long)1L)<<((n)&0x1f)) 
-#define BITFIELDn(tif, n)		((tif)->tif_dir.td_fieldsset[(n)/32]) 
-#define TIFFFieldSet(tif, field)	(BITFIELDn(tif, field) & BITn(field)) 
-#define TIFFSetFieldBit(tif, field)	(BITFIELDn(tif, field) |= BITn(field))
-#define TIFFClrFieldBit(tif, field)	(BITFIELDn(tif, field) &= ~BITn(field))
+#define BITn(n)                         (((u_long)1L)<<((n)&0x1f)) 
+#define BITFIELDn(tif, n)               ((tif)->tif_dir.td_fieldsset[(n)/32]) 
+#define TIFFFieldSet(tif, field)        (BITFIELDn(tif, field) & BITn(field)) 
+#define TIFFSetFieldBit(tif, field)     (BITFIELDn(tif, field) |= BITn(field))
+#define TIFFClrFieldBit(tif, field)     (BITFIELDn(tif, field) &= ~BITn(field))
 
 
-#define	FieldSet(fields, f)		(fields[(f)/32] & BITn(f))
-#define	ResetFieldBit(fields, f)	(fields[(f)/32] &= ~BITn(f))
+#define FieldSet(fields, f)             (fields[(f)/32] & BITn(f))
+#define ResetFieldBit(fields, f)        (fields[(f)/32] &= ~BITn(f))
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 extern "C" {
 extern "C" {
 #endif
 #endif
-extern	void _TIFFSetupFieldInfo(TIFF*);
-extern	void _TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
-extern	void _TIFFPrintFieldInfo(TIFF*, FILE*);
-extern	const TIFFFieldInfo* _TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
-extern	const TIFFFieldInfo* _TIFFFieldWithTag(TIFF*, ttag_t);
-extern	TIFFDataType _TIFFSampleToTagType(TIFF*);
+extern  void _TIFFSetupFieldInfo(TIFF*);
+extern  void _TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], int);
+extern  void _TIFFPrintFieldInfo(TIFF*, FILE*);
+extern  const TIFFFieldInfo* _TIFFFindFieldInfo(TIFF*, ttag_t, TIFFDataType);
+extern  const TIFFFieldInfo* _TIFFFieldWithTag(TIFF*, ttag_t);
+extern  TIFFDataType _TIFFSampleToTagType(TIFF*);
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 }
 }
 #endif
 #endif

+ 328 - 328
panda/src/tiff/tif_fax3.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _FAX3_
 #ifndef _FAX3_
-#define	_FAX3_
+#define _FAX3_
 /*
 /*
  * TIFF Library.
  * TIFF Library.
  *
  *
@@ -52,7 +52,7 @@
  * data in the run array as needed (e.g. to append zero runs to bring
  * data in the run array as needed (e.g. to append zero runs to bring
  * the count up to a nice multiple).
  * the count up to a nice multiple).
  */
  */
-typedef	void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
+typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
 
 
 /*
 /*
  * The default run filler; made external for other decoders.
  * The default run filler; made external for other decoders.
@@ -60,36 +60,36 @@ typedef	void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 extern "C" {
 extern "C" {
 #endif
 #endif
-extern	void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
+extern  void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 }
 }
 #endif
 #endif
 
 
 
 
 /* finite state machine codes */
 /* finite state machine codes */
-#define S_Null		0
-#define S_Pass		1
-#define S_Horiz		2
-#define S_V0		3
-#define S_VR		4
-#define S_VL		5
-#define S_Ext		6
-#define S_TermW		7
-#define S_TermB		8
-#define S_MakeUpW	9
-#define S_MakeUpB	10
-#define S_MakeUp	11
-#define S_EOL		12
+#define S_Null          0
+#define S_Pass          1
+#define S_Horiz         2
+#define S_V0            3
+#define S_VR            4
+#define S_VL            5
+#define S_Ext           6
+#define S_TermW         7
+#define S_TermB         8
+#define S_MakeUpW       9
+#define S_MakeUpB       10
+#define S_MakeUp        11
+#define S_EOL           12
 
 
-typedef struct {		/* state table entry */
-	unsigned char State;	/* see above */
-	unsigned char Width;	/* width of code in bits */
-	uint32	Param;		/* unsigned 32-bit run length in bits */
+typedef struct {                /* state table entry */
+        unsigned char State;    /* see above */
+        unsigned char Width;    /* width of code in bits */
+        uint32  Param;          /* unsigned 32-bit run length in bits */
 } TIFFFaxTabEnt;
 } TIFFFaxTabEnt;
 
 
-extern	const TIFFFaxTabEnt TIFFFaxMainTable[];
-extern	const TIFFFaxTabEnt TIFFFaxWhiteTable[];
-extern	const TIFFFaxTabEnt TIFFFaxBlackTable[];
+extern  const TIFFFaxTabEnt TIFFFaxMainTable[];
+extern  const TIFFFaxTabEnt TIFFFaxWhiteTable[];
+extern  const TIFFFaxTabEnt TIFFFaxBlackTable[];
 
 
 /*
 /*
  * The following macros define the majority of the G3/G4 decoder
  * The following macros define the majority of the G3/G4 decoder
@@ -108,7 +108,7 @@ extern	const TIFFFaxTabEnt TIFFFaxBlackTable[];
  */
  */
 
 
 #ifndef EndOfData
 #ifndef EndOfData
-#define EndOfData()	(cp >= ep)
+#define EndOfData()     (cp >= ep)
 #endif
 #endif
 /*
 /*
  * Need <=8 or <=16 bits of input data.  Unlike viewfax we
  * Need <=8 or <=16 bits of input data.  Unlike viewfax we
@@ -134,45 +134,45 @@ extern	const TIFFFaxTabEnt TIFFFaxBlackTable[];
  * otherwise we should get the right answer.
  * otherwise we should get the right answer.
  */
  */
 #ifndef NeedBits8
 #ifndef NeedBits8
-#define NeedBits8(n,eoflab) do {					\
-    if (BitsAvail < (n)) {						\
-	if (EndOfData()) {						\
-	    if (BitsAvail == 0)			/* no valid bits */	\
-		goto eoflab;						\
-	    BitsAvail = (n);			/* pad with zeros */	\
-	} else {							\
-	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
-	    BitsAvail += 8;						\
-	}								\
-    }									\
+#define NeedBits8(n,eoflab) do {                                        \
+    if (BitsAvail < (n)) {                                              \
+        if (EndOfData()) {                                              \
+            if (BitsAvail == 0)                 /* no valid bits */     \
+                goto eoflab;                                            \
+            BitsAvail = (n);                    /* pad with zeros */    \
+        } else {                                                        \
+            BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;              \
+            BitsAvail += 8;                                             \
+        }                                                               \
+    }                                                                   \
 } while (0)
 } while (0)
 #endif
 #endif
 #ifndef NeedBits16
 #ifndef NeedBits16
-#define NeedBits16(n,eoflab) do {					\
-    if (BitsAvail < (n)) {						\
-	if (EndOfData()) {						\
-	    if (BitsAvail == 0)			/* no valid bits */	\
-		goto eoflab;						\
-	    BitsAvail = (n);			/* pad with zeros */	\
-	} else {							\
-	    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;		\
-	    if ((BitsAvail += 8) < (n)) {				\
-		if (EndOfData()) {					\
-		    /* NB: we know BitsAvail is non-zero here */	\
-		    BitsAvail = (n);		/* pad with zeros */	\
-		} else {						\
-		    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;	\
-		    BitsAvail += 8;					\
-		}							\
-	    }								\
-	}								\
-    }									\
+#define NeedBits16(n,eoflab) do {                                       \
+    if (BitsAvail < (n)) {                                              \
+        if (EndOfData()) {                                              \
+            if (BitsAvail == 0)                 /* no valid bits */     \
+                goto eoflab;                                            \
+            BitsAvail = (n);                    /* pad with zeros */    \
+        } else {                                                        \
+            BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;              \
+            if ((BitsAvail += 8) < (n)) {                               \
+                if (EndOfData()) {                                      \
+                    /* NB: we know BitsAvail is non-zero here */        \
+                    BitsAvail = (n);            /* pad with zeros */    \
+                } else {                                                \
+                    BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail;      \
+                    BitsAvail += 8;                                     \
+                }                                                       \
+            }                                                           \
+        }                                                               \
+    }                                                                   \
 } while (0)
 } while (0)
 #endif
 #endif
-#define GetBits(n)	(BitAcc & ((1<<(n))-1))
-#define ClrBits(n) do {							\
-    BitsAvail -= (n);							\
-    BitAcc >>= (n);							\
+#define GetBits(n)      (BitAcc & ((1<<(n))-1))
+#define ClrBits(n) do {                                                 \
+    BitsAvail -= (n);                                                   \
+    BitAcc >>= (n);                                                     \
 } while (0)
 } while (0)
 
 
 #ifdef FAX3_DEBUG
 #ifdef FAX3_DEBUG
@@ -192,57 +192,57 @@ static const char* StateNames[] = {
     "EOL    ",
     "EOL    ",
 };
 };
 #define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0')
 #define DEBUG_SHOW putchar(BitAcc & (1 << t) ? '1' : '0')
-#define LOOKUP8(wid,tab,eoflab) do {					\
-    int t;								\
-    NeedBits8(wid,eoflab);						\
-    TabEnt = tab + GetBits(wid);					\
-    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
-	   StateNames[TabEnt->State], TabEnt->Param);			\
-    for (t = 0; t < TabEnt->Width; t++)					\
-	DEBUG_SHOW;							\
-    putchar('\n');							\
-    fflush(stdout);							\
-    ClrBits(TabEnt->Width);						\
+#define LOOKUP8(wid,tab,eoflab) do {                                    \
+    int t;                                                              \
+    NeedBits8(wid,eoflab);                                              \
+    TabEnt = tab + GetBits(wid);                                        \
+    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,               \
+           StateNames[TabEnt->State], TabEnt->Param);                   \
+    for (t = 0; t < TabEnt->Width; t++)                                 \
+        DEBUG_SHOW;                                                     \
+    putchar('\n');                                                      \
+    fflush(stdout);                                                     \
+    ClrBits(TabEnt->Width);                                             \
 } while (0)
 } while (0)
-#define LOOKUP16(wid,tab,eoflab) do {					\
-    int t;								\
-    NeedBits16(wid,eoflab);						\
-    TabEnt = tab + GetBits(wid);					\
-    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,		\
-	   StateNames[TabEnt->State], TabEnt->Param);			\
-    for (t = 0; t < TabEnt->Width; t++)					\
-	DEBUG_SHOW;							\
-    putchar('\n');							\
-    fflush(stdout);							\
-    ClrBits(TabEnt->Width);						\
+#define LOOKUP16(wid,tab,eoflab) do {                                   \
+    int t;                                                              \
+    NeedBits16(wid,eoflab);                                             \
+    TabEnt = tab + GetBits(wid);                                        \
+    printf("%08lX/%d: %s%5d\t", (long) BitAcc, BitsAvail,               \
+           StateNames[TabEnt->State], TabEnt->Param);                   \
+    for (t = 0; t < TabEnt->Width; t++)                                 \
+        DEBUG_SHOW;                                                     \
+    putchar('\n');                                                      \
+    fflush(stdout);                                                     \
+    ClrBits(TabEnt->Width);                                             \
 } while (0)
 } while (0)
 
 
-#define SETVAL(x) do {							\
-    *pa++ = RunLength + (x);						\
-    printf("SETVAL: %d\t%d\n", RunLength + (x), a0);			\
-    a0 += x;								\
-    RunLength = 0;							\
+#define SETVAL(x) do {                                                  \
+    *pa++ = RunLength + (x);                                            \
+    printf("SETVAL: %d\t%d\n", RunLength + (x), a0);                    \
+    a0 += x;                                                            \
+    RunLength = 0;                                                      \
 } while (0)
 } while (0)
 #else
 #else
-#define LOOKUP8(wid,tab,eoflab) do {					\
-    NeedBits8(wid,eoflab);						\
-    TabEnt = tab + GetBits(wid);					\
-    ClrBits(TabEnt->Width);						\
+#define LOOKUP8(wid,tab,eoflab) do {                                    \
+    NeedBits8(wid,eoflab);                                              \
+    TabEnt = tab + GetBits(wid);                                        \
+    ClrBits(TabEnt->Width);                                             \
 } while (0)
 } while (0)
-#define LOOKUP16(wid,tab,eoflab) do {					\
-    NeedBits16(wid,eoflab);						\
-    TabEnt = tab + GetBits(wid);					\
-    ClrBits(TabEnt->Width);						\
+#define LOOKUP16(wid,tab,eoflab) do {                                   \
+    NeedBits16(wid,eoflab);                                             \
+    TabEnt = tab + GetBits(wid);                                        \
+    ClrBits(TabEnt->Width);                                             \
 } while (0)
 } while (0)
 
 
 /*
 /*
  * Append a run to the run length array for the
  * Append a run to the run length array for the
  * current row and reset decoding state.
  * current row and reset decoding state.
  */
  */
-#define SETVAL(x) do {							\
-    *pa++ = RunLength + (x);						\
-    a0 += (x);								\
-    RunLength = 0;							\
+#define SETVAL(x) do {                                                  \
+    *pa++ = RunLength + (x);                                            \
+    a0 += (x);                                                          \
+    RunLength = 0;                                                      \
 } while (0)
 } while (0)
 #endif
 #endif
 
 
@@ -256,25 +256,25 @@ static const char* StateNames[] = {
  * is non-zero then we still need to scan for the final flag
  * is non-zero then we still need to scan for the final flag
  * bit that is part of the EOL code.
  * bit that is part of the EOL code.
  */
  */
-#define	SYNC_EOL(eoflab) do {						\
-    if (EOLcnt == 0) {							\
-	for (;;) {							\
-	    NeedBits16(11,eoflab);					\
-	    if (GetBits(11) == 0)					\
-		break;							\
-	    ClrBits(1);							\
-	}								\
-    }									\
-    for (;;) {								\
-	NeedBits8(8,eoflab);						\
-	if (GetBits(8))							\
-	    break;							\
-	ClrBits(8);							\
-    }									\
-    while (GetBits(1) == 0)						\
-	ClrBits(1);							\
-    ClrBits(1);				/* EOL bit */			\
-    EOLcnt = 0;				/* reset EOL counter/flag */	\
+#define SYNC_EOL(eoflab) do {                                           \
+    if (EOLcnt == 0) {                                                  \
+        for (;;) {                                                      \
+            NeedBits16(11,eoflab);                                      \
+            if (GetBits(11) == 0)                                       \
+                break;                                                  \
+            ClrBits(1);                                                 \
+        }                                                               \
+    }                                                                   \
+    for (;;) {                                                          \
+        NeedBits8(8,eoflab);                                            \
+        if (GetBits(8))                                                 \
+            break;                                                      \
+        ClrBits(8);                                                     \
+    }                                                                   \
+    while (GetBits(1) == 0)                                             \
+        ClrBits(1);                                                     \
+    ClrBits(1);                         /* EOL bit */                   \
+    EOLcnt = 0;                         /* reset EOL counter/flag */    \
 } while (0)
 } while (0)
 
 
 /*
 /*
@@ -282,24 +282,24 @@ static const char* StateNames[] = {
  * We adjust final runs to insure the user buffer is not
  * We adjust final runs to insure the user buffer is not
  * overwritten and/or undecoded area is white filled.
  * overwritten and/or undecoded area is white filled.
  */
  */
-#define	CLEANUP_RUNS() do {						\
-    if (RunLength)							\
-	SETVAL(0);							\
-    if (a0 != lastx) {							\
-	badlength(a0, lastx);						\
-	while (a0 > lastx && pa > thisrun)				\
-	    a0 -= *--pa;						\
-	if (a0 < lastx) {						\
-	    if (a0 < 0)							\
-		a0 = 0;							\
-	    if ((pa-thisrun)&1)						\
-		SETVAL(0);						\
-	    SETVAL(lastx - a0);						\
-	} else if (a0 > lastx) {					\
-	    SETVAL(lastx);						\
-	    SETVAL(0);							\
-	}								\
-    }									\
+#define CLEANUP_RUNS() do {                                             \
+    if (RunLength)                                                      \
+        SETVAL(0);                                                      \
+    if (a0 != lastx) {                                                  \
+        badlength(a0, lastx);                                           \
+        while (a0 > lastx && pa > thisrun)                              \
+            a0 -= *--pa;                                                \
+        if (a0 < lastx) {                                               \
+            if (a0 < 0)                                                 \
+                a0 = 0;                                                 \
+            if ((pa-thisrun)&1)                                         \
+                SETVAL(0);                                              \
+            SETVAL(lastx - a0);                                         \
+        } else if (a0 > lastx) {                                        \
+            SETVAL(lastx);                                              \
+            SETVAL(0);                                                  \
+        }                                                               \
+    }                                                                   \
 } while (0)
 } while (0)
 
 
 /*
 /*
@@ -314,212 +314,212 @@ static const char* StateNames[] = {
  * the original code depended on the input data being zero-padded to
  * the original code depended on the input data being zero-padded to
  * insure the decoder recognized an EOL before running out of data.
  * insure the decoder recognized an EOL before running out of data.
  */
  */
-#define EXPAND1D(eoflab) do {						\
-    for (;;) {								\
-	for (;;) {							\
-	    LOOKUP16(12, TIFFFaxWhiteTable, eof1d);			\
-	    switch (TabEnt->State) {					\
-	    case S_EOL:							\
-		EOLcnt = 1;						\
-		goto done1d;						\
-	    case S_TermW:						\
-		SETVAL(TabEnt->Param);					\
-		goto doneWhite1d;					\
-	    case S_MakeUpW:						\
-	    case S_MakeUp:						\
-		a0 += TabEnt->Param;					\
-		RunLength += TabEnt->Param;				\
-		break;							\
-	    default:							\
-		unexpected("WhiteTable", a0);				\
-		goto done1d;						\
-	    }								\
-	}								\
-    doneWhite1d:							\
-	if (a0 >= lastx)						\
-	    goto done1d;						\
-	for (;;) {							\
-	    LOOKUP16(13, TIFFFaxBlackTable, eof1d);			\
-	    switch (TabEnt->State) {					\
-	    case S_EOL:							\
-		EOLcnt = 1;						\
-		goto done1d;						\
-	    case S_TermB:						\
-		SETVAL(TabEnt->Param);					\
-		goto doneBlack1d;					\
-	    case S_MakeUpB:						\
-	    case S_MakeUp:						\
-		a0 += TabEnt->Param;					\
-		RunLength += TabEnt->Param;				\
-		break;							\
-	    default:							\
-		unexpected("BlackTable", a0);				\
-		goto done1d;						\
-	    }								\
-	}								\
-    doneBlack1d:							\
-	if (a0 >= lastx)						\
-	    goto done1d;						\
-        if( *(pa-1) == 0 && *(pa-2) == 0 )				\
+#define EXPAND1D(eoflab) do {                                           \
+    for (;;) {                                                          \
+        for (;;) {                                                      \
+            LOOKUP16(12, TIFFFaxWhiteTable, eof1d);                     \
+            switch (TabEnt->State) {                                    \
+            case S_EOL:                                                 \
+                EOLcnt = 1;                                             \
+                goto done1d;                                            \
+            case S_TermW:                                               \
+                SETVAL(TabEnt->Param);                                  \
+                goto doneWhite1d;                                       \
+            case S_MakeUpW:                                             \
+            case S_MakeUp:                                              \
+                a0 += TabEnt->Param;                                    \
+                RunLength += TabEnt->Param;                             \
+                break;                                                  \
+            default:                                                    \
+                unexpected("WhiteTable", a0);                           \
+                goto done1d;                                            \
+            }                                                           \
+        }                                                               \
+    doneWhite1d:                                                        \
+        if (a0 >= lastx)                                                \
+            goto done1d;                                                \
+        for (;;) {                                                      \
+            LOOKUP16(13, TIFFFaxBlackTable, eof1d);                     \
+            switch (TabEnt->State) {                                    \
+            case S_EOL:                                                 \
+                EOLcnt = 1;                                             \
+                goto done1d;                                            \
+            case S_TermB:                                               \
+                SETVAL(TabEnt->Param);                                  \
+                goto doneBlack1d;                                       \
+            case S_MakeUpB:                                             \
+            case S_MakeUp:                                              \
+                a0 += TabEnt->Param;                                    \
+                RunLength += TabEnt->Param;                             \
+                break;                                                  \
+            default:                                                    \
+                unexpected("BlackTable", a0);                           \
+                goto done1d;                                            \
+            }                                                           \
+        }                                                               \
+    doneBlack1d:                                                        \
+        if (a0 >= lastx)                                                \
+            goto done1d;                                                \
+        if( *(pa-1) == 0 && *(pa-2) == 0 )                              \
             pa -= 2;                                                    \
             pa -= 2;                                                    \
-    }									\
-eof1d:									\
-    prematureEOF(a0);							\
-    CLEANUP_RUNS();							\
-    goto eoflab;							\
-done1d:									\
-    CLEANUP_RUNS();							\
+    }                                                                   \
+eof1d:                                                                  \
+    prematureEOF(a0);                                                   \
+    CLEANUP_RUNS();                                                     \
+    goto eoflab;                                                        \
+done1d:                                                                 \
+    CLEANUP_RUNS();                                                     \
 } while (0)
 } while (0)
 
 
 /*
 /*
  * Update the value of b1 using the array
  * Update the value of b1 using the array
  * of runs for the reference line.
  * of runs for the reference line.
  */
  */
-#define CHECK_b1 do {							\
-    if (pa != thisrun) while (b1 <= a0 && b1 < lastx) {			\
-	b1 += pb[0] + pb[1];						\
-	pb += 2;							\
-    }									\
+#define CHECK_b1 do {                                                   \
+    if (pa != thisrun) while (b1 <= a0 && b1 < lastx) {                 \
+        b1 += pb[0] + pb[1];                                            \
+        pb += 2;                                                        \
+    }                                                                   \
 } while (0)
 } while (0)
 
 
 /*
 /*
  * Expand a row of 2D-encoded data.
  * Expand a row of 2D-encoded data.
  */
  */
-#define EXPAND2D(eoflab) do {						\
-    while (a0 < lastx) {						\
-	LOOKUP8(7, TIFFFaxMainTable, eof2d);				\
-	switch (TabEnt->State) {					\
-	case S_Pass:							\
-	    CHECK_b1;							\
-	    b1 += *pb++;						\
-	    RunLength += b1 - a0;					\
-	    a0 = b1;							\
-	    b1 += *pb++;						\
-	    break;							\
-	case S_Horiz:							\
-	    if ((pa-thisrun)&1) {					\
-		for (;;) {	/* black first */			\
-		    LOOKUP16(13, TIFFFaxBlackTable, eof2d);		\
-		    switch (TabEnt->State) {				\
-		    case S_TermB:					\
-			SETVAL(TabEnt->Param);				\
-			goto doneWhite2da;				\
-		    case S_MakeUpB:					\
-		    case S_MakeUp:					\
-			a0 += TabEnt->Param;				\
-			RunLength += TabEnt->Param;			\
-			break;						\
-		    default:						\
-			goto badBlack2d;				\
-		    }							\
-		}							\
-	    doneWhite2da:;						\
-		for (;;) {	/* then white */			\
-		    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);		\
-		    switch (TabEnt->State) {				\
-		    case S_TermW:					\
-			SETVAL(TabEnt->Param);				\
-			goto doneBlack2da;				\
-		    case S_MakeUpW:					\
-		    case S_MakeUp:					\
-			a0 += TabEnt->Param;				\
-			RunLength += TabEnt->Param;			\
-			break;						\
-		    default:						\
-			goto badWhite2d;				\
-		    }							\
-		}							\
-	    doneBlack2da:;						\
-	    } else {							\
-		for (;;) {	/* white first */			\
-		    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);		\
-		    switch (TabEnt->State) {				\
-		    case S_TermW:					\
-			SETVAL(TabEnt->Param);				\
-			goto doneWhite2db;				\
-		    case S_MakeUpW:					\
-		    case S_MakeUp:					\
-			a0 += TabEnt->Param;				\
-			RunLength += TabEnt->Param;			\
-			break;						\
-		    default:						\
-			goto badWhite2d;				\
-		    }							\
-		}							\
-	    doneWhite2db:;						\
-		for (;;) {	/* then black */			\
-		    LOOKUP16(13, TIFFFaxBlackTable, eof2d);		\
-		    switch (TabEnt->State) {				\
-		    case S_TermB:					\
-			SETVAL(TabEnt->Param);				\
-			goto doneBlack2db;				\
-		    case S_MakeUpB:					\
-		    case S_MakeUp:					\
-			a0 += TabEnt->Param;				\
-			RunLength += TabEnt->Param;			\
-			break;						\
-		    default:						\
-			goto badBlack2d;				\
-		    }							\
-		}							\
-	    doneBlack2db:;						\
-	    }								\
-	    CHECK_b1;							\
-	    break;							\
-	case S_V0:							\
-	    CHECK_b1;							\
-	    SETVAL(b1 - a0);						\
-	    b1 += *pb++;						\
-	    break;							\
-	case S_VR:							\
-	    CHECK_b1;							\
-	    SETVAL(b1 - a0 + TabEnt->Param);				\
-	    b1 += *pb++;						\
-	    break;							\
-	case S_VL:							\
-	    CHECK_b1;							\
-	    SETVAL(b1 - a0 - TabEnt->Param);				\
-	    b1 -= *--pb;						\
-	    break;							\
-	case S_Ext:							\
-	    *pa++ = lastx - a0;						\
-	    extension(a0);						\
-	    goto eol2d;							\
-	case S_EOL:							\
-	    *pa++ = lastx - a0;						\
-	    NeedBits8(4,eof2d);						\
-	    if (GetBits(4))						\
-		unexpected("EOL", a0);					\
+#define EXPAND2D(eoflab) do {                                           \
+    while (a0 < lastx) {                                                \
+        LOOKUP8(7, TIFFFaxMainTable, eof2d);                            \
+        switch (TabEnt->State) {                                        \
+        case S_Pass:                                                    \
+            CHECK_b1;                                                   \
+            b1 += *pb++;                                                \
+            RunLength += b1 - a0;                                       \
+            a0 = b1;                                                    \
+            b1 += *pb++;                                                \
+            break;                                                      \
+        case S_Horiz:                                                   \
+            if ((pa-thisrun)&1) {                                       \
+                for (;;) {      /* black first */                       \
+                    LOOKUP16(13, TIFFFaxBlackTable, eof2d);             \
+                    switch (TabEnt->State) {                            \
+                    case S_TermB:                                       \
+                        SETVAL(TabEnt->Param);                          \
+                        goto doneWhite2da;                              \
+                    case S_MakeUpB:                                     \
+                    case S_MakeUp:                                      \
+                        a0 += TabEnt->Param;                            \
+                        RunLength += TabEnt->Param;                     \
+                        break;                                          \
+                    default:                                            \
+                        goto badBlack2d;                                \
+                    }                                                   \
+                }                                                       \
+            doneWhite2da:;                                              \
+                for (;;) {      /* then white */                        \
+                    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);             \
+                    switch (TabEnt->State) {                            \
+                    case S_TermW:                                       \
+                        SETVAL(TabEnt->Param);                          \
+                        goto doneBlack2da;                              \
+                    case S_MakeUpW:                                     \
+                    case S_MakeUp:                                      \
+                        a0 += TabEnt->Param;                            \
+                        RunLength += TabEnt->Param;                     \
+                        break;                                          \
+                    default:                                            \
+                        goto badWhite2d;                                \
+                    }                                                   \
+                }                                                       \
+            doneBlack2da:;                                              \
+            } else {                                                    \
+                for (;;) {      /* white first */                       \
+                    LOOKUP16(12, TIFFFaxWhiteTable, eof2d);             \
+                    switch (TabEnt->State) {                            \
+                    case S_TermW:                                       \
+                        SETVAL(TabEnt->Param);                          \
+                        goto doneWhite2db;                              \
+                    case S_MakeUpW:                                     \
+                    case S_MakeUp:                                      \
+                        a0 += TabEnt->Param;                            \
+                        RunLength += TabEnt->Param;                     \
+                        break;                                          \
+                    default:                                            \
+                        goto badWhite2d;                                \
+                    }                                                   \
+                }                                                       \
+            doneWhite2db:;                                              \
+                for (;;) {      /* then black */                        \
+                    LOOKUP16(13, TIFFFaxBlackTable, eof2d);             \
+                    switch (TabEnt->State) {                            \
+                    case S_TermB:                                       \
+                        SETVAL(TabEnt->Param);                          \
+                        goto doneBlack2db;                              \
+                    case S_MakeUpB:                                     \
+                    case S_MakeUp:                                      \
+                        a0 += TabEnt->Param;                            \
+                        RunLength += TabEnt->Param;                     \
+                        break;                                          \
+                    default:                                            \
+                        goto badBlack2d;                                \
+                    }                                                   \
+                }                                                       \
+            doneBlack2db:;                                              \
+            }                                                           \
+            CHECK_b1;                                                   \
+            break;                                                      \
+        case S_V0:                                                      \
+            CHECK_b1;                                                   \
+            SETVAL(b1 - a0);                                            \
+            b1 += *pb++;                                                \
+            break;                                                      \
+        case S_VR:                                                      \
+            CHECK_b1;                                                   \
+            SETVAL(b1 - a0 + TabEnt->Param);                            \
+            b1 += *pb++;                                                \
+            break;                                                      \
+        case S_VL:                                                      \
+            CHECK_b1;                                                   \
+            SETVAL(b1 - a0 - TabEnt->Param);                            \
+            b1 -= *--pb;                                                \
+            break;                                                      \
+        case S_Ext:                                                     \
+            *pa++ = lastx - a0;                                         \
+            extension(a0);                                              \
+            goto eol2d;                                                 \
+        case S_EOL:                                                     \
+            *pa++ = lastx - a0;                                         \
+            NeedBits8(4,eof2d);                                         \
+            if (GetBits(4))                                             \
+                unexpected("EOL", a0);                                  \
             ClrBits(4);                                                 \
             ClrBits(4);                                                 \
-	    EOLcnt = 1;							\
-	    goto eol2d;							\
-	default:							\
-	badMain2d:							\
-	    unexpected("MainTable", a0);				\
-	    goto eol2d;							\
-	badBlack2d:							\
-	    unexpected("BlackTable", a0);				\
-	    goto eol2d;							\
-	badWhite2d:							\
-	    unexpected("WhiteTable", a0);				\
-	    goto eol2d;							\
-	eof2d:								\
-	    prematureEOF(a0);						\
-	    CLEANUP_RUNS();						\
-	    goto eoflab;						\
-	}								\
-    }									\
-    if (RunLength) {							\
-	if (RunLength + a0 < lastx) {					\
-	    /* expect a final V0 */					\
-	    NeedBits8(1,eof2d);						\
-	    if (!GetBits(1))						\
-		goto badMain2d;						\
-	    ClrBits(1);							\
-	}								\
-	SETVAL(0);							\
-    }									\
-eol2d:									\
-    CLEANUP_RUNS();							\
+            EOLcnt = 1;                                                 \
+            goto eol2d;                                                 \
+        default:                                                        \
+        badMain2d:                                                      \
+            unexpected("MainTable", a0);                                \
+            goto eol2d;                                                 \
+        badBlack2d:                                                     \
+            unexpected("BlackTable", a0);                               \
+            goto eol2d;                                                 \
+        badWhite2d:                                                     \
+            unexpected("WhiteTable", a0);                               \
+            goto eol2d;                                                 \
+        eof2d:                                                          \
+            prematureEOF(a0);                                           \
+            CLEANUP_RUNS();                                             \
+            goto eoflab;                                                \
+        }                                                               \
+    }                                                                   \
+    if (RunLength) {                                                    \
+        if (RunLength + a0 < lastx) {                                   \
+            /* expect a final V0 */                                     \
+            NeedBits8(1,eof2d);                                         \
+            if (!GetBits(1))                                            \
+                goto badMain2d;                                         \
+            ClrBits(1);                                                 \
+        }                                                               \
+        SETVAL(0);                                                      \
+    }                                                                   \
+eol2d:                                                                  \
+    CLEANUP_RUNS();                                                     \
 } while (0)
 } while (0)
 #endif /* _FAX3_ */
 #endif /* _FAX3_ */

+ 14 - 14
panda/src/tiff/tif_predict.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _TIFFPREDICT_
 #ifndef _TIFFPREDICT_
-#define	_TIFFPREDICT_
+#define _TIFFPREDICT_
 /*
 /*
  * ``Library-private'' Support for the Predictor Tag
  * ``Library-private'' Support for the Predictor Tag
  */
  */
@@ -36,25 +36,25 @@
  * the predictor code can cast tif_data to find its state.
  * the predictor code can cast tif_data to find its state.
  */
  */
 typedef struct {
 typedef struct {
-	int	predictor;		/* predictor tag value */
-	int	stride;			/* sample stride over data */
-	tsize_t	rowsize;		/* tile/strip row size */
+        int     predictor;              /* predictor tag value */
+        int     stride;                 /* sample stride over data */
+        tsize_t rowsize;                /* tile/strip row size */
 
 
-	TIFFPostMethod	pfunc;		/* horizontal differencer/accumulator */
-	TIFFCodeMethod	coderow;	/* parent codec encode/decode row */
-	TIFFCodeMethod	codestrip;	/* parent codec encode/decode strip */
-	TIFFCodeMethod	codetile;	/* parent codec encode/decode tile */
-	TIFFVGetMethod	vgetparent;	/* super-class method */
-	TIFFVSetMethod	vsetparent;	/* super-class method */
-	TIFFPrintMethod	printdir;	/* super-class method */
-	TIFFBoolMethod	setupdecode;	/* super-class method */
-	TIFFBoolMethod	setupencode;	/* super-class method */
+        TIFFPostMethod  pfunc;          /* horizontal differencer/accumulator */
+        TIFFCodeMethod  coderow;        /* parent codec encode/decode row */
+        TIFFCodeMethod  codestrip;      /* parent codec encode/decode strip */
+        TIFFCodeMethod  codetile;       /* parent codec encode/decode tile */
+        TIFFVGetMethod  vgetparent;     /* super-class method */
+        TIFFVSetMethod  vsetparent;     /* super-class method */
+        TIFFPrintMethod printdir;       /* super-class method */
+        TIFFBoolMethod  setupdecode;    /* super-class method */
+        TIFFBoolMethod  setupencode;    /* super-class method */
 } TIFFPredictorState;
 } TIFFPredictorState;
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 extern "C" {
 extern "C" {
 #endif
 #endif
-extern	int TIFFPredictorInit(TIFF*);
+extern  int TIFFPredictorInit(TIFF*);
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 }
 }
 #endif
 #endif

+ 28 - 28
panda/src/tiff/tiffcomp.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _COMPAT_
 #ifndef _COMPAT_
-#define	_COMPAT_
+#define _COMPAT_
 /*
 /*
  * This file contains a hodgepodge of definitions and
  * This file contains a hodgepodge of definitions and
  * declarations that are needed to provide compatibility
  * declarations that are needed to provide compatibility
@@ -81,20 +81,20 @@
  */
  */
 #if defined(__MWERKS__) || defined(THINK_C) || defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
 #if defined(__MWERKS__) || defined(THINK_C) || defined(__PPCC__) || defined(__SC__) || defined(__MRC__)
 #include <stdlib.h>
 #include <stdlib.h>
-#define	BSDTYPES
-#define	HAVE_UNISTD_H	0
+#define BSDTYPES
+#define HAVE_UNISTD_H   0
 #elif (defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) || defined(_WIN32)) && !defined(unix)
 #elif (defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows) || defined(_WIN32)) && !defined(unix)
-#define	BSDTYPES
+#define BSDTYPES
 #elif defined(OS2_16) || defined(OS2_32)
 #elif defined(OS2_16) || defined(OS2_32)
-#define	BSDTYPES
+#define BSDTYPES
 #elif defined(__acornriscos)
 #elif defined(__acornriscos)
 #include <stdlib.h>
 #include <stdlib.h>
-#define	BSDTYPES
-#define	HAVE_UNISTD_H	0
+#define BSDTYPES
+#define HAVE_UNISTD_H   0
 #elif defined(VMS)
 #elif defined(VMS)
-#define	HAVE_UNISTD_H	0
+#define HAVE_UNISTD_H   0
 #else
 #else
-#define	HAVE_UNISTD_H	1
+#define HAVE_UNISTD_H   1
 #endif
 #endif
 
 
 /*
 /*
@@ -119,10 +119,10 @@
  * then define BSDTYPES in your Makefile.
  * then define BSDTYPES in your Makefile.
  */
  */
 #if defined(BSDTYPES)
 #if defined(BSDTYPES)
-typedef	unsigned char u_char;
-typedef	unsigned short u_short;
-typedef	unsigned int u_int;
-typedef	unsigned long u_long;
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
 #endif
 #endif
 
 
 /*
 /*
@@ -144,12 +144,12 @@ typedef double dblparam_t;
  */
  */
 #if defined(__GNUC__)
 #if defined(__GNUC__)
 #if defined(__STRICT_ANSI__)
 #if defined(__STRICT_ANSI__)
-#define	INLINE	__inline__
+#define INLINE  __inline__
 #else
 #else
-#define	INLINE	inline
+#define INLINE  inline
 #endif
 #endif
 #else /* !__GNUC__ */
 #else /* !__GNUC__ */
-#define	INLINE
+#define INLINE
 #endif
 #endif
 
 
 /*
 /*
@@ -166,14 +166,14 @@ typedef double dblparam_t;
  */
  */
 #if defined(VAX) && defined(VMS)
 #if defined(VAX) && defined(VMS)
 #if defined(VAXC)
 #if defined(VAXC)
-#define GLOBALDATA(TYPE,NAME)	extern noshare TYPE NAME
+#define GLOBALDATA(TYPE,NAME)   extern noshare TYPE NAME
 #endif
 #endif
 #if defined(__GNUC__)
 #if defined(__GNUC__)
-#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME \
-	asm("_$$PsectAttributes_NOSHR$$" #NAME)
+#define GLOBALDATA(TYPE,NAME)   extern TYPE NAME \
+        asm("_$$PsectAttributes_NOSHR$$" #NAME)
 #endif
 #endif
-#else	/* !VAX/VMS */
-#define GLOBALDATA(TYPE,NAME)	extern TYPE NAME
+#else   /* !VAX/VMS */
+#define GLOBALDATA(TYPE,NAME)   extern TYPE NAME
 #endif
 #endif
 
 
 #if defined(__acornriscos)
 #if defined(__acornriscos)
@@ -186,12 +186,12 @@ typedef double dblparam_t;
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 #include <osfcn.h>
 #include <osfcn.h>
 #else
 #else
-#define	O_RDONLY	0
-#define	O_WRONLY	1
-#define	O_RDWR		2
-#define	O_APPEND	8
-#define	O_CREAT		0x200
-#define	O_TRUNC		0x400
+#define O_RDONLY        0
+#define O_WRONLY        1
+#define O_RDWR          2
+#define O_APPEND        8
+#define O_CREAT         0x200
+#define O_TRUNC         0x400
 typedef long off_t;
 typedef long off_t;
 extern int open(const char *name, int flags, int mode);
 extern int open(const char *name, int flags, int mode);
 extern int close(int fd);
 extern int close(int fd);
@@ -207,7 +207,7 @@ extern int creat(const char *path, int mode);
 #undef HOST_FILLORDER
 #undef HOST_FILLORDER
 #undef HOST_BIGENDIAN
 #undef HOST_BIGENDIAN
 #define HOST_FILLORDER FILLORDER_LSB2MSB
 #define HOST_FILLORDER FILLORDER_LSB2MSB
-#define HOST_BIGENDIAN	0
+#define HOST_BIGENDIAN  0
 #endif
 #endif
 
 
 
 

+ 52 - 52
panda/src/tiff/tiffconf.h

@@ -24,7 +24,7 @@
  */
  */
 
 
 #ifndef _TIFFCONF_
 #ifndef _TIFFCONF_
-#define	_TIFFCONF_
+#define _TIFFCONF_
 /*
 /*
  * Library Configuration Definitions.
  * Library Configuration Definitions.
  *
  *
@@ -39,33 +39,33 @@
 /*
 /*
  * General portability-related defines:
  * General portability-related defines:
  *
  *
- * HAVE_IEEEFP		define as 0 or 1 according to the floating point
- *			format suported by the machine
- * BSDTYPES		define this if your system does NOT define the
- *			usual 4BSD typedefs u_int et. al.
- * HAVE_MMAP		enable support for memory mapping read-only files;
- *			this is typically deduced by the configure script
- * HOST_FILLORDER	native cpu bit order: one of FILLORDER_MSB2LSB
- *			or FILLODER_LSB2MSB; this is typically set by the
- *			configure script
- * HOST_BIGENDIAN	native cpu byte order: 1 if big-endian (Motorola)
- *			or 0 if little-endian (Intel); this may be used
- *			in codecs to optimize code
- * USE_64BIT_API	set to 1 if tif_unix.c should use lseek64(),
+ * HAVE_IEEEFP          define as 0 or 1 according to the floating point
+ *                      format suported by the machine
+ * BSDTYPES             define this if your system does NOT define the
+ *                      usual 4BSD typedefs u_int et. al.
+ * HAVE_MMAP            enable support for memory mapping read-only files;
+ *                      this is typically deduced by the configure script
+ * HOST_FILLORDER       native cpu bit order: one of FILLORDER_MSB2LSB
+ *                      or FILLODER_LSB2MSB; this is typically set by the
+ *                      configure script
+ * HOST_BIGENDIAN       native cpu byte order: 1 if big-endian (Motorola)
+ *                      or 0 if little-endian (Intel); this may be used
+ *                      in codecs to optimize code
+ * USE_64BIT_API        set to 1 if tif_unix.c should use lseek64(),
  *                      fstat64() and stat64 allowing 2-4GB files.
  *                      fstat64() and stat64 allowing 2-4GB files.
  */
  */
 #ifndef HAVE_IEEEFP
 #ifndef HAVE_IEEEFP
-#define	HAVE_IEEEFP	1
+#define HAVE_IEEEFP     1
 #endif
 #endif
 #ifndef HOST_FILLORDER
 #ifndef HOST_FILLORDER
-#define	HOST_FILLORDER	FILLORDER_MSB2LSB
+#define HOST_FILLORDER  FILLORDER_MSB2LSB
 #endif
 #endif
-#ifndef	HOST_BIGENDIAN
-#define	HOST_BIGENDIAN	1
+#ifndef HOST_BIGENDIAN
+#define HOST_BIGENDIAN  1
 #endif
 #endif
 
 
 #ifndef USE_64BIT_API
 #ifndef USE_64BIT_API
-#  define USE_64BIT_API	0
+#  define USE_64BIT_API 0
 #endif
 #endif
 
 
 #ifndef FEATURE_SUPPORT
 #ifndef FEATURE_SUPPORT
@@ -73,16 +73,16 @@
  * Feature support definitions:
  * Feature support definitions:
  *
  *
  *    COLORIMETRY_SUPPORT enable support for 6.0 colorimetry tags
  *    COLORIMETRY_SUPPORT enable support for 6.0 colorimetry tags
- *    YCBCR_SUPPORT	enable support for 6.0 YCbCr tags
- *    CMYK_SUPPORT	enable support for 6.0 CMYK tags
- *    ICC_SUPPORT	enable support for ICC profile tag
+ *    YCBCR_SUPPORT     enable support for 6.0 YCbCr tags
+ *    CMYK_SUPPORT      enable support for 6.0 CMYK tags
+ *    ICC_SUPPORT       enable support for ICC profile tag
  *    PHOTOSHOP_SUPPORT enable support for PHOTOSHOP resource tag
  *    PHOTOSHOP_SUPPORT enable support for PHOTOSHOP resource tag
  *    IPTC_SUPPORT  enable support for RichTIFF IPTC tag
  *    IPTC_SUPPORT  enable support for RichTIFF IPTC tag
  */
  */
-#define	COLORIMETRY_SUPPORT
-#define	YCBCR_SUPPORT
-#define	CMYK_SUPPORT
-#define	ICC_SUPPORT
+#define COLORIMETRY_SUPPORT
+#define YCBCR_SUPPORT
+#define CMYK_SUPPORT
+#define ICC_SUPPORT
 #define PHOTOSHOP_SUPPORT
 #define PHOTOSHOP_SUPPORT
 #define IPTC_SUPPORT
 #define IPTC_SUPPORT
 #endif /* FEATURE_SUPPORT */
 #endif /* FEATURE_SUPPORT */
@@ -91,25 +91,25 @@
 /*
 /*
  * Compression support defines:
  * Compression support defines:
  *
  *
- *    CCITT_SUPPORT	enable support for CCITT Group 3 & 4 algorithms
- *    PACKBITS_SUPPORT	enable support for Macintosh PackBits algorithm
- *    LZW_SUPPORT	enable support for LZW algorithm
- *    THUNDER_SUPPORT	enable support for ThunderScan 4-bit RLE algorithm
- *    NEXT_SUPPORT	enable support for NeXT 2-bit RLE algorithm
- *    OJPEG_SUPPORT	enable support for 6.0-style JPEG DCT algorithms
- *			(no builtin support, only a codec hook)
- *    JPEG_SUPPORT	enable support for post-6.0-style JPEG DCT algorithms
- *			(requires freely available IJG software, see tif_jpeg.c)
- *    ZIP_SUPPORT	enable support for Deflate algorithm
- *			(requires freely available zlib software, see tif_zip.c)
- *    PIXARLOG_SUPPORT	enable support for Pixar log-format algorithm
- *    LOGLUV_SUPPORT	enable support for LogLuv high dynamic range encoding
+ *    CCITT_SUPPORT     enable support for CCITT Group 3 & 4 algorithms
+ *    PACKBITS_SUPPORT  enable support for Macintosh PackBits algorithm
+ *    LZW_SUPPORT       enable support for LZW algorithm
+ *    THUNDER_SUPPORT   enable support for ThunderScan 4-bit RLE algorithm
+ *    NEXT_SUPPORT      enable support for NeXT 2-bit RLE algorithm
+ *    OJPEG_SUPPORT     enable support for 6.0-style JPEG DCT algorithms
+ *                      (no builtin support, only a codec hook)
+ *    JPEG_SUPPORT      enable support for post-6.0-style JPEG DCT algorithms
+ *                      (requires freely available IJG software, see tif_jpeg.c)
+ *    ZIP_SUPPORT       enable support for Deflate algorithm
+ *                      (requires freely available zlib software, see tif_zip.c)
+ *    PIXARLOG_SUPPORT  enable support for Pixar log-format algorithm
+ *    LOGLUV_SUPPORT    enable support for LogLuv high dynamic range encoding
  */
  */
-#define	CCITT_SUPPORT
-#define	PACKBITS_SUPPORT
-#define	LZW_SUPPORT
-#define	THUNDER_SUPPORT
-#define	NEXT_SUPPORT
+#define CCITT_SUPPORT
+#define PACKBITS_SUPPORT
+#define LZW_SUPPORT
+#define THUNDER_SUPPORT
+#define NEXT_SUPPORT
 #define LOGLUV_SUPPORT
 #define LOGLUV_SUPPORT
 #endif /* COMPRESSION_SUPPORT */
 #endif /* COMPRESSION_SUPPORT */
 
 
@@ -119,25 +119,25 @@
  */
  */
 #ifdef JPEG_SUPPORT
 #ifdef JPEG_SUPPORT
 #ifndef YCBCR_SUPPORT
 #ifndef YCBCR_SUPPORT
-#define	YCBCR_SUPPORT
+#define YCBCR_SUPPORT
 #endif
 #endif
 #ifndef COLORIMETRY_SUPPORT
 #ifndef COLORIMETRY_SUPPORT
-#define	COLORIMETRY_SUPPORT
+#define COLORIMETRY_SUPPORT
 #endif
 #endif
 #endif /* JPEG_SUPPORT */
 #endif /* JPEG_SUPPORT */
 
 
 /*
 /*
  * ``Orthogonal Features''
  * ``Orthogonal Features''
  *
  *
- * STRIPCHOP_DEFAULT	default handling of strip chopping support (whether
- *			or not to convert single-strip uncompressed images
- *			to mutiple strips of ~8Kb--to reduce memory use)
- * SUBIFD_SUPPORT	enable support for SubIFD tag (thumbnails and such)
+ * STRIPCHOP_DEFAULT    default handling of strip chopping support (whether
+ *                      or not to convert single-strip uncompressed images
+ *                      to mutiple strips of ~8Kb--to reduce memory use)
+ * SUBIFD_SUPPORT       enable support for SubIFD tag (thumbnails and such)
  */
  */
 #ifndef STRIPCHOP_DEFAULT
 #ifndef STRIPCHOP_DEFAULT
-#define	STRIPCHOP_DEFAULT	TIFF_STRIPCHOP	/* default is to enable */
+#define STRIPCHOP_DEFAULT       TIFF_STRIPCHOP  /* default is to enable */
 #endif
 #endif
 #ifndef SUBIFD_SUPPORT
 #ifndef SUBIFD_SUPPORT
-#define	SUBIFD_SUPPORT		1	/* enable SubIFD tag (330) support */
+#define SUBIFD_SUPPORT          1       /* enable SubIFD tag (330) support */
 #endif
 #endif
 #endif /* _TIFFCONF_ */
 #endif /* _TIFFCONF_ */

+ 175 - 175
panda/src/tiff/tiffio.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _TIFFIO_
 #ifndef _TIFFIO_
-#define	_TIFFIO_
+#define _TIFFIO_
 
 
 /*
 /*
  * TIFF I/O Library Definitions.
  * TIFF I/O Library Definitions.
@@ -37,7 +37,7 @@
  * TIFF is defined as an incomplete type to hide the
  * TIFF is defined as an incomplete type to hide the
  * library's internal data structures from clients.
  * library's internal data structures from clients.
  */
  */
-typedef	struct tiff TIFF;
+typedef struct tiff TIFF;
 
 
 /*
 /*
  * The following typedefs define the intrinsic size of
  * The following typedefs define the intrinsic size of
@@ -58,14 +58,14 @@ typedef	struct tiff TIFF;
  *     32-bit file offsets being the most important, and to ensure
  *     32-bit file offsets being the most important, and to ensure
  *     that it is unsigned, rather than signed.
  *     that it is unsigned, rather than signed.
  */
  */
-typedef	uint32 ttag_t;		/* directory tag */
-typedef	uint16 tdir_t;		/* directory index */
-typedef	uint16 tsample_t;	/* sample number */
-typedef	uint32 tstrip_t;	/* strip number */
-typedef uint32 ttile_t;		/* tile number */
-typedef	int32 tsize_t;		/* i/o size in bytes */
-typedef	void* tdata_t;		/* image data ref */
-typedef	uint32 toff_t;		/* file offset */
+typedef uint32 ttag_t;          /* directory tag */
+typedef uint16 tdir_t;          /* directory index */
+typedef uint16 tsample_t;       /* sample number */
+typedef uint32 tstrip_t;        /* strip number */
+typedef uint32 ttile_t;         /* tile number */
+typedef int32 tsize_t;          /* i/o size in bytes */
+typedef void* tdata_t;          /* image data ref */
+typedef uint32 toff_t;          /* file offset */
 
 
 #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
 #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))
 #define __WIN32__
 #define __WIN32__
@@ -88,16 +88,16 @@ typedef	uint32 toff_t;		/* file offset */
 #if defined(USE_WIN32_FILEIO)
 #if defined(USE_WIN32_FILEIO)
 #include <windows.h>
 #include <windows.h>
 #ifdef __WIN32__
 #ifdef __WIN32__
-DECLARE_HANDLE(thandle_t);	/* Win32 file handle */
+DECLARE_HANDLE(thandle_t);      /* Win32 file handle */
 #else
 #else
-typedef	HFILE thandle_t;	/* client data handle */
+typedef HFILE thandle_t;        /* client data handle */
 #endif
 #endif
 #else
 #else
-typedef	void* thandle_t;	/* client data handle */
+typedef void* thandle_t;        /* client data handle */
 #endif
 #endif
 
 
 #ifndef NULL
 #ifndef NULL
-#define	NULL	0
+#define NULL    0
 #endif
 #endif
 
 
 /*
 /*
@@ -106,18 +106,18 @@ typedef	void* thandle_t;	/* client data handle */
  * very large.   Bit-or these flags to enable printing
  * very large.   Bit-or these flags to enable printing
  * multiple items.
  * multiple items.
  */
  */
-#define	TIFFPRINT_NONE		0x0		/* no extra info */
-#define	TIFFPRINT_STRIPS	0x1		/* strips/tiles info */
-#define	TIFFPRINT_CURVES	0x2		/* color/gray response curves */
-#define	TIFFPRINT_COLORMAP	0x4		/* colormap */
-#define	TIFFPRINT_JPEGQTABLES	0x100		/* JPEG Q matrices */
-#define	TIFFPRINT_JPEGACTABLES	0x200		/* JPEG AC tables */
-#define	TIFFPRINT_JPEGDCTABLES	0x200		/* JPEG DC tables */
+#define TIFFPRINT_NONE          0x0             /* no extra info */
+#define TIFFPRINT_STRIPS        0x1             /* strips/tiles info */
+#define TIFFPRINT_CURVES        0x2             /* color/gray response curves */
+#define TIFFPRINT_COLORMAP      0x4             /* colormap */
+#define TIFFPRINT_JPEGQTABLES   0x100           /* JPEG Q matrices */
+#define TIFFPRINT_JPEGACTABLES  0x200           /* JPEG AC tables */
+#define TIFFPRINT_JPEGDCTABLES  0x200           /* JPEG DC tables */
 
 
 /*
 /*
  * RGBA-style image support.
  * RGBA-style image support.
  */
  */
-typedef	unsigned char TIFFRGBValue;		/* 8-bit samples */
+typedef unsigned char TIFFRGBValue;             /* 8-bit samples */
 typedef struct _TIFFRGBAImage TIFFRGBAImage;
 typedef struct _TIFFRGBAImage TIFFRGBAImage;
 /*
 /*
  * The image reading and conversion routines invoke
  * The image reading and conversion routines invoke
@@ -131,49 +131,49 @@ typedef struct _TIFFRGBAImage TIFFRGBAImage;
  */
  */
 typedef void (*tileContigRoutine)
 typedef void (*tileContigRoutine)
     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
-	unsigned char*);
+        unsigned char*);
 typedef void (*tileSeparateRoutine)
 typedef void (*tileSeparateRoutine)
     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
     (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
-	unsigned char*, unsigned char*, unsigned char*, unsigned char*);
+        unsigned char*, unsigned char*, unsigned char*, unsigned char*);
 /*
 /*
  * RGBA-reader state.
  * RGBA-reader state.
  */
  */
-typedef struct {				/* YCbCr->RGB support */
-	TIFFRGBValue* clamptab;			/* range clamping table */
-	int*	Cr_r_tab;
-	int*	Cb_b_tab;
-	int32*	Cr_g_tab;
-	int32*	Cb_g_tab;
-	float	coeffs[3];			/* cached for repeated use */
+typedef struct {                                /* YCbCr->RGB support */
+        TIFFRGBValue* clamptab;                 /* range clamping table */
+        int*    Cr_r_tab;
+        int*    Cb_b_tab;
+        int32*  Cr_g_tab;
+        int32*  Cb_g_tab;
+        float   coeffs[3];                      /* cached for repeated use */
 } TIFFYCbCrToRGB;
 } TIFFYCbCrToRGB;
 
 
 struct _TIFFRGBAImage {
 struct _TIFFRGBAImage {
-	TIFF*	tif;				/* image handle */
-	int	stoponerr;			/* stop on read error */
-	int	isContig;			/* data is packed/separate */
-	int	alpha;				/* type of alpha data present */
-	uint32	width;				/* image width */
-	uint32	height;				/* image height */
-	uint16	bitspersample;			/* image bits/sample */
-	uint16	samplesperpixel;		/* image samples/pixel */
-	uint16	orientation;			/* image orientation */
-	uint16	photometric;			/* image photometric interp */
-	uint16*	redcmap;			/* colormap pallete */
-	uint16*	greencmap;
-	uint16*	bluecmap;
-						/* get image data routine */
-	int	(*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
-	union {
-	    void (*any)(TIFFRGBAImage*);
-	    tileContigRoutine	contig;
-	    tileSeparateRoutine	separate;
-	} put;					/* put decoded strip/tile */
-	TIFFRGBValue* Map;			/* sample mapping array */
-	uint32** BWmap;				/* black&white map */
-	uint32** PALmap;			/* palette image map */
-	TIFFYCbCrToRGB* ycbcr;			/* YCbCr conversion state */
+        TIFF*   tif;                            /* image handle */
+        int     stoponerr;                      /* stop on read error */
+        int     isContig;                       /* data is packed/separate */
+        int     alpha;                          /* type of alpha data present */
+        uint32  width;                          /* image width */
+        uint32  height;                         /* image height */
+        uint16  bitspersample;                  /* image bits/sample */
+        uint16  samplesperpixel;                /* image samples/pixel */
+        uint16  orientation;                    /* image orientation */
+        uint16  photometric;                    /* image photometric interp */
+        uint16* redcmap;                        /* colormap pallete */
+        uint16* greencmap;
+        uint16* bluecmap;
+                                                /* get image data routine */
+        int     (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
+        union {
+            void (*any)(TIFFRGBAImage*);
+            tileContigRoutine   contig;
+            tileSeparateRoutine separate;
+        } put;                                  /* put decoded strip/tile */
+        TIFFRGBValue* Map;                      /* sample mapping array */
+        uint32** BWmap;                         /* black&white map */
+        uint32** PALmap;                        /* palette image map */
+        TIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */
 
 
-        int	row_offset;
+        int     row_offset;
         int     col_offset;
         int     col_offset;
 };
 };
 
 
@@ -181,10 +181,10 @@ struct _TIFFRGBAImage {
  * Macros for extracting components from the
  * Macros for extracting components from the
  * packed ABGR form returned by TIFFReadRGBAImage.
  * packed ABGR form returned by TIFFReadRGBAImage.
  */
  */
-#define	TIFFGetR(abgr)	((abgr) & 0xff)
-#define	TIFFGetG(abgr)	(((abgr) >> 8) & 0xff)
-#define	TIFFGetB(abgr)	(((abgr) >> 16) & 0xff)
-#define	TIFFGetA(abgr)	(((abgr) >> 24) & 0xff)
+#define TIFFGetR(abgr)  ((abgr) & 0xff)
+#define TIFFGetG(abgr)  (((abgr) >> 8) & 0xff)
+#define TIFFGetB(abgr)  (((abgr) >> 16) & 0xff)
+#define TIFFGetA(abgr)  (((abgr) >> 24) & 0xff)
 
 
 /*
 /*
  * A CODEC is a software package that implements decoding,
  * A CODEC is a software package that implements decoding,
@@ -193,11 +193,11 @@ struct _TIFFRGBAImage {
  * More codecs may be registered through calls to the library
  * More codecs may be registered through calls to the library
  * and/or the builtin implementations may be overridden.
  * and/or the builtin implementations may be overridden.
  */
  */
-typedef	int (*TIFFInitMethod)(TIFF*, int);
+typedef int (*TIFFInitMethod)(TIFF*, int);
 typedef struct {
 typedef struct {
-	char*		name;
-	uint16		scheme;
-	TIFFInitMethod	init;
+        char*           name;
+        uint16          scheme;
+        TIFFInitMethod  init;
 } TIFFCodec;
 } TIFFCodec;
 
 
 #include <stdio.h>
 #include <stdio.h>
@@ -206,128 +206,128 @@ typedef struct {
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 extern "C" {
 extern "C" {
 #endif
 #endif
-typedef	void (*TIFFErrorHandler)(const char*, const char*, va_list);
-typedef	tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
-typedef	toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
-typedef	int (*TIFFCloseProc)(thandle_t);
-typedef	toff_t (*TIFFSizeProc)(thandle_t);
-typedef	int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
-typedef	void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
-typedef	void (*TIFFExtendProc)(TIFF*); 
+typedef void (*TIFFErrorHandler)(const char*, const char*, va_list);
+typedef tsize_t (*TIFFReadWriteProc)(thandle_t, tdata_t, tsize_t);
+typedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);
+typedef int (*TIFFCloseProc)(thandle_t);
+typedef toff_t (*TIFFSizeProc)(thandle_t);
+typedef int (*TIFFMapFileProc)(thandle_t, tdata_t*, toff_t*);
+typedef void (*TIFFUnmapFileProc)(thandle_t, tdata_t, toff_t);
+typedef void (*TIFFExtendProc)(TIFF*); 
 
 
-extern	const char* TIFFGetVersion(void);
+extern  const char* TIFFGetVersion(void);
 
 
-extern	const TIFFCodec* TIFFFindCODEC(uint16);
-extern	TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
-extern	void TIFFUnRegisterCODEC(TIFFCodec*);
+extern  const TIFFCodec* TIFFFindCODEC(uint16);
+extern  TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
+extern  void TIFFUnRegisterCODEC(TIFFCodec*);
 
 
-extern	tdata_t _TIFFmalloc(tsize_t);
-extern	tdata_t _TIFFrealloc(tdata_t, tsize_t);
-extern	void _TIFFmemset(tdata_t, int, tsize_t);
-extern	void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
-extern	int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
-extern	void _TIFFfree(tdata_t);
+extern  tdata_t _TIFFmalloc(tsize_t);
+extern  tdata_t _TIFFrealloc(tdata_t, tsize_t);
+extern  void _TIFFmemset(tdata_t, int, tsize_t);
+extern  void _TIFFmemcpy(tdata_t, const tdata_t, tsize_t);
+extern  int _TIFFmemcmp(const tdata_t, const tdata_t, tsize_t);
+extern  void _TIFFfree(tdata_t);
 
 
-extern	void TIFFClose(TIFF*);
-extern	int TIFFFlush(TIFF*);
-extern	int TIFFFlushData(TIFF*);
-extern	int TIFFGetField(TIFF*, ttag_t, ...);
-extern	int TIFFVGetField(TIFF*, ttag_t, va_list);
-extern	int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
-extern	int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
-extern	int TIFFReadDirectory(TIFF*);
-extern	tsize_t TIFFScanlineSize(TIFF*);
-extern	tsize_t TIFFRasterScanlineSize(TIFF*);
-extern	tsize_t TIFFStripSize(TIFF*);
-extern	tsize_t TIFFVStripSize(TIFF*, uint32);
-extern	tsize_t TIFFTileRowSize(TIFF*);
-extern	tsize_t TIFFTileSize(TIFF*);
-extern	tsize_t TIFFVTileSize(TIFF*, uint32);
-extern	uint32 TIFFDefaultStripSize(TIFF*, uint32);
-extern	void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
-extern	int TIFFFileno(TIFF*);
-extern	int TIFFGetMode(TIFF*);
-extern	int TIFFIsTiled(TIFF*);
-extern	int TIFFIsByteSwapped(TIFF*);
-extern	int TIFFIsUpSampled(TIFF*);
-extern	int TIFFIsMSB2LSB(TIFF*);
-extern	uint32 TIFFCurrentRow(TIFF*);
-extern	tdir_t TIFFCurrentDirectory(TIFF*);
-extern	tdir_t TIFFNumberOfDirectories(TIFF*);
-extern	uint32 TIFFCurrentDirOffset(TIFF*);
-extern	tstrip_t TIFFCurrentStrip(TIFF*);
-extern	ttile_t TIFFCurrentTile(TIFF*);
-extern	int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
-extern	int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
+extern  void TIFFClose(TIFF*);
+extern  int TIFFFlush(TIFF*);
+extern  int TIFFFlushData(TIFF*);
+extern  int TIFFGetField(TIFF*, ttag_t, ...);
+extern  int TIFFVGetField(TIFF*, ttag_t, va_list);
+extern  int TIFFGetFieldDefaulted(TIFF*, ttag_t, ...);
+extern  int TIFFVGetFieldDefaulted(TIFF*, ttag_t, va_list);
+extern  int TIFFReadDirectory(TIFF*);
+extern  tsize_t TIFFScanlineSize(TIFF*);
+extern  tsize_t TIFFRasterScanlineSize(TIFF*);
+extern  tsize_t TIFFStripSize(TIFF*);
+extern  tsize_t TIFFVStripSize(TIFF*, uint32);
+extern  tsize_t TIFFTileRowSize(TIFF*);
+extern  tsize_t TIFFTileSize(TIFF*);
+extern  tsize_t TIFFVTileSize(TIFF*, uint32);
+extern  uint32 TIFFDefaultStripSize(TIFF*, uint32);
+extern  void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
+extern  int TIFFFileno(TIFF*);
+extern  int TIFFGetMode(TIFF*);
+extern  int TIFFIsTiled(TIFF*);
+extern  int TIFFIsByteSwapped(TIFF*);
+extern  int TIFFIsUpSampled(TIFF*);
+extern  int TIFFIsMSB2LSB(TIFF*);
+extern  uint32 TIFFCurrentRow(TIFF*);
+extern  tdir_t TIFFCurrentDirectory(TIFF*);
+extern  tdir_t TIFFNumberOfDirectories(TIFF*);
+extern  uint32 TIFFCurrentDirOffset(TIFF*);
+extern  tstrip_t TIFFCurrentStrip(TIFF*);
+extern  ttile_t TIFFCurrentTile(TIFF*);
+extern  int TIFFReadBufferSetup(TIFF*, tdata_t, tsize_t);
+extern  int TIFFWriteBufferSetup(TIFF*, tdata_t, tsize_t);
 extern  int TIFFWriteCheck(TIFF*, int, const char *);
 extern  int TIFFWriteCheck(TIFF*, int, const char *);
 extern  int TIFFCreateDirectory(TIFF*);
 extern  int TIFFCreateDirectory(TIFF*);
-extern	int TIFFLastDirectory(TIFF*);
-extern	int TIFFSetDirectory(TIFF*, tdir_t);
-extern	int TIFFSetSubDirectory(TIFF*, uint32);
-extern	int TIFFUnlinkDirectory(TIFF*, tdir_t);
-extern	int TIFFSetField(TIFF*, ttag_t, ...);
-extern	int TIFFVSetField(TIFF*, ttag_t, va_list);
-extern	int TIFFWriteDirectory(TIFF *);
-extern	int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
+extern  int TIFFLastDirectory(TIFF*);
+extern  int TIFFSetDirectory(TIFF*, tdir_t);
+extern  int TIFFSetSubDirectory(TIFF*, uint32);
+extern  int TIFFUnlinkDirectory(TIFF*, tdir_t);
+extern  int TIFFSetField(TIFF*, ttag_t, ...);
+extern  int TIFFVSetField(TIFF*, ttag_t, va_list);
+extern  int TIFFWriteDirectory(TIFF *);
+extern  int TIFFReassignTagToIgnore(enum TIFFIgnoreSense, int);
 
 
 #if defined(c_plusplus) || defined(__cplusplus)
 #if defined(c_plusplus) || defined(__cplusplus)
-extern	void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
-extern	int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
-extern	int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
-extern	int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
+extern  void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
+extern  int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
+extern  int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t = 0);
+extern  int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
 #else
 #else
-extern	void TIFFPrintDirectory(TIFF*, FILE*, long);
-extern	int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
-extern	int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
-extern	int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
+extern  void TIFFPrintDirectory(TIFF*, FILE*, long);
+extern  int TIFFReadScanline(TIFF*, tdata_t, uint32, tsample_t);
+extern  int TIFFWriteScanline(TIFF*, tdata_t, uint32, tsample_t);
+extern  int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
 #endif
 #endif
 
 
-extern	int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
-extern	int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
-extern	int TIFFRGBAImageOK(TIFF*, char [1024]);
-extern	int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
-extern	int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
-extern	void TIFFRGBAImageEnd(TIFFRGBAImage*);
-extern	TIFF* TIFFOpen(const char*, const char*);
-extern	TIFF* TIFFFdOpen(int, const char*, const char*);
-extern	TIFF* TIFFClientOpen(const char*, const char*,
-	    thandle_t,
-	    TIFFReadWriteProc, TIFFReadWriteProc,
-	    TIFFSeekProc, TIFFCloseProc,
-	    TIFFSizeProc,
-	    TIFFMapFileProc, TIFFUnmapFileProc);
-extern	const char* TIFFFileName(TIFF*);
-extern	void TIFFError(const char*, const char*, ...);
-extern	void TIFFWarning(const char*, const char*, ...);
-extern	TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
-extern	TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
-extern	TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
-extern	ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
-extern	int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
-extern	ttile_t TIFFNumberOfTiles(TIFF*);
-extern	tsize_t TIFFReadTile(TIFF*,
-	    tdata_t, uint32, uint32, uint32, tsample_t);
-extern	tsize_t TIFFWriteTile(TIFF*,
-	    tdata_t, uint32, uint32, uint32, tsample_t);
-extern	tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
-extern	tstrip_t TIFFNumberOfStrips(TIFF*);
-extern	tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
-extern	tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
-extern	tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
-extern	tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
-extern	tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
-extern	tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
-extern	tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
-extern	tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
-extern	void TIFFSetWriteOffset(TIFF*, toff_t);
-extern	void TIFFSwabShort(uint16*);
-extern	void TIFFSwabLong(uint32*);
-extern	void TIFFSwabDouble(double*);
-extern	void TIFFSwabArrayOfShort(uint16*, unsigned long);
-extern	void TIFFSwabArrayOfLong(uint32*, unsigned long);
-extern	void TIFFSwabArrayOfDouble(double*, unsigned long);
-extern	void TIFFReverseBits(unsigned char *, unsigned long);
-extern	const unsigned char* TIFFGetBitRevTable(int);
+extern  int TIFFReadRGBAStrip(TIFF*, tstrip_t, uint32 * );
+extern  int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
+extern  int TIFFRGBAImageOK(TIFF*, char [1024]);
+extern  int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
+extern  int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
+extern  void TIFFRGBAImageEnd(TIFFRGBAImage*);
+extern  TIFF* TIFFOpen(const char*, const char*);
+extern  TIFF* TIFFFdOpen(int, const char*, const char*);
+extern  TIFF* TIFFClientOpen(const char*, const char*,
+            thandle_t,
+            TIFFReadWriteProc, TIFFReadWriteProc,
+            TIFFSeekProc, TIFFCloseProc,
+            TIFFSizeProc,
+            TIFFMapFileProc, TIFFUnmapFileProc);
+extern  const char* TIFFFileName(TIFF*);
+extern  void TIFFError(const char*, const char*, ...);
+extern  void TIFFWarning(const char*, const char*, ...);
+extern  TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);
+extern  TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
+extern  TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
+extern  ttile_t TIFFComputeTile(TIFF*, uint32, uint32, uint32, tsample_t);
+extern  int TIFFCheckTile(TIFF*, uint32, uint32, uint32, tsample_t);
+extern  ttile_t TIFFNumberOfTiles(TIFF*);
+extern  tsize_t TIFFReadTile(TIFF*,
+            tdata_t, uint32, uint32, uint32, tsample_t);
+extern  tsize_t TIFFWriteTile(TIFF*,
+            tdata_t, uint32, uint32, uint32, tsample_t);
+extern  tstrip_t TIFFComputeStrip(TIFF*, uint32, tsample_t);
+extern  tstrip_t TIFFNumberOfStrips(TIFF*);
+extern  tsize_t TIFFReadEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern  tsize_t TIFFReadRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern  tsize_t TIFFReadEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern  tsize_t TIFFReadRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern  tsize_t TIFFWriteEncodedStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern  tsize_t TIFFWriteRawStrip(TIFF*, tstrip_t, tdata_t, tsize_t);
+extern  tsize_t TIFFWriteEncodedTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern  tsize_t TIFFWriteRawTile(TIFF*, ttile_t, tdata_t, tsize_t);
+extern  void TIFFSetWriteOffset(TIFF*, toff_t);
+extern  void TIFFSwabShort(uint16*);
+extern  void TIFFSwabLong(uint32*);
+extern  void TIFFSwabDouble(double*);
+extern  void TIFFSwabArrayOfShort(uint16*, unsigned long);
+extern  void TIFFSwabArrayOfLong(uint32*, unsigned long);
+extern  void TIFFSwabArrayOfDouble(double*, unsigned long);
+extern  void TIFFReverseBits(unsigned char *, unsigned long);
+extern  const unsigned char* TIFFGetBitRevTable(int);
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 }
 }
 #endif
 #endif

+ 159 - 159
panda/src/tiff/tiffiop.h

@@ -25,7 +25,7 @@
  */
  */
 
 
 #ifndef _TIFFIOP_
 #ifndef _TIFFIOP_
-#define	_TIFFIOP_
+#define _TIFFIOP_
 /*
 /*
  * ``Library-private'' definitions.
  * ``Library-private'' definitions.
  */
  */
@@ -45,232 +45,232 @@
 #include "tif_dir.h"
 #include "tif_dir.h"
 
 
 #ifndef TRUE
 #ifndef TRUE
-#define	TRUE	1
-#define	FALSE	0
+#define TRUE    1
+#define FALSE   0
 #endif
 #endif
 
 
 /*
 /*
  * Typedefs for ``method pointers'' used internally.
  * Typedefs for ``method pointers'' used internally.
  */
  */
-typedef	unsigned char tidataval_t;	/* internal image data value type */
-typedef	tidataval_t* tidata_t;		/* reference to internal image data */
+typedef unsigned char tidataval_t;      /* internal image data value type */
+typedef tidataval_t* tidata_t;          /* reference to internal image data */
 
 
-typedef	void (*TIFFVoidMethod)(TIFF*);
-typedef	int (*TIFFBoolMethod)(TIFF*);
-typedef	int (*TIFFPreMethod)(TIFF*, tsample_t);
-typedef	int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t);
-typedef	int (*TIFFSeekMethod)(TIFF*, uint32);
-typedef	void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t);
-typedef	int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
-typedef	int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
-typedef	void (*TIFFPrintMethod)(TIFF*, FILE*, long);
-typedef	uint32 (*TIFFStripMethod)(TIFF*, uint32);
-typedef	void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
+typedef void (*TIFFVoidMethod)(TIFF*);
+typedef int (*TIFFBoolMethod)(TIFF*);
+typedef int (*TIFFPreMethod)(TIFF*, tsample_t);
+typedef int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t);
+typedef int (*TIFFSeekMethod)(TIFF*, uint32);
+typedef void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t);
+typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
+typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
+typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
+typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
+typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
 
 
 struct tiff {
 struct tiff {
-	char*		tif_name;	/* name of open file */
-	int		tif_fd;		/* open file descriptor */
-	int		tif_mode;	/* open mode (O_*) */
-	uint32		tif_flags;
-#define	TIFF_FILLORDER		0x0003	/* natural bit fill order for machine */
-#define	TIFF_DIRTYHEADER	0x0004	/* header must be written on close */
-#define	TIFF_DIRTYDIRECT	0x0008	/* current directory must be written */
-#define	TIFF_BUFFERSETUP	0x0010	/* data buffers setup */
-#define	TIFF_CODERSETUP		0x0020	/* encoder/decoder setup done */
-#define	TIFF_BEENWRITING	0x0040	/* written 1+ scanlines to file */
-#define	TIFF_SWAB		0x0080	/* byte swap file information */
-#define	TIFF_NOBITREV		0x0100	/* inhibit bit reversal logic */
-#define	TIFF_MYBUFFER		0x0200	/* my raw data buffer; free on close */
-#define	TIFF_ISTILED		0x0400	/* file is tile, not strip- based */
-#define	TIFF_MAPPED		0x0800	/* file is mapped into memory */
-#define	TIFF_POSTENCODE		0x1000	/* need call to postencode routine */
-#define	TIFF_INSUBIFD		0x2000	/* currently writing a subifd */
-#define	TIFF_UPSAMPLED		0x4000	/* library is doing data up-sampling */ 
-#define	TIFF_STRIPCHOP		0x8000	/* enable strip chopping support */
-	toff_t		tif_diroff;	/* file offset of current directory */
-	toff_t		tif_nextdiroff;	/* file offset of following directory */
-	TIFFDirectory	tif_dir;	/* internal rep of current directory */
-	TIFFHeader	tif_header;	/* file's header block */
+        char*           tif_name;       /* name of open file */
+        int             tif_fd;         /* open file descriptor */
+        int             tif_mode;       /* open mode (O_*) */
+        uint32          tif_flags;
+#define TIFF_FILLORDER          0x0003  /* natural bit fill order for machine */
+#define TIFF_DIRTYHEADER        0x0004  /* header must be written on close */
+#define TIFF_DIRTYDIRECT        0x0008  /* current directory must be written */
+#define TIFF_BUFFERSETUP        0x0010  /* data buffers setup */
+#define TIFF_CODERSETUP         0x0020  /* encoder/decoder setup done */
+#define TIFF_BEENWRITING        0x0040  /* written 1+ scanlines to file */
+#define TIFF_SWAB               0x0080  /* byte swap file information */
+#define TIFF_NOBITREV           0x0100  /* inhibit bit reversal logic */
+#define TIFF_MYBUFFER           0x0200  /* my raw data buffer; free on close */
+#define TIFF_ISTILED            0x0400  /* file is tile, not strip- based */
+#define TIFF_MAPPED             0x0800  /* file is mapped into memory */
+#define TIFF_POSTENCODE         0x1000  /* need call to postencode routine */
+#define TIFF_INSUBIFD           0x2000  /* currently writing a subifd */
+#define TIFF_UPSAMPLED          0x4000  /* library is doing data up-sampling */ 
+#define TIFF_STRIPCHOP          0x8000  /* enable strip chopping support */
+        toff_t          tif_diroff;     /* file offset of current directory */
+        toff_t          tif_nextdiroff; /* file offset of following directory */
+        TIFFDirectory   tif_dir;        /* internal rep of current directory */
+        TIFFHeader      tif_header;     /* file's header block */
         tidata_t        tif_clientdir;  /* client TIFF directory */
         tidata_t        tif_clientdir;  /* client TIFF directory */
-	const int*	tif_typeshift;	/* data type shift counts */
-	const long*	tif_typemask;	/* data type masks */
-	uint32		tif_row;	/* current scanline */
-	tdir_t		tif_curdir;	/* current directory (index) */
-	tstrip_t	tif_curstrip;	/* current strip for read/write */
-	toff_t		tif_curoff;	/* current offset for read/write */
-	toff_t		tif_dataoff;	/* current offset for writing dir */
+        const int*      tif_typeshift;  /* data type shift counts */
+        const long*     tif_typemask;   /* data type masks */
+        uint32          tif_row;        /* current scanline */
+        tdir_t          tif_curdir;     /* current directory (index) */
+        tstrip_t        tif_curstrip;   /* current strip for read/write */
+        toff_t          tif_curoff;     /* current offset for read/write */
+        toff_t          tif_dataoff;    /* current offset for writing dir */
 #if SUBIFD_SUPPORT
 #if SUBIFD_SUPPORT
-	uint16		tif_nsubifd;	/* remaining subifds to write */
-	toff_t		tif_subifdoff;	/* offset for patching SubIFD link */
+        uint16          tif_nsubifd;    /* remaining subifds to write */
+        toff_t          tif_subifdoff;  /* offset for patching SubIFD link */
 #endif
 #endif
 /* tiling support */
 /* tiling support */
-	uint32 		tif_col;	/* current column (offset by row too) */
-	ttile_t		tif_curtile;	/* current tile for read/write */
-	tsize_t		tif_tilesize;	/* # of bytes in a tile */
+        uint32          tif_col;        /* current column (offset by row too) */
+        ttile_t         tif_curtile;    /* current tile for read/write */
+        tsize_t         tif_tilesize;   /* # of bytes in a tile */
 /* compression scheme hooks */
 /* compression scheme hooks */
-	TIFFBoolMethod	tif_setupdecode;/* called once before predecode */
-	TIFFPreMethod	tif_predecode;	/* pre- row/strip/tile decoding */
-	TIFFBoolMethod	tif_setupencode;/* called once before preencode */
-	TIFFPreMethod	tif_preencode;	/* pre- row/strip/tile encoding */
-	TIFFBoolMethod	tif_postencode;	/* post- row/strip/tile encoding */
-	TIFFCodeMethod	tif_decoderow;	/* scanline decoding routine */
-	TIFFCodeMethod	tif_encoderow;	/* scanline encoding routine */
-	TIFFCodeMethod	tif_decodestrip;/* strip decoding routine */
-	TIFFCodeMethod	tif_encodestrip;/* strip encoding routine */
-	TIFFCodeMethod	tif_decodetile;	/* tile decoding routine */
-	TIFFCodeMethod	tif_encodetile;	/* tile encoding routine */
-	TIFFVoidMethod	tif_close;	/* cleanup-on-close routine */
-	TIFFSeekMethod	tif_seek;	/* position within a strip routine */
-	TIFFVoidMethod	tif_cleanup;	/* cleanup state routine */
-	TIFFStripMethod	tif_defstripsize;/* calculate/constrain strip size */
-	TIFFTileMethod	tif_deftilesize;/* calculate/constrain tile size */
-	tidata_t	tif_data;	/* compression scheme private data */
+        TIFFBoolMethod  tif_setupdecode;/* called once before predecode */
+        TIFFPreMethod   tif_predecode;  /* pre- row/strip/tile decoding */
+        TIFFBoolMethod  tif_setupencode;/* called once before preencode */
+        TIFFPreMethod   tif_preencode;  /* pre- row/strip/tile encoding */
+        TIFFBoolMethod  tif_postencode; /* post- row/strip/tile encoding */
+        TIFFCodeMethod  tif_decoderow;  /* scanline decoding routine */
+        TIFFCodeMethod  tif_encoderow;  /* scanline encoding routine */
+        TIFFCodeMethod  tif_decodestrip;/* strip decoding routine */
+        TIFFCodeMethod  tif_encodestrip;/* strip encoding routine */
+        TIFFCodeMethod  tif_decodetile; /* tile decoding routine */
+        TIFFCodeMethod  tif_encodetile; /* tile encoding routine */
+        TIFFVoidMethod  tif_close;      /* cleanup-on-close routine */
+        TIFFSeekMethod  tif_seek;       /* position within a strip routine */
+        TIFFVoidMethod  tif_cleanup;    /* cleanup state routine */
+        TIFFStripMethod tif_defstripsize;/* calculate/constrain strip size */
+        TIFFTileMethod  tif_deftilesize;/* calculate/constrain tile size */
+        tidata_t        tif_data;       /* compression scheme private data */
 /* input/output buffering */
 /* input/output buffering */
-	tsize_t		tif_scanlinesize;/* # of bytes in a scanline */
-	tsize_t		tif_scanlineskew;/* scanline skew for reading strips */
-	tidata_t	tif_rawdata;	/* raw data buffer */
-	tsize_t		tif_rawdatasize;/* # of bytes in raw data buffer */
-	tidata_t	tif_rawcp;	/* current spot in raw buffer */
-	tsize_t		tif_rawcc;	/* bytes unread from raw buffer */
+        tsize_t         tif_scanlinesize;/* # of bytes in a scanline */
+        tsize_t         tif_scanlineskew;/* scanline skew for reading strips */
+        tidata_t        tif_rawdata;    /* raw data buffer */
+        tsize_t         tif_rawdatasize;/* # of bytes in raw data buffer */
+        tidata_t        tif_rawcp;      /* current spot in raw buffer */
+        tsize_t         tif_rawcc;      /* bytes unread from raw buffer */
 /* memory-mapped file support */
 /* memory-mapped file support */
-	tidata_t	tif_base;	/* base of mapped file */
-	toff_t		tif_size;	/* size of mapped file region (bytes) */
-	TIFFMapFileProc	tif_mapproc;	/* map file method */
-	TIFFUnmapFileProc tif_unmapproc;/* unmap file method */
+        tidata_t        tif_base;       /* base of mapped file */
+        toff_t          tif_size;       /* size of mapped file region (bytes) */
+        TIFFMapFileProc tif_mapproc;    /* map file method */
+        TIFFUnmapFileProc tif_unmapproc;/* unmap file method */
 /* input/output callback methods */
 /* input/output callback methods */
-	thandle_t	tif_clientdata;	/* callback parameter */
-	TIFFReadWriteProc tif_readproc;	/* read method */
-	TIFFReadWriteProc tif_writeproc;/* write method */
-	TIFFSeekProc	tif_seekproc;	/* lseek method */
-	TIFFCloseProc	tif_closeproc;	/* close method */
-	TIFFSizeProc	tif_sizeproc;	/* filesize method */
+        thandle_t       tif_clientdata; /* callback parameter */
+        TIFFReadWriteProc tif_readproc; /* read method */
+        TIFFReadWriteProc tif_writeproc;/* write method */
+        TIFFSeekProc    tif_seekproc;   /* lseek method */
+        TIFFCloseProc   tif_closeproc;  /* close method */
+        TIFFSizeProc    tif_sizeproc;   /* filesize method */
 /* post-decoding support */
 /* post-decoding support */
-	TIFFPostMethod	tif_postdecode;	/* post decoding routine */
+        TIFFPostMethod  tif_postdecode; /* post decoding routine */
 /* tag support */
 /* tag support */
-	TIFFFieldInfo**	tif_fieldinfo;	/* sorted table of registered tags */
-	int		tif_nfields;	/* # entries in registered tag table */
-	TIFFVSetMethod	tif_vsetfield;	/* tag set routine */
-	TIFFVGetMethod	tif_vgetfield;	/* tag get routine */
-	TIFFPrintMethod	tif_printdir;	/* directory print routine */
+        TIFFFieldInfo** tif_fieldinfo;  /* sorted table of registered tags */
+        int             tif_nfields;    /* # entries in registered tag table */
+        TIFFVSetMethod  tif_vsetfield;  /* tag set routine */
+        TIFFVGetMethod  tif_vgetfield;  /* tag get routine */
+        TIFFPrintMethod tif_printdir;   /* directory print routine */
 };
 };
 
 
-#define	isPseudoTag(t)	(t > 0xffff)	/* is tag value normal or pseudo */
+#define isPseudoTag(t)  (t > 0xffff)    /* is tag value normal or pseudo */
 
 
-#define	isTiled(tif)	(((tif)->tif_flags & TIFF_ISTILED) != 0)
-#define	isMapped(tif)	(((tif)->tif_flags & TIFF_MAPPED) != 0)
-#define	isFillOrder(tif, o)	(((tif)->tif_flags & (o)) != 0)
-#define	isUpSampled(tif)	(((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
-#define	TIFFReadFile(tif, buf, size) \
-	((*(tif)->tif_readproc)((tif)->tif_clientdata,buf,size))
-#define	TIFFWriteFile(tif, buf, size) \
-	((*(tif)->tif_writeproc)((tif)->tif_clientdata,buf,size))
-#define	TIFFSeekFile(tif, off, whence) \
-	((*(tif)->tif_seekproc)((tif)->tif_clientdata,(toff_t)(off),whence))
-#define	TIFFCloseFile(tif) \
-	((*(tif)->tif_closeproc)((tif)->tif_clientdata))
-#define	TIFFGetFileSize(tif) \
-	((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
-#define	TIFFMapFileContents(tif, paddr, psize) \
-	((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize))
-#define	TIFFUnmapFileContents(tif, addr, size) \
-	((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size))
+#define isTiled(tif)    (((tif)->tif_flags & TIFF_ISTILED) != 0)
+#define isMapped(tif)   (((tif)->tif_flags & TIFF_MAPPED) != 0)
+#define isFillOrder(tif, o)     (((tif)->tif_flags & (o)) != 0)
+#define isUpSampled(tif)        (((tif)->tif_flags & TIFF_UPSAMPLED) != 0)
+#define TIFFReadFile(tif, buf, size) \
+        ((*(tif)->tif_readproc)((tif)->tif_clientdata,buf,size))
+#define TIFFWriteFile(tif, buf, size) \
+        ((*(tif)->tif_writeproc)((tif)->tif_clientdata,buf,size))
+#define TIFFSeekFile(tif, off, whence) \
+        ((*(tif)->tif_seekproc)((tif)->tif_clientdata,(toff_t)(off),whence))
+#define TIFFCloseFile(tif) \
+        ((*(tif)->tif_closeproc)((tif)->tif_clientdata))
+#define TIFFGetFileSize(tif) \
+        ((*(tif)->tif_sizeproc)((tif)->tif_clientdata))
+#define TIFFMapFileContents(tif, paddr, psize) \
+        ((*(tif)->tif_mapproc)((tif)->tif_clientdata,paddr,psize))
+#define TIFFUnmapFileContents(tif, addr, size) \
+        ((*(tif)->tif_unmapproc)((tif)->tif_clientdata,addr,size))
 
 
 /*
 /*
  * Default Read/Seek/Write definitions.
  * Default Read/Seek/Write definitions.
  */
  */
 #ifndef ReadOK
 #ifndef ReadOK
-#define	ReadOK(tif, buf, size) \
-	(TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size))
+#define ReadOK(tif, buf, size) \
+        (TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size))
 #endif
 #endif
 #ifndef SeekOK
 #ifndef SeekOK
-#define	SeekOK(tif, off) \
-	(TIFFSeekFile(tif, (toff_t) off, SEEK_SET) == (toff_t) off)
+#define SeekOK(tif, off) \
+        (TIFFSeekFile(tif, (toff_t) off, SEEK_SET) == (toff_t) off)
 #endif
 #endif
 #ifndef WriteOK
 #ifndef WriteOK
-#define	WriteOK(tif, buf, size) \
-	(TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size)
+#define WriteOK(tif, buf, size) \
+        (TIFFWriteFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size)
 #endif
 #endif
 
 
 /* NB: the uint32 casts are to silence certain ANSI-C compilers */
 /* NB: the uint32 casts are to silence certain ANSI-C compilers */
-#define	TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
-#define	TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y)))
+#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
+#define TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y)))
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 extern "C" {
 extern "C" {
 #endif
 #endif
-extern	int _TIFFgetMode(const char*, const char*);
-extern	int _TIFFNoRowEncode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	int _TIFFNoStripEncode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	int _TIFFNoTileEncode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t);
-extern	void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t);
+extern  int _TIFFgetMode(const char*, const char*);
+extern  int _TIFFNoRowEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  int _TIFFNoStripEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  int _TIFFNoTileEncode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  int _TIFFNoRowDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t);
+extern  void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t);
 extern  int  _TIFFNoPreCode (TIFF*, tsample_t); 
 extern  int  _TIFFNoPreCode (TIFF*, tsample_t); 
-extern	int _TIFFNoSeek(TIFF*, uint32);
-extern	void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t);
-extern	void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t);
-extern	void _TIFFSwab64BitData(TIFF*, tidata_t, tsize_t);
-extern	int TIFFFlushData1(TIFF*);
-extern	void TIFFFreeDirectory(TIFF*);
-extern	int TIFFDefaultDirectory(TIFF*);
-extern	int TIFFSetCompressionScheme(TIFF*, int);
-extern	int TIFFSetDefaultCompressionState(TIFF*);
-extern	uint32 _TIFFDefaultStripSize(TIFF*, uint32);
-extern	void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
+extern  int _TIFFNoSeek(TIFF*, uint32);
+extern  void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t);
+extern  void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t);
+extern  void _TIFFSwab64BitData(TIFF*, tidata_t, tsize_t);
+extern  int TIFFFlushData1(TIFF*);
+extern  void TIFFFreeDirectory(TIFF*);
+extern  int TIFFDefaultDirectory(TIFF*);
+extern  int TIFFSetCompressionScheme(TIFF*, int);
+extern  int TIFFSetDefaultCompressionState(TIFF*);
+extern  uint32 _TIFFDefaultStripSize(TIFF*, uint32);
+extern  void _TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
 
 
-extern	void _TIFFsetByteArray(void**, void*, long);
-extern	void _TIFFsetString(char**, char*);
-extern	void _TIFFsetShortArray(uint16**, uint16*, long);
-extern	void _TIFFsetLongArray(uint32**, uint32*, long);
-extern	void _TIFFsetFloatArray(float**, float*, long);
-extern	void _TIFFsetDoubleArray(double**, double*, long);
+extern  void _TIFFsetByteArray(void**, void*, long);
+extern  void _TIFFsetString(char**, char*);
+extern  void _TIFFsetShortArray(uint16**, uint16*, long);
+extern  void _TIFFsetLongArray(uint32**, uint32*, long);
+extern  void _TIFFsetFloatArray(float**, float*, long);
+extern  void _TIFFsetDoubleArray(double**, double*, long);
 
 
-extern	void _TIFFprintAscii(FILE*, const char*);
-extern	void _TIFFprintAsciiTag(FILE*, const char*, const char*);
+extern  void _TIFFprintAscii(FILE*, const char*);
+extern  void _TIFFprintAsciiTag(FILE*, const char*, const char*);
 
 
 GLOBALDATA(TIFFErrorHandler,_TIFFwarningHandler);
 GLOBALDATA(TIFFErrorHandler,_TIFFwarningHandler);
 GLOBALDATA(TIFFErrorHandler,_TIFFerrorHandler);
 GLOBALDATA(TIFFErrorHandler,_TIFFerrorHandler);
 
 
-extern	int TIFFInitDumpMode(TIFF*, int);
+extern  int TIFFInitDumpMode(TIFF*, int);
 #ifdef PACKBITS_SUPPORT
 #ifdef PACKBITS_SUPPORT
-extern	int TIFFInitPackBits(TIFF*, int);
+extern  int TIFFInitPackBits(TIFF*, int);
 #endif
 #endif
 #ifdef CCITT_SUPPORT
 #ifdef CCITT_SUPPORT
-extern	int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int);
-extern	int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int);
+extern  int TIFFInitCCITTRLE(TIFF*, int), TIFFInitCCITTRLEW(TIFF*, int);
+extern  int TIFFInitCCITTFax3(TIFF*, int), TIFFInitCCITTFax4(TIFF*, int);
 #endif
 #endif
 #ifdef THUNDER_SUPPORT
 #ifdef THUNDER_SUPPORT
-extern	int TIFFInitThunderScan(TIFF*, int);
+extern  int TIFFInitThunderScan(TIFF*, int);
 #endif
 #endif
 #ifdef NEXT_SUPPORT
 #ifdef NEXT_SUPPORT
-extern	int TIFFInitNeXT(TIFF*, int);
+extern  int TIFFInitNeXT(TIFF*, int);
 #endif
 #endif
 #ifdef LZW_SUPPORT
 #ifdef LZW_SUPPORT
-extern	int TIFFInitLZW(TIFF*, int);
+extern  int TIFFInitLZW(TIFF*, int);
 #endif
 #endif
 #ifdef OJPEG_SUPPORT
 #ifdef OJPEG_SUPPORT
-extern	int TIFFInitOJPEG(TIFF*, int);
+extern  int TIFFInitOJPEG(TIFF*, int);
 #endif
 #endif
 #ifdef JPEG_SUPPORT
 #ifdef JPEG_SUPPORT
-extern	int TIFFInitJPEG(TIFF*, int);
+extern  int TIFFInitJPEG(TIFF*, int);
 #endif
 #endif
 #ifdef JBIG_SUPPORT
 #ifdef JBIG_SUPPORT
-extern	int TIFFInitJBIG(TIFF*, int);
+extern  int TIFFInitJBIG(TIFF*, int);
 #endif
 #endif
 #ifdef ZIP_SUPPORT
 #ifdef ZIP_SUPPORT
-extern	int TIFFInitZIP(TIFF*, int);
+extern  int TIFFInitZIP(TIFF*, int);
 #endif
 #endif
 #ifdef PIXARLOG_SUPPORT
 #ifdef PIXARLOG_SUPPORT
-extern	int TIFFInitPixarLog(TIFF*, int);
+extern  int TIFFInitPixarLog(TIFF*, int);
 #endif
 #endif
 #ifdef LOGLUV_SUPPORT
 #ifdef LOGLUV_SUPPORT
-extern	int TIFFInitSGILog(TIFF*, int);
+extern  int TIFFInitSGILog(TIFF*, int);
 #endif
 #endif
 #ifdef VMS
 #ifdef VMS
-extern	const TIFFCodec _TIFFBuiltinCODECS[];
+extern  const TIFFCodec _TIFFBuiltinCODECS[];
 #else
 #else
-extern	TIFFCodec _TIFFBuiltinCODECS[];
+extern  TIFFCodec _TIFFBuiltinCODECS[];
 #endif
 #endif
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)

+ 170 - 170
panda/src/tiff/uvcode.h

@@ -1,173 +1,173 @@
 /* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */
 /* Version 1.0 generated April 7, 1997 by Greg Ward Larson, SGI */
-#define UV_SQSIZ	(float)0.003500
-#define UV_NDIVS	16289
-#define UV_VSTART	(float)0.016940
-#define UV_NVS		163
+#define UV_SQSIZ        (float)0.003500
+#define UV_NDIVS        16289
+#define UV_VSTART       (float)0.016940
+#define UV_NVS          163
 static struct {
 static struct {
-	float	ustart;
-	short	nus, ncum;
-}	uv_row[UV_NVS] = {
-	(float)0.247663,	4,	0,
-	(float)0.243779,	6,	4,
-	(float)0.241684,	7,	10,
-	(float)0.237874,	9,	17,
-	(float)0.235906,	10,	26,
-	(float)0.232153,	12,	36,
-	(float)0.228352,	14,	48,
-	(float)0.226259,	15,	62,
-	(float)0.222371,	17,	77,
-	(float)0.220410,	18,	94,
-	(float)0.214710,	21,	112,
-	(float)0.212714,	22,	133,
-	(float)0.210721,	23,	155,
-	(float)0.204976,	26,	178,
-	(float)0.202986,	27,	204,
-	(float)0.199245,	29,	231,
-	(float)0.195525,	31,	260,
-	(float)0.193560,	32,	291,
-	(float)0.189878,	34,	323,
-	(float)0.186216,	36,	357,
-	(float)0.186216,	36,	393,
-	(float)0.182592,	38,	429,
-	(float)0.179003,	40,	467,
-	(float)0.175466,	42,	507,
-	(float)0.172001,	44,	549,
-	(float)0.172001,	44,	593,
-	(float)0.168612,	46,	637,
-	(float)0.168612,	46,	683,
-	(float)0.163575,	49,	729,
-	(float)0.158642,	52,	778,
-	(float)0.158642,	52,	830,
-	(float)0.158642,	52,	882,
-	(float)0.153815,	55,	934,
-	(float)0.153815,	55,	989,
-	(float)0.149097,	58,	1044,
-	(float)0.149097,	58,	1102,
-	(float)0.142746,	62,	1160,
-	(float)0.142746,	62,	1222,
-	(float)0.142746,	62,	1284,
-	(float)0.138270,	65,	1346,
-	(float)0.138270,	65,	1411,
-	(float)0.138270,	65,	1476,
-	(float)0.132166,	69,	1541,
-	(float)0.132166,	69,	1610,
-	(float)0.126204,	73,	1679,
-	(float)0.126204,	73,	1752,
-	(float)0.126204,	73,	1825,
-	(float)0.120381,	77,	1898,
-	(float)0.120381,	77,	1975,
-	(float)0.120381,	77,	2052,
-	(float)0.120381,	77,	2129,
-	(float)0.112962,	82,	2206,
-	(float)0.112962,	82,	2288,
-	(float)0.112962,	82,	2370,
-	(float)0.107450,	86,	2452,
-	(float)0.107450,	86,	2538,
-	(float)0.107450,	86,	2624,
-	(float)0.107450,	86,	2710,
-	(float)0.100343,	91,	2796,
-	(float)0.100343,	91,	2887,
-	(float)0.100343,	91,	2978,
-	(float)0.095126,	95,	3069,
-	(float)0.095126,	95,	3164,
-	(float)0.095126,	95,	3259,
-	(float)0.095126,	95,	3354,
-	(float)0.088276,	100,	3449,
-	(float)0.088276,	100,	3549,
-	(float)0.088276,	100,	3649,
-	(float)0.088276,	100,	3749,
-	(float)0.081523,	105,	3849,
-	(float)0.081523,	105,	3954,
-	(float)0.081523,	105,	4059,
-	(float)0.081523,	105,	4164,
-	(float)0.074861,	110,	4269,
-	(float)0.074861,	110,	4379,
-	(float)0.074861,	110,	4489,
-	(float)0.074861,	110,	4599,
-	(float)0.068290,	115,	4709,
-	(float)0.068290,	115,	4824,
-	(float)0.068290,	115,	4939,
-	(float)0.068290,	115,	5054,
-	(float)0.063573,	119,	5169,
-	(float)0.063573,	119,	5288,
-	(float)0.063573,	119,	5407,
-	(float)0.063573,	119,	5526,
-	(float)0.057219,	124,	5645,
-	(float)0.057219,	124,	5769,
-	(float)0.057219,	124,	5893,
-	(float)0.057219,	124,	6017,
-	(float)0.050985,	129,	6141,
-	(float)0.050985,	129,	6270,
-	(float)0.050985,	129,	6399,
-	(float)0.050985,	129,	6528,
-	(float)0.050985,	129,	6657,
-	(float)0.044859,	134,	6786,
-	(float)0.044859,	134,	6920,
-	(float)0.044859,	134,	7054,
-	(float)0.044859,	134,	7188,
-	(float)0.040571,	138,	7322,
-	(float)0.040571,	138,	7460,
-	(float)0.040571,	138,	7598,
-	(float)0.040571,	138,	7736,
-	(float)0.036339,	142,	7874,
-	(float)0.036339,	142,	8016,
-	(float)0.036339,	142,	8158,
-	(float)0.036339,	142,	8300,
-	(float)0.032139,	146,	8442,
-	(float)0.032139,	146,	8588,
-	(float)0.032139,	146,	8734,
-	(float)0.032139,	146,	8880,
-	(float)0.027947,	150,	9026,
-	(float)0.027947,	150,	9176,
-	(float)0.027947,	150,	9326,
-	(float)0.023739,	154,	9476,
-	(float)0.023739,	154,	9630,
-	(float)0.023739,	154,	9784,
-	(float)0.023739,	154,	9938,
-	(float)0.019504,	158,	10092,
-	(float)0.019504,	158,	10250,
-	(float)0.019504,	158,	10408,
-	(float)0.016976,	161,	10566,
-	(float)0.016976,	161,	10727,
-	(float)0.016976,	161,	10888,
-	(float)0.016976,	161,	11049,
-	(float)0.012639,	165,	11210,
-	(float)0.012639,	165,	11375,
-	(float)0.012639,	165,	11540,
-	(float)0.009991,	168,	11705,
-	(float)0.009991,	168,	11873,
-	(float)0.009991,	168,	12041,
-	(float)0.009016,	170,	12209,
-	(float)0.009016,	170,	12379,
-	(float)0.009016,	170,	12549,
-	(float)0.006217,	173,	12719,
-	(float)0.006217,	173,	12892,
-	(float)0.005097,	175,	13065,
-	(float)0.005097,	175,	13240,
-	(float)0.005097,	175,	13415,
-	(float)0.003909,	177,	13590,
-	(float)0.003909,	177,	13767,
-	(float)0.002340,	177,	13944,
-	(float)0.002389,	170,	14121,
-	(float)0.001068,	164,	14291,
-	(float)0.001653,	157,	14455,
-	(float)0.000717,	150,	14612,
-	(float)0.001614,	143,	14762,
-	(float)0.000270,	136,	14905,
-	(float)0.000484,	129,	15041,
-	(float)0.001103,	123,	15170,
-	(float)0.001242,	115,	15293,
-	(float)0.001188,	109,	15408,
-	(float)0.001011,	103,	15517,
-	(float)0.000709,	97,	15620,
-	(float)0.000301,	89,	15717,
-	(float)0.002416,	82,	15806,
-	(float)0.003251,	76,	15888,
-	(float)0.003246,	69,	15964,
-	(float)0.004141,	62,	16033,
-	(float)0.005963,	55,	16095,
-	(float)0.008839,	47,	16150,
-	(float)0.010490,	40,	16197,
-	(float)0.016994,	31,	16237,
-	(float)0.023659,	21,	16268,
+        float   ustart;
+        short   nus, ncum;
+}       uv_row[UV_NVS] = {
+        (float)0.247663,        4,      0,
+        (float)0.243779,        6,      4,
+        (float)0.241684,        7,      10,
+        (float)0.237874,        9,      17,
+        (float)0.235906,        10,     26,
+        (float)0.232153,        12,     36,
+        (float)0.228352,        14,     48,
+        (float)0.226259,        15,     62,
+        (float)0.222371,        17,     77,
+        (float)0.220410,        18,     94,
+        (float)0.214710,        21,     112,
+        (float)0.212714,        22,     133,
+        (float)0.210721,        23,     155,
+        (float)0.204976,        26,     178,
+        (float)0.202986,        27,     204,
+        (float)0.199245,        29,     231,
+        (float)0.195525,        31,     260,
+        (float)0.193560,        32,     291,
+        (float)0.189878,        34,     323,
+        (float)0.186216,        36,     357,
+        (float)0.186216,        36,     393,
+        (float)0.182592,        38,     429,
+        (float)0.179003,        40,     467,
+        (float)0.175466,        42,     507,
+        (float)0.172001,        44,     549,
+        (float)0.172001,        44,     593,
+        (float)0.168612,        46,     637,
+        (float)0.168612,        46,     683,
+        (float)0.163575,        49,     729,
+        (float)0.158642,        52,     778,
+        (float)0.158642,        52,     830,
+        (float)0.158642,        52,     882,
+        (float)0.153815,        55,     934,
+        (float)0.153815,        55,     989,
+        (float)0.149097,        58,     1044,
+        (float)0.149097,        58,     1102,
+        (float)0.142746,        62,     1160,
+        (float)0.142746,        62,     1222,
+        (float)0.142746,        62,     1284,
+        (float)0.138270,        65,     1346,
+        (float)0.138270,        65,     1411,
+        (float)0.138270,        65,     1476,
+        (float)0.132166,        69,     1541,
+        (float)0.132166,        69,     1610,
+        (float)0.126204,        73,     1679,
+        (float)0.126204,        73,     1752,
+        (float)0.126204,        73,     1825,
+        (float)0.120381,        77,     1898,
+        (float)0.120381,        77,     1975,
+        (float)0.120381,        77,     2052,
+        (float)0.120381,        77,     2129,
+        (float)0.112962,        82,     2206,
+        (float)0.112962,        82,     2288,
+        (float)0.112962,        82,     2370,
+        (float)0.107450,        86,     2452,
+        (float)0.107450,        86,     2538,
+        (float)0.107450,        86,     2624,
+        (float)0.107450,        86,     2710,
+        (float)0.100343,        91,     2796,
+        (float)0.100343,        91,     2887,
+        (float)0.100343,        91,     2978,
+        (float)0.095126,        95,     3069,
+        (float)0.095126,        95,     3164,
+        (float)0.095126,        95,     3259,
+        (float)0.095126,        95,     3354,
+        (float)0.088276,        100,    3449,
+        (float)0.088276,        100,    3549,
+        (float)0.088276,        100,    3649,
+        (float)0.088276,        100,    3749,
+        (float)0.081523,        105,    3849,
+        (float)0.081523,        105,    3954,
+        (float)0.081523,        105,    4059,
+        (float)0.081523,        105,    4164,
+        (float)0.074861,        110,    4269,
+        (float)0.074861,        110,    4379,
+        (float)0.074861,        110,    4489,
+        (float)0.074861,        110,    4599,
+        (float)0.068290,        115,    4709,
+        (float)0.068290,        115,    4824,
+        (float)0.068290,        115,    4939,
+        (float)0.068290,        115,    5054,
+        (float)0.063573,        119,    5169,
+        (float)0.063573,        119,    5288,
+        (float)0.063573,        119,    5407,
+        (float)0.063573,        119,    5526,
+        (float)0.057219,        124,    5645,
+        (float)0.057219,        124,    5769,
+        (float)0.057219,        124,    5893,
+        (float)0.057219,        124,    6017,
+        (float)0.050985,        129,    6141,
+        (float)0.050985,        129,    6270,
+        (float)0.050985,        129,    6399,
+        (float)0.050985,        129,    6528,
+        (float)0.050985,        129,    6657,
+        (float)0.044859,        134,    6786,
+        (float)0.044859,        134,    6920,
+        (float)0.044859,        134,    7054,
+        (float)0.044859,        134,    7188,
+        (float)0.040571,        138,    7322,
+        (float)0.040571,        138,    7460,
+        (float)0.040571,        138,    7598,
+        (float)0.040571,        138,    7736,
+        (float)0.036339,        142,    7874,
+        (float)0.036339,        142,    8016,
+        (float)0.036339,        142,    8158,
+        (float)0.036339,        142,    8300,
+        (float)0.032139,        146,    8442,
+        (float)0.032139,        146,    8588,
+        (float)0.032139,        146,    8734,
+        (float)0.032139,        146,    8880,
+        (float)0.027947,        150,    9026,
+        (float)0.027947,        150,    9176,
+        (float)0.027947,        150,    9326,
+        (float)0.023739,        154,    9476,
+        (float)0.023739,        154,    9630,
+        (float)0.023739,        154,    9784,
+        (float)0.023739,        154,    9938,
+        (float)0.019504,        158,    10092,
+        (float)0.019504,        158,    10250,
+        (float)0.019504,        158,    10408,
+        (float)0.016976,        161,    10566,
+        (float)0.016976,        161,    10727,
+        (float)0.016976,        161,    10888,
+        (float)0.016976,        161,    11049,
+        (float)0.012639,        165,    11210,
+        (float)0.012639,        165,    11375,
+        (float)0.012639,        165,    11540,
+        (float)0.009991,        168,    11705,
+        (float)0.009991,        168,    11873,
+        (float)0.009991,        168,    12041,
+        (float)0.009016,        170,    12209,
+        (float)0.009016,        170,    12379,
+        (float)0.009016,        170,    12549,
+        (float)0.006217,        173,    12719,
+        (float)0.006217,        173,    12892,
+        (float)0.005097,        175,    13065,
+        (float)0.005097,        175,    13240,
+        (float)0.005097,        175,    13415,
+        (float)0.003909,        177,    13590,
+        (float)0.003909,        177,    13767,
+        (float)0.002340,        177,    13944,
+        (float)0.002389,        170,    14121,
+        (float)0.001068,        164,    14291,
+        (float)0.001653,        157,    14455,
+        (float)0.000717,        150,    14612,
+        (float)0.001614,        143,    14762,
+        (float)0.000270,        136,    14905,
+        (float)0.000484,        129,    15041,
+        (float)0.001103,        123,    15170,
+        (float)0.001242,        115,    15293,
+        (float)0.001188,        109,    15408,
+        (float)0.001011,        103,    15517,
+        (float)0.000709,        97,     15620,
+        (float)0.000301,        89,     15717,
+        (float)0.002416,        82,     15806,
+        (float)0.003251,        76,     15888,
+        (float)0.003246,        69,     15964,
+        (float)0.004141,        62,     16033,
+        (float)0.005963,        55,     16095,
+        (float)0.008839,        47,     16150,
+        (float)0.010490,        40,     16197,
+        (float)0.016994,        31,     16237,
+        (float)0.023659,        21,     16268,
 };
 };

+ 1 - 1
pandatool/src/eggprogs/eggTextureCards.cxx

@@ -298,7 +298,7 @@ run() {
       poly->set_texture(tref);
       poly->set_texture(tref);
       poly->set_color(_polygon_color);
       poly->set_color(_polygon_color);
       if (_apply_bface){
       if (_apply_bface){
-	poly->set_bface_flag(1);
+        poly->set_bface_flag(1);
       }
       }
 
 
       poly->add_vertex(v1);
       poly->add_vertex(v1);