Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/ossimlabs/ossim into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Garrett Potts committed Oct 31, 2019
2 parents 385ff53 + 121732b commit 6d7153c
Show file tree
Hide file tree
Showing 25 changed files with 3,036 additions and 1,624 deletions.
6 changes: 3 additions & 3 deletions apps/ossim-cli/ossim-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool runCommand(ossimArgumentParser& ap)

if (!utility.valid())
{
CWARN << "\nDid not understand command <"<<command<<">"<<endl;
CWARN << "Did not understand command <"<<command<<">"<<endl;
showAvailableCommands();
return false;
}
Expand All @@ -66,7 +66,7 @@ bool runCommand(ossimArgumentParser& ap)

if (!utility->initialize(ap))
{
CWARN << "\nCould not execute command <"<<command<<"> with arguments and options "
CWARN << "Could not execute command <"<<command<<"> with arguments and options "
"provided."<<endl;
return false;
}
Expand All @@ -76,7 +76,7 @@ bool runCommand(ossimArgumentParser& ap)

if (!utility->execute())
{
CWARN << "\nAn error was encountered executing the command. Check options."<<endl;
CWARN << "An error was encountered executing the command. Check options."<<endl;
return false;
}

Expand Down
220 changes: 0 additions & 220 deletions include/ossim/base/ossim2dTo2dMatrixTransform.h

This file was deleted.

117 changes: 117 additions & 0 deletions include/ossim/imaging/ossimNormalizedU10RemapTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
//*******************************************************************
//
// License: MIT
//
// See LICENSE.txt file in the top level directory for more details.
//
// Description:
//
// Contains class declaration for ossimNormalizedU10RemapTable. Table for
// normalizing unsigned 10 bit data.
//
//*******************************************************************
// $Id$

#ifndef ossimNormalizedU10RemapTable_HEADER
#define ossimNormalizedU10RemapTable_HEADER

#include <ossim/imaging/ossimNormalizedRemapTable.h>
#include <ossim/base/ossimCommon.h> /* for round */

/**
* @class ossimNormalizedU10RemapTable
*
* @brief Eleven bit normalized remap table to go to/from normalized value
* to pixel value.
*/
class OSSIM_DLL ossimNormalizedU10RemapTable : public ossimNormalizedRemapTable
{
public:

/** @brief default constructor */
ossimNormalizedU10RemapTable();
/** @brief virtual destructor */
virtual ~ossimNormalizedU10RemapTable();


enum
{
TABLE_ENTRIES = 1024 // 2^10
};

/**
* @brief Gets the number of table entries.
* @return The number of entries in a table.
*/
virtual ossim_int32 getEntries() const;

/**
* @brief Gets a normalized value (between '0.0' and '1.0') from
* a pixel value.
*
* @return Value between 0.0 and 1.0.
*/
virtual ossim_float64 operator[](ossim_int32 pix) const;

/**
* @brief Gets a normalized value (between '0.0' and '1.0') from
* a pixel value.
*
* @return Value between 0.0 and 1.0.
*/
virtual ossim_float64 normFromPix(ossim_int32 pix) const;

/**
* @brief Returns an pixel value as an int from a normalized value.
*
* @return Value between scalar range of remap table.
*/
virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;

private:

static ossim_float64 theTable[TABLE_ENTRIES];
static bool theTableIsInitialized;

};

inline ossim_int32 ossimNormalizedU10RemapTable::getEntries() const
{
return TABLE_ENTRIES;
}

inline ossim_float64 ossimNormalizedU10RemapTable::operator[](
ossim_int32 pix) const
{
return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
}

inline ossim_float64 ossimNormalizedU10RemapTable::normFromPix(
ossim_int32 pix) const
{
return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
}

inline ossim_int32 ossimNormalizedU10RemapTable::pixFromNorm(
ossim_float64 normPix) const
{
if(normPix <= 0.0) return 0;

// un-normalize...
ossim_float64 p = normPix * getNormalizer();

// Ensure pixel is in range.
p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());

// Since going from double to int round...
p = ossim::round<ossim_int32>(p);

if(p == 0.0)
{
p = 1.0;
}

return static_cast<ossim_int32>(p);
}

#endif
Loading

0 comments on commit 6d7153c

Please sign in to comment.