NoData.pm

Summary
NoData.pm
BE4::NoDataDefine Nodata informations and tools.
HEX2DECDefine conversion from hedecimal to decimal number.
Constructors
newNoData constructor.
_initCheck and store nodata attributes values.
Getters - Setters
getValue
getNodataFilenameReturns the name of the nodata tile : nd.tif
Commands
createNodataCompose the command to create a nodata tile and execute it.
Conversion
hexToDecFrom a color value in hexadecimal format (string), convert in decimal format (string).
Export methods
exportForDebugReturns all nodata’s informations.

BE4::NoData

Exporter
BE4::NoData

Define Nodata informations and tools.

Using

use BE4::NoData;

# NoData object creation
my $objNodata = BE4::NoData->new({
    pixel   => $objPixel,
    value   => "255,255,255"
});

Attributes

pixelPixel - Components of a nodata pixel.
valuestring - Contains one integer value per sample, in decimal format, seperated by comma.  For 8 bits unsigned integer, value must be between 0 and 255.  For 32 bits float, an integer is expected too, but can be negative.  Example : “255,255,255” (white) for images whithout alpha sample, “-99999” for a DTM.
Summary
HEX2DECDefine conversion from hedecimal to decimal number.
Constructors
newNoData constructor.
_initCheck and store nodata attributes values.
Getters - Setters
getValue
getNodataFilenameReturns the name of the nodata tile : nd.tif
Commands
createNodataCompose the command to create a nodata tile and execute it.
Conversion
hexToDecFrom a color value in hexadecimal format (string), convert in decimal format (string).
Export methods
exportForDebugReturns all nodata’s informations.

HEX2DEC

my %HEX2DEC

Define conversion from hedecimal to decimal number.

Constructors

new

sub new

NoData constructor.  Bless an instance.

Parameters (hash)

pixelPixel - Nodata pixel
valuestring - Optionnal, value (color) to use when no input data

_init

sub _init

Check and store nodata attributes values.  Define the default value if not supplied.

  • 255 per unsigned 8-bit integer sample
  • -99999 per 32-bit float sample

Parameters (hash)

pixelPixel - Nodata pixel
valuestring - Optionnal, value (color) to use when no input data

Getters - Setters

getValue

sub getValue

getNodataFilename

sub getNodataFilename

Returns the name of the nodata tile : nd.tif

Commands

createNodata

sub createNodata

Compose the command to create a nodata tile and execute it.  The tile’s name is given by the method getNodataName.

Returns TRUE if the nodata tile is succefully written, FALSE otherwise.

Parameters (list)

nodataDirPathstring - complete absolute directory path, where to write the nodata tile (“/path/to/write/”)
widthinteger - Width in pixel of the tile
heightinteger - Height in pixel of the tile
compressionstring - Compression to apply to the nodata tile

Conversion

hexToDec

sub hexToDec

From a color value in hexadecimal format (string), convert in decimal format (string).  Different samples are seperated by comma.  Input string must have an even length (one sample <=> 2 character).

Parameters (list)

hexstring - Color value to hexadecimal format : white -> FFFFFF

Example

hexToDec(“7BFF0300”) = “123,255,3,0”

Export methods

exportForDebug

sub exportForDebug

Returns all nodata’s informations.  Useful for debug.

Example

my %HEX2DEC
Define conversion from hedecimal to decimal number.
sub new
NoData constructor.
sub _init
Check and store nodata attributes values.
sub getValue
sub getNodataFilename
Returns the name of the nodata tile : nd.tif
sub createNodata
Compose the command to create a nodata tile and execute it.
sub hexToDec
From a color value in hexadecimal format (string), convert in decimal format (string).
sub exportForDebug
Returns all nodata’s informations.
Store all pixel’s intrinsic components.
Close