From 10dec18118305c8bd9cea161083ae4c0e9d892d5 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 6 May 2019 13:32:08 +0100 Subject: [PATCH] Change the definition of the output endinness --- tools/CalypTools.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/CalypTools.cpp b/tools/CalypTools.cpp index 3fd6111..f637716 100644 --- a/tools/CalypTools.cpp +++ b/tools/CalypTools.cpp @@ -123,7 +123,6 @@ int CalypTools::openInputs() log( CLP_LOG_ERROR, "Cannot open input stream %s with the following error: \n%s\n", inputFileNames[i].c_str(), msg ); return -1; } - m_uiOutEndianness = uiEndianness; } } @@ -170,6 +169,19 @@ int CalypTools::Open( int argc, char* argv[] ) return iRet; } + m_uiOutEndianness = 0; + if( Opts().hasOpt( "endianness" ) ) + { + if( m_strEndianness[0] == "big" ) + { + m_uiOutEndianness = 0; + } + else if( m_strEndianness[0] == "little" ) + { + m_uiOutEndianness = 1; + } + } + if( Opts().hasOpt( "save" ) ) { if( m_apcInputStreams.size() == 0 ) @@ -369,7 +381,7 @@ int CalypTools::Open( int argc, char* argv[] ) try { pcModStream->open( outputFileNames[0], pcModFrame->getWidth(), pcModFrame->getHeight(), - pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), CLP_LITTLE_ENDIAN, 1, false ); + pcModFrame->getPelFormat(), pcModFrame->getBitsPel(), m_uiOutEndianness, 1, false ); log( CLP_LOG_INFO, "Output stream from module!\n" ); reportStreamInfo( pcModStream ); }