MRPT  2.0.2
Functions | Variables
CImage_unittest.cpp File Reference
#include <CTraitsTest.h>
#include <gtest/gtest.h>
#include <mrpt/img/CImage.h>
#include <mrpt/img/TColor.h>
#include <mrpt/io/CMemoryStream.h>
#include <mrpt/math/CMatrixDynamic.h>
#include <mrpt/random.h>
#include <mrpt/serialization/CArchive.h>
#include <mrpt/system/filesystem.h>
#include <mrpt/system/memory.h>
#include <test_mrpt_common.h>
#include <mrpt/3rdparty/do_opencv_includes.h>
Include dependency graph for CImage_unittest.cpp:

Go to the source code of this file.

Functions

static void fillImagePseudoRandom (uint32_t seed, mrpt::img::CImage &img)
 
static bool expect_identical (const mrpt::img::CImage &a, const mrpt::img::CImage &b, const std::string &s=std::string())
 
 TEST (CImage, CtorDefault)
 
static void CtorSized_gray (unsigned int w, unsigned int h)
 
 TEST (CImage, CtorSized)
 
 TEST (CImage, GetSetPixel)
 
 TEST (CImage, CopyMoveSwap)
 
 TEST (CImage, ExternalImage)
 
 TEST (CImage, ConvertGray)
 
 TEST (CImage, CtorRefOrGray)
 
 TEST (CImage, HalfAndDouble)
 
 TEST (CImage, getChannelsOrder)
 
 TEST (CImage, ChangeCvMatCopies)
 
 TEST (CImage, ScaleImage)
 
 TEST (CImage, Serialize)
 
 TEST (CImage, KLT_response)
 
 TEST (CImage, LoadAndComparePseudoRnd)
 
 TEST (CImage, LoadAndSave)
 
 TEST (CImage, DifferentAccessMethodsColor)
 
 TEST (CImage, DifferentAccessMethodsGray)
 

Variables

const auto tstImgFileColor
 

Function Documentation

◆ CtorSized_gray()

static void CtorSized_gray ( unsigned int  w,
unsigned int  h 
)
static

Definition at line 71 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, and EXPECT_EQ().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expect_identical()

static bool expect_identical ( const mrpt::img::CImage a,
const mrpt::img::CImage b,
const std::string &  s = std::string() 
)
static

Definition at line 48 of file CImage_unittest.cpp.

References mrpt::img::CImage::at(), EXPECT_EQ(), mrpt::img::CImage::getHeight(), and mrpt::img::CImage::getWidth().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillImagePseudoRandom()

static void fillImagePseudoRandom ( uint32_t  seed,
mrpt::img::CImage img 
)
static

Definition at line 32 of file CImage_unittest.cpp.

References mrpt::img::CImage::at(), mrpt::img::CImage::getHeight(), mrpt::random::getRandomGenerator(), mrpt::img::CImage::getWidth(), and mrpt::random::Randomize().

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEST() [1/17]

TEST ( CImage  ,
CtorDefault   
)

Definition at line 63 of file CImage_unittest.cpp.

References mrpt::img::CImage::isColor().

Here is the call graph for this function:

◆ TEST() [2/17]

TEST ( CImage  ,
CtorSized   
)

Definition at line 82 of file CImage_unittest.cpp.

References mrpt::img::CH_RGB, CtorSized_gray(), EXPECT_EQ(), and EXPECT_TRUE().

Here is the call graph for this function:

◆ TEST() [3/17]

TEST ( CImage  ,
GetSetPixel   
)

Definition at line 99 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, EXPECT_EQ(), and EXPECT_NEAR().

Here is the call graph for this function:

◆ TEST() [4/17]

TEST ( CImage  ,
CopyMoveSwap   
)

Definition at line 131 of file CImage_unittest.cpp.

References mrpt::img::CImage::at(), mrpt::img::CH_GRAY, mrpt::img::CH_RGB, mrpt::img::DEEP_COPY, EXPECT_EQ(), mrpt::img::CImage::makeDeepCopy(), mrpt::img::SHALLOW_COPY, and mrpt::img::CImage::swap().

Here is the call graph for this function:

◆ TEST() [5/17]

TEST ( CImage  ,
ExternalImage   
)

Definition at line 207 of file CImage_unittest.cpp.

References EXPECT_EQ(), mrpt::img::CImage::setExternalStorage(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [6/17]

TEST ( CImage  ,
ConvertGray   
)

Definition at line 226 of file CImage_unittest.cpp.

References EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::grayscale(), mrpt::img::CImage::loadFromFile(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [7/17]

TEST ( CImage  ,
CtorRefOrGray   
)

Definition at line 241 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::FAST_REF_OR_CONVERT_TO_GRAY, mrpt::img::CImage::loadFromFile(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [8/17]

TEST ( CImage  ,
HalfAndDouble   
)

Definition at line 266 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, EXPECT_EQ(), mrpt::img::IMG_INTERP_NN, mrpt::img::CImage::scaleDouble(), and mrpt::img::CImage::scaleHalf().

Here is the call graph for this function:

◆ TEST() [9/17]

TEST ( CImage  ,
getChannelsOrder   
)

Definition at line 292 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::loadFromFile(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [10/17]

TEST ( CImage  ,
ChangeCvMatCopies   
)

Definition at line 307 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, mrpt::img::DEEP_COPY, EXPECT_EQ(), and mrpt::img::SHALLOW_COPY.

Here is the call graph for this function:

◆ TEST() [11/17]

TEST ( CImage  ,
ScaleImage   
)

Definition at line 349 of file CImage_unittest.cpp.

References EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::grayscale(), mrpt::img::IMG_INTERP_LINEAR, mrpt::img::IMG_INTERP_NN, mrpt::img::CImage::loadFromFile(), mrpt::img::CImage::makeDeepCopy(), mrpt::img::CImage::scaleDouble(), mrpt::img::CImage::scaleHalf(), mrpt::img::CImage::scaleImage(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [12/17]

TEST ( CImage  ,
Serialize   
)

Definition at line 428 of file CImage_unittest.cpp.

References mrpt::serialization::archiveFrom(), EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::loadFromFile(), mrpt::io::CMemoryStream::Seek(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [13/17]

TEST ( CImage  ,
KLT_response   
)

Definition at line 451 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, and EXPECT_GT().

Here is the call graph for this function:

◆ TEST() [14/17]

TEST ( CImage  ,
LoadAndComparePseudoRnd   
)

Definition at line 468 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, expect_identical(), EXPECT_TRUE(), fillImagePseudoRandom(), and mrpt::img::CImage::loadFromFile().

Here is the call graph for this function:

◆ TEST() [15/17]

TEST ( CImage  ,
LoadAndSave   
)

Definition at line 486 of file CImage_unittest.cpp.

References mrpt::img::CH_GRAY, expect_identical(), EXPECT_TRUE(), fillImagePseudoRandom(), mrpt::format(), mrpt::system::getTempFileName(), and mrpt::img::CImage::loadFromFile().

Here is the call graph for this function:

◆ TEST() [16/17]

TEST ( CImage  ,
DifferentAccessMethodsColor   
)

Definition at line 520 of file CImage_unittest.cpp.

References EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::loadFromFile(), and tstImgFileColor.

Here is the call graph for this function:

◆ TEST() [17/17]

TEST ( CImage  ,
DifferentAccessMethodsGray   
)

Definition at line 551 of file CImage_unittest.cpp.

References EXPECT_EQ(), EXPECT_TRUE(), mrpt::img::CImage::loadFromFile(), and tstImgFileColor.

Here is the call graph for this function:

Variable Documentation

◆ tstImgFileColor

const auto tstImgFileColor
Initial value:
=
mrpt::UNITTEST_BASEDIR + "/samples/img_basic_example/frame_color.jpg"s

Definition at line 28 of file CImage_unittest.cpp.

Referenced by TEST().




Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020