Changeset 28855 for trunk/Ohana/src/libdvo
- Timestamp:
- Aug 5, 2010, 2:29:00 PM (16 years ago)
- Location:
- trunk/Ohana/src/libdvo
- Files:
-
- 2 edited
-
include/dvo.h (modified) (1 diff)
-
src/dvo_photcode_ops.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/include/dvo.h
r27817 r28855 318 318 319 319 PhotCodeData *GetPhotcodeTable (void); 320 void SetPhotcodeTable (PhotCodeData *); 321 322 int *GetSecFiltMap(PhotCodeData *ouput, PhotCodeData* input); 320 323 321 324 int LoadPhotcodes (char *catdir_file, char *master_file, int readwrite); -
trunk/Ohana/src/libdvo/src/dvo_photcode_ops.c
r24974 r28855 21 21 PhotCodeData *GetPhotcodeTable () { 22 22 23 /* allocate space to photcode table, free existing data */24 23 if (photcodes == NULL) { 24 /* allocate space to photcode table */ 25 25 ALLOCATE (photcodes, PhotCodeData, 1); 26 26 photcodes[0].code = NULL; 27 27 } 28 28 return photcodes; 29 } 30 31 // set the photcode table. This is used to switch between serveral previously 32 // allocated tables 33 void SetPhotcodeTable (PhotCodeData *new) { 34 photcodes = new; 29 35 } 30 36 … … 531 537 } 532 538 539 // Create a map between the secfilt values from one photcode table to another 540 int *GetSecFiltMap(PhotCodeData *output, PhotCodeData *input) { 541 int i; 542 int NsecfiltIn = input[0].Nsecfilt; 543 int *map; 544 ALLOCATE(map, int, NsecfiltIn); 545 546 // loop over entries 547 for (i = 0; i < NsecfiltIn; i++) { 548 int code = input[0].codeNsec[i]; 549 int entry = output[0].hashcode[code]; 550 if (entry == -1) { 551 // entry is missing 552 free(map); 553 return(FALSE); 554 } 555 map[i] = entry; 556 } 557 558 return map; 559 } 560 533 561 /* photcode table should have the following format: 534 562
Note:
See TracChangeset
for help on using the changeset viewer.
