/usr/include/ossim/vpfutil/polygrf.h is in libossim-dev 1.8.16-4ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | /* POLYGRF.H */
#ifndef POLYGRF_H
#define POLYGRF_H
#include <ossim/vpfutil/protomas.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
int x,y;
} IPoint;
typedef struct
{
IPoint origin;
IPoint delta;
} ISegment;
typedef struct
{
IPoint at;
int Eprim,toggle,maximum;
IPoint signs;
struct {
int inc,step;
} errors;
} BresSegment;
typedef struct {
IPoint origin;
IPoint delta;
} IBox;
typedef struct
{
struct
{
float x,y;
} scale;
IPoint offset;
} ITransform;
#define TRANSFORMSPACE 0
#define USERSPACE 1
typedef unsigned char Color;
typedef struct
{
unsigned char type,width,height;
union {
long pad;
unsigned char *list;
struct {
unsigned char ll,lr,ul,ur;
} vpfPatternSmall;
} vpfPatterData;
} vpfPattern;
typedef struct {
IBox bounding;
int depth;
int rowcount;
unsigned char *array;
} BitArray;
typedef struct {
IPoint bounding;
int rowcount;
unsigned char *array;
} ArrayOfBits;
typedef struct
{
ArrayOfBits Bordermap,Maskmap;
ITransform transform;
int pointcount;
IPoint first;
int secx;
int llx;
IPoint turnpoint;
IPoint prev;
Color line;
vpfPattern fill;
IBox bounding; /* Original bounding box on the screen */
} Shademap;
#define isBox(BOX) ((BOX.delta.x >= 0)&&(BOX.delta.y >= 0))
/********************************************************
* POLYGRF.C Definitions
*******************************************************/
ISegment MakeISegment( IPoint from,
IPoint to );
IBox MakeIBox( IPoint from,
IPoint to );
ITransform MakeITransform( IBox from,
IBox to );
IPoint TranslateIPoint( ITransform transform,
IPoint a,
int flag );
ISegment TranslateISegment( ITransform transform,
ISegment a,
int flay );
IBox TranslateIBox( ITransform transform,
IBox a,
int flag );
/* _UNUSED_
IPoint Iintersect ( ISegment, ISegment );
float Iturn ( ISegment, IPoint );
*/
IBox AndIBox( IBox a,
IBox b );
/* OTHER DEFS. CANT FIND WHERE THEY ARE USED
ISegment ISegmentClipIBox ( IBox, ISegment );
BitArray MakeBitArray EXT3( int, int, int );
int FreeBitArray EXT1( BitArray );
int GetBitPoint EXT2( BitArray, ipoint );
int ClearBitArray EXT1( BitArray );
int SetBitArray EXT2( BitArray, int );
int AndBitArray EXT2( BitArray, int );
int OrBitArray EXT2( BitArray, int );
int XorBitArray EXT2( BitArray, int );
int SetBitPoint EXT3( BitArray, IPoint, int );
int AndBitPoint EXT3( BitArray, IPoint, int );
int OrBitPoint EXT3( BitArray, IPoint, int );
int XorBitPoint EXT3( BitArray, IPoint, int );
int SetBitLine EXT3( BitArray, ISegment, int );
int AndBitLine EXT3( BitArray, ISegment, int );
int OrBitLine EXT3( BitArray, ISegment, int );
int XorBitLine EXT3( BitArray, ISegment, int );
int SetBitWedge EXT4( BitArray, ISegment, IPoint, int );
int AndBitWedge EXT4( BitArray, ISegment, IPoint, int );
int OrBitWedge EXT4( BitArray, ISegment, IPoint, int );
int XorBitWedge EXT4( BitArray, ISegment, IPoint, int );
int SetBitBox EXT3( BitArray, IBox, int );
int AndBitBox EXT3( BitArray, IBox, int );
int OrBitBox EXT3( BitArray, IBox, int );
int XorBitBox EXT3( BitArray, IBox, int );
int SetBitMask EXT4( BitArray, BitArray, IPoint, int );
int AndBitMask EXT4( BitArray, BitArray, IPoint, int );
int OrBitMask EXT4( BitArray, BitArray, IPoint, int );
int XorBitMask EXT4( BitArray, BitArray, IPoint, int );
*/
/***********************************************************************
* end polygrf.c definitions
**********************************************************************/
/***********************************************************************
* BITARRAY.C TYPES
**********************************************************************/
#include <ossim/vpfutil/xmemory.h>
#define MINIMUM(x,y) (((x) > (y))? (y) : (x))
#define MAXIMUM(x,y) (((x) < (y))? (y) : (x))
#define OUTSIDE(MAP,VPF_POINT_STRUCT)\
((VPF_POINT_STRUCT.x < 0)|| \
(VPF_POINT_STRUCT.y < 0)|| \
(VPF_POINT_STRUCT.x > MAP.bounding.x)|| \
(VPF_POINT_STRUCT.y > MAP.bounding.y))
#define OUTSIDE_X(MAP,value) (((value)< 0)||((value)> MAP.bounding.x))
#define OUTSIDE_Y(MAP,value) (((value)< 0)||((value)> MAP.bounding.y))
#define GETBIT(MAP,VPF_POINT_STRUCT) \
(((MAP.array[(((VPF_POINT_STRUCT.y)*(MAP.rowcount))+((VPF_POINT_STRUCT.x)>>3))])&(1<<((VPF_POINT_STRUCT.x)%8)))? 1: 0)
#define SETBIT(MAP,VPF_POINT_STRUCT) \
((MAP.array[(((VPF_POINT_STRUCT.y)*(MAP.rowcount))+((VPF_POINT_STRUCT.x)>>3))]) |= (1<<((VPF_POINT_STRUCT.x)%8)))
#define CLEARBIT(MAP,VPF_POINT_STRUCT) \
((MAP.array[(((VPF_POINT_STRUCT.y)*(MAP.rowcount))+((VPF_POINT_STRUCT.x)>>3))]) &= ~(1<<((VPF_POINT_STRUCT.x)%8)))
#define TOGGLEBIT(MAP,VPF_POINT_STRUCT) \
((MAP.array[(((VPF_POINT_STRUCT.y)*(MAP.rowcount))+((VPF_POINT_STRUCT.x)>>3))]) ^= (1<<((VPF_POINT_STRUCT.x)%8)))
#define LEFTBITS(INDEX) (255&(~(255<<(1+(INDEX)))))
#define RIGHTBITS(INDEX) (255&(~(255>>(8-(INDEX)))))
#define FILLBRESSEG(bseg,seg) \
{ \
int tempx,tempy; \
bseg.signs.x = (seg.delta.x < 0) ? -1: 1; \
bseg.signs.y = (seg.delta.y < 0) ? -1: 1; \
tempx = seg.delta.x * bseg.signs.x; \
tempy = seg.delta.y * bseg.signs.y; \
bseg.at = seg.origin; \
\
if (tempy > tempx) \
{ \
bseg.Eprim = (tempx<<1) - tempy; \
bseg.errors.inc = (tempx<<1); \
bseg.errors.step = (tempx<<1) - (tempy<<1); \
bseg.maximum = tempy; \
bseg.toggle = 1; \
} \
else \
{ \
bseg.Eprim = (tempy<<1) - tempx; \
bseg.errors.inc = (tempy<<1); \
bseg.errors.step = (tempy<<1) - (tempx<<1); \
bseg.maximum = tempx; \
bseg.toggle = 0; \
} \
}
#define STEP(bseg) \
if (bseg.maximum){ \
if(bseg.Eprim<0) \
{ \
bseg.Eprim += bseg.errors.inc; \
if (bseg.toggle) \
bseg.at.y += bseg.signs.y; \
else \
bseg.at.x += bseg.signs.x; \
bseg.maximum--; \
} \
else \
{ \
bseg.Eprim += bseg.errors.step; \
bseg.at.x += bseg.signs.x; \
bseg.at.y += bseg.signs.y; \
bseg.maximum--; \
} \
}
/***********************************************************************
* BITARRAY.C DEFINITIONS
**********************************************************************/
void SETROW( ArrayOfBits MAP,
int XMIN,
int XMAX,
int Y );
void CLEARROW( ArrayOfBits MAP,
int XMIN,
int XMAX,
int Y );
void TOGGLEROW( ArrayOfBits MAP,
int XMIN,
int XMAX,
int Y );
void SETCOLUMN( ArrayOfBits MAP,
int X,
int YMIN,
int YMAX );
void CLEARCOLUMN( ArrayOfBits MAP,
int X,
int YMIN,
int YMAX );
void TOGGLECOLUMN( ArrayOfBits MAP,
int X,
int YMIN,
int YMAX );
ArrayOfBits MakeArrayOfBits( int deltaX,
int deltaY );
int FreeArrayOfBits( ArrayOfBits map );
int ClearArrayOfBits( ArrayOfBits map );
int PointGetBit( ArrayOfBits map,
IPoint point );
int PointSetBit( ArrayOfBits map,
IPoint at,
int value );
int PointAndBit( ArrayOfBits map,
IPoint at,
int value );
int PointOrBit( ArrayOfBits map,
IPoint at,
int value );
int PointXorBit( ArrayOfBits map,
IPoint at,
int value );
int LineSetBit( ArrayOfBits map,
ISegment seg,
int value );
int LineAndBit( ArrayOfBits map,
ISegment seg,
int value );
int LineOrBit( ArrayOfBits map,
ISegment seg,
int value );
int LineXorBit( ArrayOfBits map,
ISegment seg,
int value );
/* THESE PROCEDURES NOT DEFINED
int WedgeSetBit EXT4( ArrayOfBits, ISegment, IPoint, int );
int WedgeAndBit EXT4( ArrayOfBits, ISegment, IPoint, int );
int WedgeOrBit EXT4( ArrayOfBits, ISegment, IPoint, int );
int WedgeXorBit EXT4( ArrayOfBits, ISegment, IPoint, int );
*/
int BoxSetBit( ArrayOfBits map,
IBox box,
int value );
int BoxAndBit( ArrayOfBits map,
IBox box,
int value );
int BoxOrBit( ArrayOfBits map,
IBox box,
int value );
int BoxXorBit( ArrayOfBits map,
IBox box,
int value );
int TrapezoidSetBit( ArrayOfBits map,
ISegment seg,
int value );
int TrapezoidAndBit( ArrayOfBits map,
ISegment seg,
int value );
int TrapezoidOrBit( ArrayOfBits map,
ISegment seg,
int value );
int TrapezoidXorBit( ArrayOfBits map,
ISegment seg,
int value );
int SetArrayOfBits( ArrayOfBits map,
int value );
int AndArrayOfBits( ArrayOfBits map,
int value );
int OrArrayOfBits( ArrayOfBits map,
ISegment seg,
int value );
int XorArrayOfBits( ArrayOfBits map,
ISegment seg,
int value);
/***********************************************************************
* end of bitarray.c definitions
**********************************************************************/
/***********************************************************************
* Shademap.c definitions
**********************************************************************/
#define SOLID 0
#define STRIPS 1
#define STRIPES 1
#define SIMPLE 2
/* #define COMPLEX_FEATURE 3 */
Shademap *OpenShade( IBox bounding,
IBox window,
Color line,
vpfPattern fill );
int ModifyShade( Shademap *smap,
Color line,
vpfPattern fill );
int WriteShade( Shademap *smap,
IPoint point );
int CloseLoop( Shademap *smap );
int CloseShade( Shademap *smap );
int OutShade( Shademap *smap );
vpfPattern MakePattern( int ll,
int lr,
int ul,
int ur );
/***************************************************************************
* end shademap.c definitions
**************************************************************************/
#ifdef __cplusplus
}
#endif
#endif
|