Show
Ignore:
Timestamp:
03/21/12 18:36:20 (3 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/Image

    r13025 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    9494 
    9595#ifndef GL_OES_compressed_ETC1_RGB8_texture 
    96     #define GL_ETC1_RGB8_OES        0x8D64    
     96    #define GL_ETC1_RGB8_OES        0x8D64 
    9797#endif 
    9898 
     
    109109 
    110110        Image(); 
    111          
     111 
    112112        /** Copy constructor using CopyOp to manage deep vs shallow copy. */ 
    113113        Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY); 
     
    130130        void setFileName(const std::string& fileName); 
    131131        inline const std::string& getFileName() const { return _fileName; } 
    132          
     132 
    133133        enum WriteHint { 
    134134            NO_PREFERENCE, 
     
    136136            EXTERNAL_FILE 
    137137        }; 
    138          
     138 
    139139        void setWriteHint(WriteHint writeHint) { _writeHint = writeHint; } 
    140140        WriteHint getWriteHint() const { return _writeHint; } 
    141          
     141 
    142142        enum AllocationMode { 
    143143            NO_DELETE, 
     
    145145            USE_MALLOC_FREE 
    146146        }; 
    147          
     147 
    148148        /** Set the method used for deleting data once it goes out of scope. */ 
    149149        void setAllocationMode(AllocationMode mode) { _allocationMode = mode; } 
     
    157157                           GLenum pixelFormat,GLenum type, 
    158158                           int packing=1); 
    159          
    160          
     159 
     160 
    161161        /** Set the image dimensions, format and data. */ 
    162162        virtual void setImage(int s,int t,int r, 
     
    166166                      AllocationMode mode, 
    167167                      int packing=1, int rowLength=0); 
    168              
     168 
    169169        /** Read pixels from current frame buffer at specified position and size, using glReadPixels. 
    170170          * Create memory for storage if required, reuse existing pixel coords if possible. 
     
    172172        virtual void readPixels(int x,int y,int width,int height, 
    173173                        GLenum pixelFormat,GLenum type); 
    174              
     174 
    175175 
    176176        /** Read the contents of the current bound texture, handling compressed pixelFormats if present. 
     
    196196 
    197197 
    198         enum Origin  
     198        enum Origin 
    199199        { 
    200200            BOTTOM_LEFT, 
    201201            TOP_LEFT 
    202202        }; 
    203          
     203 
    204204        /** Set the origin of the image. 
    205205          * The default value is BOTTOM_LEFT and is consistent with OpenGL. 
     
    208208          * to handle this origin position. */ 
    209209        void setOrigin(Origin origin) { _origin = origin; } 
    210          
     210 
    211211        /** Get the origin of the image.*/ 
    212212        Origin getOrigin() const { return _origin; } 
    213          
     213 
    214214 
    215215        /** Width of image. */ 
     
    218218        /** Height of image. */ 
    219219        inline int t() const { return _t; } 
    220          
     220 
    221221        /** Depth of image. */ 
    222222        inline int r() const { return _r; } 
     
    224224        void setRowLength(int length); 
    225225        inline int getRowLength() const { return _rowLength; } 
    226          
     226 
    227227        void setInternalTextureFormat(GLint internalFormat); 
    228228        inline GLint getInternalTextureFormat() const { return _internalTextureFormat; } 
    229          
     229 
    230230        void setPixelFormat(GLenum pixelFormat); 
    231231        inline GLenum getPixelFormat() const { return _pixelFormat; } 
    232          
     232 
    233233        void setDataType(GLenum dataType); 
    234         inline GLenum getDataType() const { return _dataType; }         
    235          
     234        inline GLenum getDataType() const { return _dataType; } 
     235 
    236236        void setPacking(unsigned int packing) { _packing = packing; } 
    237237        inline unsigned int getPacking() const { return _packing; } 
     
    245245        /** Get the pixel aspect ratio.*/ 
    246246        inline float getPixelAspectRatio() const { return _pixelAspectRatio; } 
    247          
     247 
    248248        /** Return the number of bits required for each pixel. */ 
    249249        inline unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); } 
     
    258258        /** Return the number of bytes each image (_s*_t) of pixels occupies. */ 
    259259        inline unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; } 
    260          
    261         /** Return the number of bytes between each successive image.  
     260 
     261        /** Return the number of bytes between each successive image. 
    262262          * Note, getImageSizeInBytes() will only equal getImageStepInBytes() when isDataContiguous() return true. */ 
    263263        inline unsigned int getImageStepInBytes() const { return getRowStepInBytes()*_t; } 
     
    276276          * take care to access the data per row rather than treating the whole data as a single block. */ 
    277277        inline unsigned char* data() { return _data; } 
    278          
     278 
    279279        /** Raw const image data. 
    280280          * Note, data in successive rows may not be contiguous, isDataContiguous() return false then you should 
     
    287287            return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes(); 
    288288        } 
    289          
     289 
    290290        inline const unsigned char* data(int column, int row=0,int image=0) const 
    291291        { 
     
    319319        protected: 
    320320 
    321              
     321 
    322322            void assign(); 
    323              
     323 
    324324            const osg::Image*                   _image; 
    325325            int                                 _rowNum; 
     
    342342        /** Flip the image horizontally, around s dimension. */ 
    343343        void flipHorizontal(); 
    344          
     344 
    345345        /** Flip the image vertically, around t dimension. */ 
    346346        void flipVertical(); 
     
    379379        /** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/ 
    380380        inline void setMipmapLevels(const MipmapDataType& mipmapDataVector) { _mipmapData = mipmapDataVector; } 
    381          
     381 
    382382        inline const MipmapDataType& getMipmapLevels() const { return _mipmapData; } 
    383383 
     
    390390            return 0; 
    391391        }; 
    392          
     392 
    393393        inline unsigned char* getMipmapData(unsigned int mipmapLevel) 
    394394        { 
     
    407407        virtual bool isImageTranslucent() const; 
    408408 
    409         /** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */  
     409        /** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */ 
    410410        void setPixelBufferObject(PixelBufferObject* buffer) { setBufferObject(buffer); } 
    411411 
     
    465465        AllocationMode _allocationMode; 
    466466        unsigned char* _data; 
    467          
     467 
    468468        void deallocateData(); 
    469          
     469 
    470470        void setData(unsigned char* data,AllocationMode allocationMode); 
    471471 
    472472        MipmapDataType _mipmapData; 
    473          
     473 
    474474        ref_ptr<PixelBufferObject> _bufferObject; 
    475475};