226 # define mitkIpPicDEBUG
241 # include <windows.h>
242 extern DWORD ipWinFread(LPSTR ptr, DWORD size, DWORD n, FILE *stream);
252 #ifdef mitkIpPicDEBUG
259 #define mitkIpPicVERSION "PIC VERSION 3.00 "
260 #define mitkIpPicVERSIONe "PIC VERSION 3.00e "
261 #define _mitkIpPicNDIM 8
262 #define _mitkIpPicTAGLEN 32
265 #if (THIS_IS_BIG_ENDIAN) || defined (_IBMR2) || (mc68000) || (sun) || (__convex__) || (__hppa) || (_MIPSEB) || defined ( __PPC__)
266 # define _mitkIpENDIAN_IS_BIG
268 # define _mitkIpENDIAN_IS_LITTLE
272 #define mitkIpPicVersionMajor(pic) (mitkIpUInt1_t)(pic->info->version[12] - '0')
273 #define mitkIpPicVersionMinor(pic) (mitkIpUInt1_t)(10 * (pic->info->version[14]-'0' ) \
274 + pic->info->version[15]-'0')
275 #define mitkIpPicEncryptionType(pic) (pic->info->version[16])
281 #define mitkIpPicDR(type,len) (mitkIpUInt4_t)( ((type)<<16) + (len) )
283 #define mitkIpPicFOR_TYPE( _ipPIC_TYPE, _ipPIC_CMD, _ipPIC_PIC) \
284 _ipPIC_CMD(_ipPIC_TYPE,_ipPIC_PIC)
286 #define mitkIpPicFORALL( _ipPIC_CMD, _ipPIC_PIC ) \
287 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
289 case mitkIpPicDR( mitkIpPicInt, 8 ): \
290 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC); \
292 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
293 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC); \
295 case mitkIpPicDR( mitkIpPicInt, 16 ): \
296 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC); \
298 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
299 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC); \
301 case mitkIpPicDR( mitkIpPicInt, 32 ): \
302 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC); \
304 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
305 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC); \
307 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
308 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC); \
310 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
311 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC); \
315 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
316 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
320 #define mitkIpPicFORALL_1( _ipPIC_CMD, _ipPIC_PIC, A1 ) \
321 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
323 case mitkIpPicDR( mitkIpPicInt, 8 ): \
324 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1); \
326 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
327 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1); \
329 case mitkIpPicDR( mitkIpPicInt, 16 ): \
330 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1); \
332 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
333 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1); \
335 case mitkIpPicDR( mitkIpPicInt, 32 ): \
336 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1); \
338 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
339 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1); \
341 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
342 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1); \
344 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
345 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1); \
349 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
350 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
354 #define mitkIpPicFORALL_2( _ipPIC_CMD, _ipPIC_PIC, A1, A2 ) \
355 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
357 case mitkIpPicDR( mitkIpPicInt, 8 ): \
358 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2); \
360 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
361 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2); \
363 case mitkIpPicDR( mitkIpPicInt, 16 ): \
364 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2); \
366 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
367 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2); \
369 case mitkIpPicDR( mitkIpPicInt, 32 ): \
370 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2); \
372 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
373 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2); \
375 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
376 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2); \
378 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
379 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2); \
383 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
384 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
388 #define mitkIpPicFORALL_3( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3 ) \
389 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
391 case mitkIpPicDR( mitkIpPicInt, 8 ): \
392 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3); \
394 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
395 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3); \
397 case mitkIpPicDR( mitkIpPicInt, 16 ): \
398 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3); \
400 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
401 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3); \
403 case mitkIpPicDR( mitkIpPicInt, 32 ): \
404 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3); \
406 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
407 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3); \
409 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
410 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3); \
412 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
413 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3); \
417 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
418 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
422 #define mitkIpPicFORALL_4( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4 ) \
423 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
425 case mitkIpPicDR( mitkIpPicInt, 8 ): \
426 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4); \
428 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
429 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4); \
431 case mitkIpPicDR( mitkIpPicInt, 16 ): \
432 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4); \
434 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
435 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4); \
437 case mitkIpPicDR( mitkIpPicInt, 32 ): \
438 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4); \
440 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
441 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4); \
443 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
444 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4); \
446 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
447 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4); \
451 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
452 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
456 #define mitkIpPicFORALL_5( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4, A5 ) \
457 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
459 case mitkIpPicDR( mitkIpPicInt, 8 ): \
460 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
462 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
463 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
465 case mitkIpPicDR( mitkIpPicInt, 16 ): \
466 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
468 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
469 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
471 case mitkIpPicDR( mitkIpPicInt, 32 ): \
472 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
474 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
475 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
477 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
478 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
480 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
481 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4, A5); \
485 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
486 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
490 #define mitkIpPicFORALL_6( _ipPIC_CMD, _ipPIC_PIC, A1, A2, A3, A4, A5, A6 ) \
491 switch( mitkIpPicDR((_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe) ) \
493 case mitkIpPicDR( mitkIpPicInt, 8 ): \
494 _ipPIC_CMD(mitkIpInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
496 case mitkIpPicDR( mitkIpPicUInt, 8 ): \
497 _ipPIC_CMD(mitkIpUInt1_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
499 case mitkIpPicDR( mitkIpPicInt, 16 ): \
500 _ipPIC_CMD(mitkIpInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
502 case mitkIpPicDR( mitkIpPicUInt, 16 ): \
503 _ipPIC_CMD(mitkIpUInt2_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
505 case mitkIpPicDR( mitkIpPicInt, 32 ): \
506 _ipPIC_CMD(mitkIpInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
508 case mitkIpPicDR( mitkIpPicUInt, 32 ): \
509 _ipPIC_CMD(mitkIpUInt4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
511 case mitkIpPicDR( mitkIpPicFloat, 32 ): \
512 _ipPIC_CMD(mitkIpFloat4_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
514 case mitkIpPicDR( mitkIpPicFloat, 64 ): \
515 _ipPIC_CMD(mitkIpFloat8_t, _ipPIC_PIC, A1, A2, A3, A4, A5, A6); \
519 "sorry, %s: datatype (%i/%i) not supported for %s.\n", \
520 __FILE__, (_ipPIC_PIC)->type, (_ipPIC_PIC)->bpe, #_ipPIC_CMD ); \
524 #define _mitkIpPicGET_PIXEL(TYPE,PIC,X,Y,RESULT) \
526 TYPE* data = (TYPE *) (PIC)->data \
527 + (X) + (Y) * (PIC)->n[0]; \
531 #define _mitkIpPicPUT_PIXEL(TYPE,PIC,X,Y,VALUE) \
533 TYPE* data = (TYPE *) (PIC)->data \
534 + (X) + (Y) * (PIC)->n[0]; \
538 #define mitkIpPicGET_PIXEL(PIC,X,Y,RESULT) \
540 mitkIpPicFORALL_3(_mitkIpPicGET_PIXEL,PIC,X,Y,RESULT); \
543 #define mitkIpPicPUT_PIXEL(PIC,X,Y,RESULT) \
545 mitkIpPicFORALL_3(_mitkIpPicPUT_PIXEL,PIC,X,Y,RESULT); \
548 #define _mitkIpPicGET_PIXEL_RGB(TYPE,PIC,X,Y,R,G,B) \
550 mitkIpUInt4_t skip = (PIC)->n[0] * (PIC)->n[1]; \
551 TYPE* data = (TYPE *) (PIC)->data + (X) + (Y) * (PIC)->n[0]; \
553 G = *(data + skip); \
554 B = *(data + skip + skip); \
557 #define _mitkIpPicPUT_PIXEL_RGB(TYPE,PIC,X,Y,R,G,B) \
559 mitkIpUInt4_t skip = (PIC)->n[0] * (PIC)->n[1]; \
560 TYPE* data = (TYPE *) (PIC)->data + (X) + (Y) * (PIC)->n[0]; \
562 *(data + skip) = (G); \
563 *(data + skip + skip) = (B); \
566 #define mitkIpPicGET_PIXEL_RGB(PIC,X,Y,R,G,B) \
568 mitkIpPicFORALL_5(_mitkIpPicGET_PIXEL_RGB,PIC,X,Y,R,G,B); \
571 #define mitkIpPicPUT_PIXEL_RGB(PIC,X,Y,R,G,B) \
573 mitkIpPicFORALL_5(_mitkIpPicPUT_PIXEL_RGB,PIC,X,Y,R,G,B); \
579 # define mitkIpPicFile_t gzFile
580 # define mitkIpPicFOpen gzopen
581 # define mitkIpPicFTell gztell
582 # define mitkIpPicFSeek gzseek
583 # define mitkIpPicFRead(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
584 # define mitkIpPicFWrite _mitkIpPicFWrite
585 # define mitkIpPicFEOF gzeof
586 # define mitkIpPicFClose gzclose
587 # include "itk_zlib.h"
589 # define mitkIpPicFile_t gzFile
590 # define mitkIpPicFOpen gzopen
591 # define mitkIpPicFTell gztell
592 # define mitkIpPicFSeek gzseek
593 # define mitkIpPicFRead(buf, bsize, count, file) gzread((file),(buf),((count)*(bsize)))
594 # define mitkIpPicFWrite _mitkIpPicFWrite
595 # define mitkIpPicFEOF gzeof
596 # define mitkIpPicFClose gzclose
600 # define mitkIpPicFile_t FILE *
601 # define mitkIpPicFOpen fopen
602 # define mitkIpPicFTell ftell
603 # define mitkIpPicFSeek fseek
604 # define mitkIpPicFRead fread
605 # define mitkIpPicFWrite fwrite
606 # define mitkIpPicFEOF feof
607 # define mitkIpPicFClose fclose
611 #ifdef _mitkIpENDIAN_IS_LITTLE
612 # define mitkIpPicFReadLE mitkIpPicFRead
613 # define mitkIpPicFReadBE mitkIpPicFReadCvt
615 # define mitkIpPicFReadLE mitkIpPicFReadCvt
616 # define mitkIpPicFReadBE mitkIpPicFRead
619 #ifdef _mitkIpENDIAN_IS_LITTLE
620 # define mitkIpPicFWriteLE mitkIpPicFWrite
621 # define mitkIpPicFWriteBE mitkIpPicFWriteCvt
623 # define mitkIpPicFWriteLE mitkIpPicFWriteCvt
624 # define mitkIpPicFWriteBE mitkIpPicFWrite
628 #ifdef _mitkIpENDIAN_IS_LITTLE
629 # define mitkIpFReadLE fread
630 # define mitkIpFReadBE mitkIpFReadCvt
632 # define mitkIpFReadLE mitkIpFReadCvt
633 # define mitkIpFReadBE fread
636 #ifdef _mitkIpENDIAN_IS_LITTLE
637 # define mitkIpFWriteLE fwrite
638 # define mitkIpFWriteBE mitkIpFWriteCvt
640 # define mitkIpFWriteLE mitkIpFWriteCvt
641 # define mitkIpFWriteBE fwrite
646 # undef mitkIpFReadLE
647 # define mitkIpFReadLE fread
652 #ifdef _mitkIpENDIAN_IS_LITTLE
653 # define mitkIpCvtFromLE(data, len, bytes)
654 # define mitkIpCvtFromBE(data, len, bytes) _mitkIpCvtEndian( (data), (len), (bytes) )
656 # define mitkIpCvtFromLE(data, len, bytes) _mitkIpCvtEndian( (data), (len), (bytes) )
657 # define mitkIpCvtFromBE(data, len, bytes)
660 #ifdef _mitkIpENDIAN_IS_LITTLE
661 # define mitkIpCpFromLE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
662 # define mitkIpCpFromBE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
664 # define mitkIpCpFromLE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
665 # define mitkIpCpFromBE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
668 #ifdef _mitkIpENDIAN_IS_LITTLE
669 # define mitkIpCpToLE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
670 # define mitkIpCpToBE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
672 # define mitkIpCpToLE(source, destination, len, bytes) _mitkIpCpCvtEndian( (source), (destination), (len), (bytes) )
673 # define mitkIpCpToBE(source, destination, len, bytes) _mitkIpCp( (source), (destination), (len) )
677 #define mitkIpEndianSwap2(x) ((((x) >> 8) & 0x00FF) | (((x) << 8) & 0xFF00))
679 #define mitkIpEndianSwap4(x) ((((x) >> 24) & 0x000000FF) | (((x) << 24) & 0xFF000000)) \
680 | ((((x) >> 8) & 0x0000FF00) | (((x) << 8) & 0x00FF0000))
688 #ifdef _mitkIpENDIAN_IS_LITTLE
689 # define mitkIpInt2FromLE(from, to) *((mitkIpInt2_t *)(to)) = *((mitkIpInt2_t *)(from))
690 # define mitkIpInt4FromLE(from, to) *((mitkIpInt4_t *)(to)) = *((mitkIpInt4_t *)(from))
691 # define mitkIpUInt2FromLE(from, to) mitkIpInt2FromLE(from, to)
692 # define mitkIpUInt4FromLE(from, to) mitkIpInt4FromLE(from, to)
693 # define mitkIpFloat4FromLE(from, to) mitkIpInt4FromLE(from, to)
694 # define mitkIpFloat8FromLE(from, to) *((mitkIpFloat8_t *)(to)) = *((mitkIpFloat8_t *)(from))
696 # define mitkIpInt2FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[1]; \
697 ((char *)(to))[1] = ((char *)(from))[0];
699 # define mitkIpInt4FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[3]; \
700 ((char *)(to))[1] = ((char *)(from))[2]; \
701 ((char *)(to))[2] = ((char *)(from))[1]; \
702 ((char *)(to))[3] = ((char *)(from))[0];
703 # define mitkIpUInt2FromLE(from, to) mitkIpInt2FromLE(from, to)
704 # define mitkIpUInt4FromLE(from, to) mitkIpInt4FromLE(from, to)
705 # define mitkIpFloat4FromLE(from, to) mitkIpInt4FromLE(from, to)
706 # define mitkIpFloat8FromLE(from, to) ((char *)(to))[0] = ((char *)(from))[7]; \
707 ((char *)(to))[1] = ((char *)(from))[6]; \
708 ((char *)(to))[2] = ((char *)(from))[5]; \
709 ((char *)(to))[3] = ((char *)(from))[4]; \
710 ((char *)(to))[4] = ((char *)(from))[3]; \
711 ((char *)(to))[5] = ((char *)(from))[2]; \
712 ((char *)(to))[6] = ((char *)(from))[1]; \
713 ((char *)(to))[7] = ((char *)(from))[0];
719 #define mitkIpInt2ToLE(from, to) mitkIpInt2FromLE(from, to)
720 #define mitkIpInt4ToLE(from, to) mitkIpInt4FromLE(from, to)
721 #define mitkIpUInt2ToLE(from, to) mitkIpUInt2FromLE(from, to)
722 #define mitkIpUInt4ToLE(from, to) mitkIpUInt4FromLE(from, to)
723 #define mitkIpFloat4ToLE(from, to) mitkIpFloat4FromLE(from, to)
724 #define mitkIpFloat8ToLE(from, to) mitkIpFloat8FromLE(from, to)
799 #if defined(__cplusplus) || defined(c_plusplus)
805 extern void _mitkIpCp(
void *source,
void *destination,
unsigned long int len );
806 extern void _mitkIpCvtEndian(
void *data,
unsigned long int len,
unsigned char bytes );
807 extern void _mitkIpCpCvtEndian(
void *source,
void *destination,
unsigned long int len,
unsigned char bytes );
816 extern size_t mitkIpFReadCvt(
void *ptr,
size_t size,
size_t nitems, FILE *stream );
817 extern size_t _mitkIpFWrite(
void *ptr,
size_t size,
size_t nitems, FILE *stream );
819 #define _mitkIpPicHAS_CAN_READ_COMPRESSED
823 #define _mitkIpPicHAS_CAN_WRITE_COMPRESSED
832 #
if defined(__cplusplus) || defined(c_plusplus)
886 #define _mitkIpPicInfoNORMAL 0
887 #define _mitkIpPicInfoSHORT (1 << 0)
893 #if defined(__cplusplus) || defined(c_plusplus)
900 #ifdef MITK_UNMANGLE_IPPIC
901 #include "mitkIpPicUnmangle.h"
void _mitkIpPicWriteTagsMem(_mitkIpPicTagsElement_t *head, mitkIpUInt1_t **mem_ptr)
mitkIpBool_t _mitkIpPicCanReadCompressed
mitkIpPicTSV_t * mitkIpPicQuerySubTag(mitkIpPicTSV_t *parent, const char *t)
mitkIpUInt4_t _mitkIpPicTSVElements(mitkIpPicTSV_t *tsv)
mitkIpPicDescriptor * mitkIpPicGetHeader(const char *picfile_name, mitkIpPicDescriptor *pic)
void _mitkIpPicInfoPrintTags(FILE *stream, _mitkIpPicTagsElement_t *head, mitkIpUInt4_t level, mitkIpUInt4_t flags)
mitkIpPicTSV_t * mitkIpPicDelSubTag(mitkIpPicTSV_t *parent, const char *tag)
void _mitkIpCpCvtEndian(void *source, void *destination, unsigned long int len, unsigned char bytes)
struct mitkIpPicDescriptor mitkIpPicDescriptor
void _mitkIpPicInfo(FILE *stream, mitkIpPicDescriptor *pic, mitkIpUInt4_t flags)
void _mitkIpCvtEndian(void *data, unsigned long int len, unsigned char bytes)
void mitkIpPicAddSubTag(mitkIpPicTSV_t *parent, mitkIpPicTSV_t *tsv)
struct _mitkIpPicTagsElement_s _mitkIpPicTagsElement_t
mitkIpPicDescriptor * mitkIpPicGetTags(const char *picfile_name, mitkIpPicDescriptor *pic)
int mitkIpPicPut(const char *picfile_name, mitkIpPicDescriptor *pic)
_mitkIpPicTagsElement_t * _mitkIpPicFindTag(_mitkIpPicTagsElement_t *head, const char *tag)
mitkIpBool_t mitkIpPicSetWriteCompression(mitkIpBool_t compression)
mitkIpUInt4_t _mitkIpPicTSVSize(mitkIpPicTSV_t *tsv)
const char * mitkIpPicTypeName(mitkIpUInt4_t type)
_mitkIpPicTagsElement_t * _mitkIpPicCloneTags(_mitkIpPicTagsElement_t *head)
struct mitkIpPicDescriptor * lender
mitkIpBool_t mitkIpPicGetWriteCompression(void)
void mitkIpPicAddTag(mitkIpPicDescriptor *pic, mitkIpPicTSV_t *tsv)
mitkIpUInt1_t * mitkIpPicPutMem(mitkIpPicDescriptor *pic, int *mem_size)
vcl_size_t _mitkIpFWrite(void *ptr, vcl_size_t size, vcl_size_t nitems, FILE *stream)
_mitkIpPicTagsElement_t * tags_head
mitkIpPicDescriptor * mitkIpPicGetSlice(const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
vcl_size_t mitkIpPicFReadCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, gzFile stream)
mitkIpPicTSV_t * _mitkIpPicCloneTag(mitkIpPicTSV_t *source)
_mitkIpPicTagsElement_t * _mitkIpPicInsertTag(_mitkIpPicTagsElement_t *head, mitkIpPicTSV_t *tsv)
_mitkIpPicTagsElement_t * _mitkIpPicReadTagsMem(_mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, mitkIpUInt1_t **mem_ptr, char encryption_type)
mitkIpUInt4_t _mitkIpPicSize(mitkIpPicDescriptor *pic)
void _mitkIpPicFreeTags(_mitkIpPicTagsElement_t *head)
void mitkIpPicClear(mitkIpPicDescriptor *pic)
void mitkIpPicFree(mitkIpPicDescriptor *pic)
mitkIpUInt4_t _mitkIpPicTagsSize(_mitkIpPicTagsElement_t *head)
mitkIpPicDescriptor * mitkIpPicGet(const char *picfile_name, mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * _mitkIpPicOldGetHeader(FILE *infile, mitkIpPicDescriptor *pic)
mitkIpUInt4_t _mitkIpPicElements(mitkIpPicDescriptor *pic)
void mitkIpPicPutSlice(const char *picfile_name, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
mitkIpPicDescriptor * _mitkIpPicOldGet(FILE *infile, mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * mitkIpPicGetMem(mitkIpUInt1_t *mem_pic)
void _mitkIpPicWriteTags(_mitkIpPicTagsElement_t *head, FILE *stream, char encryption_type)
vcl_size_t mitkIpFReadCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, FILE *stream)
mitkIpPicTSV_t * mitkIpPicQueryTag(mitkIpPicDescriptor *pic, const char *t)
void mitkIpPicFreeTag(mitkIpPicTSV_t *tsv)
mitkIpPicDescriptor * mitkIpPicCopyHeader(mitkIpPicDescriptor *pic, mitkIpPicDescriptor *pic_new)
mitkIpPicDescriptor * mitkIpPicClone(mitkIpPicDescriptor *pic)
mitkIpPicDescriptor * _mitkIpPicOldGetSlice(FILE *infile, mitkIpPicDescriptor *pic, mitkIpUInt4_t slice)
void _mitkIpCp(void *source, void *destination, unsigned long int len)
_mitkIpEndian_t _mitkIpEndian(void)
gzFile _mitkIpPicOpenPicFileIn(const char *path)
mitkIpBool_t write_protect
mitkIpBool_t _mitkIpPicCanWriteCompressed
mitkIpPicTSV_t * mitkIpPicDelTag(mitkIpPicDescriptor *pic, const char *tag)
mitkIpPicDescriptor * mitkIpPicNew(void)
vcl_size_t mitkIpPicFWriteCvt(void *ptr, vcl_size_t size, vcl_size_t nitems, gzFile stream)
mitkIpUInt4_t _mitkIpPicTagsNumber(_mitkIpPicTagsElement_t *head)
mitkIpPicDescriptor * _mitkIpPicCopySlice(mitkIpPicDescriptor *pic, mitkIpPicDescriptor *pic_in, mitkIpUInt4_t slice)
int mitkIpPicAccess(const char *path, int mode)
int mitkIpPicRemoveFile(const char *path)
_mitkIpPicTagsElement_t * _mitkIpPicReadTags(_mitkIpPicTagsElement_t *head, mitkIpUInt4_t bytes_to_read, FILE *stream, char encryption_type)