Changes between Version 13 and Version 14 of rfc15_nodatabitmask


Ignore:
Timestamp:
Aug 27, 2007, 1:55:30 PM (17 years ago)
Author:
warmerdam
Comment:

updated createmasks logic somewhat.

Legend:

Unmodified
Added
Removed
Modified
  • rfc15_nodatabitmask

    v13 v14  
    2222}}}
    2323
     24GDALDataset is extended with the following method:
     25
     26{{{
     27    virtual CPLErr          CreateMaskBand( nFlags );
     28}}}
     29
    2430Note 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.
    2531
     
    3137 * GMF_NODATA(0x08): Indicates the mask is actually being generated from nodata values.  (mutually exclusive of GMF_ALPHA)
    3238
    33 The !CreateMaskBand() method will attempt to create a mask band associated with the band on which it is invoked, issuing an error if it is not supported.  Currently the only flag that is meaningful to pass in when creating a mask band is GMF_PER_DATASET.  The rest are used to represent special system provided mask bands.
     39The !CreateMaskBand() method will attempt to create a mask band associated with the band on which it is invoked, issuing an error if it is not supported.  Currently the only flag that is meaningful to pass in when creating a mask band is GMF_PER_DATASET.  The rest are used to represent special system provided mask bands.  GMF_PER_DATASET is assumed when CreateMaskBand() is called on a dataset.
    3440
    35 == Default Implementation ==
     41== Default !GetMaskBand() / !GetMaskFlags() Implementation ==
    3642
    3743The GDALRasterBand class will include a default implementation of !GetMaskBand() that returns one of three default implementations. 
    3844
     45 * If a corresponding .msk file exists it will be used for the mask band.
    3946 * If the band has a nodata value set, an instance of the new GDALNodataMaskRasterBand class will be returned.  !GetMaskFlags() will return GMF_NODATA.
    4047 * 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.
     
    4350The 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.
    4451
    45 The default implementation of the !CreateMaskBand() method will be implemented based on similar rules to the .ovr handling implemented using the GDALDefaultOverviews object.  A TIFF file with the extension .msk will be created with the same basename as the original file, and it will have distinct TIFF directories for each band in the original dataset that has an associated mask.  The mask images will be deflate compressed tiled images with the same block size as the original image.  The default dataset delete will also need to be updated to support cleaning up the .msk files.  Note that only drivers that enable the default overview mechanism will support default masks.
     52== Default !CreateMaskBand() ==
     53
     54The default implementation of the !CreateMaskBand() method will be implemented based on similar rules to the .ovr handling implemented using the GDALDefaultOverviews object.  A TIFF file with the extension .msk will be created with the same basename as the original file, and it will have as many bands as the original image (or just one for GMF_PER_DATASET).  The mask images will be deflate compressed tiled images with the same block size as the original image if possible. 
     55
     56The default implementation of !GetFileList() will also be modified to know about the .msk files.
     57
     58== !CreateCopy() ==
     59
     60The GDALDriver::DefaultCreateCopy(), and GDALPamDataset::CloneInfo() methods will be updated to copy mask information if it seems necessary and is possible.  Note that NODATA, ALL_VALID and ALPHA type masks are not copied since they are just derived information.
    4661
    4762== Alpha Bands ==