Line data Source code
1 : /* 2 : * $Id$ 3 : * keamaskband.h 4 : * 5 : * Created by Pete Bunting on 01/08/2012. 6 : * Copyright 2012 LibKEA. All rights reserved. 7 : * 8 : * This file is part of LibKEA. 9 : * 10 : * Permission is hereby granted, free of charge, to any person 11 : * obtaining a copy of this software and associated documentation 12 : * files (the "Software"), to deal in the Software without restriction, 13 : * including without limitation the rights to use, copy, modify, 14 : * merge, publish, distribute, sublicense, and/or sell copies of the 15 : * Software, and to permit persons to whom the Software is furnished 16 : * to do so, subject to the following conditions: 17 : * 18 : * The above copyright notice and this permission notice shall be 19 : * included in all copies or substantial portions of the Software. 20 : * 21 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 : * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 : * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 : * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 25 : * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 26 : * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 27 : * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 : * 29 : */ 30 : 31 : #ifndef KEAMASKBAND_H 32 : #define KEAMASKBAND_H 33 : 34 : #include "gdal_priv.h" 35 : 36 : #include "libkea_headers.h" 37 : #include "keadataset.h" 38 : 39 : class KEAMaskBand final : public GDALRasterBand 40 : { 41 : int m_nSrcBand; 42 : kealib::KEAImageIO *m_pImageIO; // our image access pointer - refcounted 43 : LockedRefCount *m_pRefCount; // reference count of m_pImageIO 44 : public: 45 : KEAMaskBand(GDALRasterBand *pParent, kealib::KEAImageIO *pImageIO, 46 : LockedRefCount *pRefCount); 47 : ~KEAMaskBand(); 48 : 49 1 : virtual bool IsMaskBand() const override 50 : { 51 1 : return true; 52 : } 53 : 54 : protected: 55 : // we just override these functions from GDALRasterBand 56 : virtual CPLErr IReadBlock(int, int, void *) override; 57 : virtual CPLErr IWriteBlock(int, int, void *) override; 58 : }; 59 : 60 : #endif // KEAMASKBAND_H