Changes between Version 10 and Version 11 of rfc15_nodatabitmask


Ignore:
Timestamp:
Aug 21, 2007, 8:54:50 AM (17 years ago)
Author:
warmerdam
Comment:

gnmf -> gmf

Legend:

Unmodified
Added
Removed
Modified
  • rfc15_nodatabitmask

    v10 v11  
     1
    12= RFC 14: Band Masks =
    23
     
    1617
    1718{{{
    18     GDALRasterBand *GetMaskBand();
    19     int             GetMaskFlags();
     19    virtual GDALRasterBand *GetMaskBand();
     20    virtual int             GetMaskFlags();
    2021}}}
    2122
    22 Note that the !GetMaskBand() should always return a GDALRasterBand mask, even if it is only an all 255 mask with the flags indicating GNMF_ALL_VALID.
     23Note that the !GetMaskBand() should always return a GDALRasterBand mask, even if it is only an all 255 mask with the flags indicating GMF_ALL_VALID.
    2324
    2425The !GetMaskFlags() method returns an bitwise OR-ed set of status flags with the following available definitions that may be extended in the future:
    2526
    26  * GNMF_ALL_VALID(0x01): There are no invalid pixels, all mask values will be 255.  When used this will normally be the only flag set.
    27  * GNMF_PER_DATASET(0x02): The mask band is shared between all bands on the dataset.
    28  * GNMF_ALPHA(0x04): The mask band is actually an alpha band and may have values other than 0 and 255.
    29  * GNMF_NODATA(0x08): Indicates the mask is actually being generated from nodata values. 
     27 * GMF_ALL_VALID(0x01): There are no invalid pixels, all mask values will be 255.  When used this will normally be the only flag set.
     28 * GMF_PER_DATASET(0x02): The mask band is shared between all bands on the dataset.
     29 * GMF_ALPHA(0x04): The mask band is actually an alpha band and may have values other than 0 and 255.
     30 * GMF_NODATA(0x08): Indicates the mask is actually being generated from nodata values.  (mutually exclusive of GMF_ALPHA)
    3031
    3132== Default Implementation ==
     
    3334The GDALRasterBand class will include a default implementation of !GetMaskBand() that returns one of three default implementations. 
    3435
    35  * If the band has a nodata value set, an instance of the new GDALNodataMaskRasterBand class will be returned.  !GetMaskFlags() will return GNMF_NODATA.
    36  * If there is no nodata value, but the dataset has an alpha band that seems to apply to this band (specific rules yet to be determined) and that is of type GDT_Byte then that alpha band will be returned, and the flags GNMF_PER_DATASET and GNMF_ALPHA will be returned in the flags.
    37  * If neither of the above apply, an instance of the new GDALAllValidRasterBand class will be returned that has 255 values for all pixels.  The null flags will return GNMF_ALL_VALID.
     36 * If the band has a nodata value set, an instance of the new GDALNodataMaskRasterBand class will be returned.  !GetMaskFlags() will return GMF_NODATA.
     37 * If there is no nodata value, but the dataset has an alpha band that seems to apply to this band (specific rules yet to be determined) and that is of type GDT_Byte then that alpha band will be returned, and the flags GMF_PER_DATASET and GMF_ALPHA will be returned in the flags.
     38 * If neither of the above apply, an instance of the new GDALAllValidRasterBand class will be returned that has 255 values for all pixels.  The null flags will return GMF_ALL_VALID.
    3839
    3940The GDALRasterBand will include a protected poMask instance variable and a bOwnMask flag.  The first call to the default !GetMaskBand() will result in creation of the GDALNodataMaskRasterBand, GDALAllValidMaskRasterBand and their assignment to poMask with bOwnMask set TRUE.  If an alpha band is identified for use, it will be assigned to poMask and bOwnMask set to FALSE.  The GDALRasterBand class will take care of deleting the poMask if set and bOwnMask is true in the destructor.  Derived band classes may safely use the poMask and bOwnMask flag similarly as long as the semantics are maintained.
     
    4142== Alpha Bands ==
    4243
    43 When a dataset has a normal GDT_Byte alpha (transparency) band that applies, it should be returned as the null mask, but the !GetMaskFlags() method should include GNMF_ALPHA.  For processing purposes any value other than 0 should be treated as valid data, though some algorithms will treat values between 1 and 254 as partially transparent. 
     44When a dataset has a normal GDT_Byte alpha (transparency) band that applies, it should be returned as the null mask, but the !GetMaskFlags() method should include GMF_ALPHA.  For processing purposes any value other than 0 should be treated as valid data, though some algorithms will treat values between 1 and 254 as partially transparent. 
    4445
    4546== Creating Masks ==