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

« back to all changes in this revision

Viewing changes to frmts/jp2kak/subfile_source.h

  • 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: subfile_source.h 17244 2009-06-16 16:22:47Z warmerdam $
 
2
 * $Id: subfile_source.h 23357 2011-11-07 18:34:42Z warmerdam $
3
3
 *
4
4
 * Project:  JPEG-2000
5
5
 * Purpose:  Implements read-only virtual io on a subregion of a file.
45
45
 
46
46
    bool operator!() { return (file == NULL); }
47
47
 
48
 
    void open(const char *fname )
 
48
    void open(const char *fname, int bSequential )
49
49
      {
50
50
          const char *real_filename;
51
51
          close();
55
55
              char** papszTokens = CSLTokenizeString2(fname + 12, ",", 0);
56
56
              if (CSLCount(papszTokens) >= 2)
57
57
              {
58
 
                  subfile_offset = CPLScanUIntBig(papszTokens[0], strlen(papszTokens[0]));
59
 
                  subfile_size = CPLScanUIntBig(papszTokens[1], strlen(papszTokens[1]));
 
58
                  subfile_offset = (int) CPLScanUIntBig(papszTokens[0], strlen(papszTokens[0]));
 
59
                  subfile_size = (int) CPLScanUIntBig(papszTokens[1], strlen(papszTokens[1]));
60
60
              }
61
61
              else
62
62
              {
63
63
                  kdu_error e;
64
 
                  
 
64
 
65
65
                  e << "Corrupt subfile definition:" << fname;
66
66
                  return;
67
67
              }
75
75
              else
76
76
              {
77
77
                  kdu_error e;
78
 
              
 
78
 
79
79
                  e << "Could not find filename in subfile definition." << fname;
80
80
                  return;
81
81
              }
96
96
              return;
97
97
          }
98
98
 
99
 
          capabilities = KDU_SOURCE_CAP_SEQUENTIAL | KDU_SOURCE_CAP_SEEKABLE;
 
99
          if( bSequential ) 
 
100
            capabilities = KDU_SOURCE_CAP_SEQUENTIAL;
 
101
          else
 
102
            capabilities = KDU_SOURCE_CAP_SEQUENTIAL | KDU_SOURCE_CAP_SEEKABLE;
100
103
 
101
104
          seek_origin = subfile_offset;
102
105
          seek( 0 );
161
164
    int subfile_offset;
162
165
    int subfile_size;
163
166
    
164
 
    FILE *file;
 
167
    VSILFILE *file;
165
168
  };
166