~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to frmts/epsilon/epsilondataset.cpp

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: epsilondataset.cpp 17975 2009-11-08 20:51:31Z rouault $
 
2
 * $Id: epsilondataset.cpp 22363 2011-05-12 18:26:19Z rouault $
3
3
 *
4
4
 * Project:  GDAL Epsilon driver
5
5
 * Purpose:  Implement GDAL Epsilon support using Epsilon library
30
30
#include "epsilon.h"
31
31
#include "gdal_pam.h"
32
32
 
33
 
CPL_CVSID("$Id: epsilondataset.cpp 17975 2009-11-08 20:51:31Z rouault $");
 
33
CPL_CVSID("$Id: epsilondataset.cpp 22363 2011-05-12 18:26:19Z rouault $");
34
34
 
35
35
#define RASTERLITE_WAVELET_HEADER "StartWaveletsImage$$"
36
36
#define RASTERLITE_WAVELET_FOOTER "$$EndWaveletsImage"
48
48
    vsi_l_offset offset;
49
49
} BlockDesc;
50
50
 
 
51
#ifdef I_WANT_COMPATIBILITY_WITH_EPSILON_0_8_1
 
52
#define GET_FIELD(hdr, field) \
 
53
    (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.gs.field : hdr.tc.field
 
54
#else
 
55
#define GET_FIELD(hdr, field) \
 
56
    (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.field : hdr.hdr_data.tc.field
 
57
#endif
51
58
 
52
59
/************************************************************************/
53
60
/* ==================================================================== */
59
66
{
60
67
    friend class EpsilonRasterBand;
61
68
 
62
 
    FILE*    fp;
 
69
    VSILFILE*    fp;
63
70
    vsi_l_offset nFileOff;
64
71
    
65
72
    GByte*   pabyFileBuf;
237
244
        return CE_Failure;
238
245
    }
239
246
    
240
 
    int w = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.w : hdr.hdr_data.tc.w;
241
 
    int h = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.h : hdr.hdr_data.tc.h;
 
247
    int w = GET_FIELD(hdr, w);
 
248
    int h = GET_FIELD(hdr, h);
242
249
    int i;
243
250
 
244
251
    if (poGDS->nBands == 1)
505
512
            continue;
506
513
        }
507
514
        
508
 
        int W = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.W : hdr.hdr_data.tc.W;
509
 
        int H = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.H : hdr.hdr_data.tc.H;
510
 
        int x = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.x : hdr.hdr_data.tc.x;
511
 
        int y = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.y : hdr.hdr_data.tc.y;
512
 
        int w = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.w : hdr.hdr_data.tc.w;
513
 
        int h = (hdr.block_type == EPS_GRAYSCALE_BLOCK) ? hdr.hdr_data.gs.h : hdr.hdr_data.tc.h;
 
515
        int W = GET_FIELD(hdr, W);
 
516
        int H = GET_FIELD(hdr, H);
 
517
        int x = GET_FIELD(hdr, x);
 
518
        int y = GET_FIELD(hdr, y);
 
519
        int w = GET_FIELD(hdr, w);
 
520
        int h = GET_FIELD(hdr, h);
514
521
 
515
522
        //CPLDebug("EPSILON", "W=%d,H=%d,x=%d,y=%d,w=%d,h=%d,offset=" CPL_FRMT_GUIB,
516
523
        //                    W, H, x, y, w, h, nStartBlockFileOff);
627
634
        return NULL;
628
635
    }
629
636
 
630
 
    FILE* fp = VSIFOpenL(poOpenInfo->pszFilename, "rb");
 
637
    VSILFILE* fp = VSIFOpenL(poOpenInfo->pszFilename, "rb");
631
638
    if (fp == NULL)
632
639
        return NULL;
633
640
    
780
787
/*      Open file                                                       */
781
788
/* -------------------------------------------------------------------- */
782
789
 
783
 
    FILE* fp = VSIFOpenL(pszFilename, "wb");
 
790
    VSILFILE* fp = VSIFOpenL(pszFilename, "wb");
784
791
    if (fp == NULL)
785
792
        return NULL;
786
793
 
1012
1019
"   <Option name='FILTER' type='string-select' description='Filter ID' default='daub97lift'>"
1013
1020
"%s"
1014
1021
"   </Option>"
1015
 
"   <Option name='BLOCKXSIZE' type='int' description='Tile Width. Between 32 and 1024' default=256/>"
1016
 
"   <Option name='BLOCKYSIZE' type='int' description='Tile Height. Between 32 and 1024' default=256/>"
 
1022
"   <Option name='BLOCKXSIZE' type='int' description='Tile Width. Between 32 and 1024' default='256'/>"
 
1023
"   <Option name='BLOCKYSIZE' type='int' description='Tile Height. Between 32 and 1024' default='256'/>"
1017
1024
"   <Option name='MODE' type='string-select' default='OTLPF'>"
1018
1025
"       <Value>NORMAL</Value>"
1019
1026
"       <Value>OTLPF</Value>"