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

« back to all changes in this revision

Viewing changes to frmts/sgi/sgidataset.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: sgidataset.cpp 16706 2009-04-02 03:44:07Z warmerdam $
 
2
 * $Id: sgidataset.cpp 21680 2011-02-11 21:12:07Z warmerdam $
3
3
 *
4
4
 * Project:  SGI Image Driver
5
5
 * Purpose:  Implement SGI Image Support based on Paul Bourke's SGI Image code.
35
35
#include "cpl_port.h"
36
36
#include "cpl_string.h"
37
37
 
38
 
CPL_CVSID("$Id: sgidataset.cpp 16706 2009-04-02 03:44:07Z warmerdam $");
 
38
CPL_CVSID("$Id: sgidataset.cpp 21680 2011-02-11 21:12:07Z warmerdam $");
39
39
 
40
40
CPL_C_START
41
41
void    GDALRegister_SGI(void);
56
56
    char name[80];
57
57
    GUInt32 colorMap;
58
58
 
59
 
    FILE* file;
 
59
    VSILFILE* file;
60
60
    std::string fileName;
61
61
    unsigned char* tmp;
62
62
    GUInt32 rleEnd;
200
200
{
201
201
    friend class SGIRasterBand;
202
202
 
203
 
    FILE*  fpImage;
 
203
    VSILFILE*  fpImage;
204
204
 
205
205
    int    bGeoTransformValid;
206
206
    double adfGeoTransform[6];
334
334
                && pabyRawBuf[iX + nRepeatCount + 1] 
335
335
                == pabyRawBuf[iX + nRepeatCount + 3]) )
336
336
        { // encode a constant run.
337
 
            pabyRLEBuf[nRLEBytes++] = nRepeatCount; 
 
337
            pabyRLEBuf[nRLEBytes++] = (GByte) nRepeatCount; 
338
338
            pabyRLEBuf[nRLEBytes++] = pabyRawBuf[iX];
339
339
            iX += nRepeatCount;
340
340
        }
357
357
                    break;
358
358
            }
359
359
 
360
 
            pabyRLEBuf[nRLEBytes++] = 0x80 | nRepeatCount; 
 
360
            pabyRLEBuf[nRLEBytes++] = (GByte) (0x80 | nRepeatCount); 
361
361
            memcpy( pabyRLEBuf + nRLEBytes, 
362
362
                    pabyRawBuf + iX, 
363
363
                    nRepeatCount );
701
701
/* -------------------------------------------------------------------- */
702
702
/*      Open the file for output.                                       */
703
703
/* -------------------------------------------------------------------- */
704
 
    FILE *fp = VSIFOpenL( pszFilename, "w" );
 
704
    VSILFILE *fp = VSIFOpenL( pszFilename, "w" );
705
705
    if( fp == NULL )
706
706
    {
707
707
        CPLError( CE_Failure, CPLE_OpenFailed, 
758
758
    
759
759
    while( nPixelsRemaining > 0 )
760
760
    {
761
 
        pabyRLELine[nRLEBytes] = MIN(127,nPixelsRemaining);
 
761
        pabyRLELine[nRLEBytes] = (GByte) MIN(127,nPixelsRemaining);
762
762
        pabyRLELine[nRLEBytes+1] = 0;
763
763
        nPixelsRemaining -= pabyRLELine[nRLEBytes];
764
764