DGtal  1.2.0
testMagickWriter.cpp
Go to the documentation of this file.
1 
31 #include <iostream>
32 #include "DGtal/base/Common.h"
33 #include "ConfigTest.h"
34 #include "DGtalCatch.h"
35 #include "DGtal/helpers/StdDefs.h"
36 #include "DGtal/io/writers/MagickWriter.h"
37 #include "DGtal/images/ImageContainerBySTLVector.h"
38 #include "DGtal/io/colormaps/HueShadeColorMap.h"
40 
41 using namespace std;
42 using namespace DGtal;
43 using namespace Z2i;
45 // Functions for testing class MagickWriter.
47 
48 TEST_CASE( "Testing MagickWriter" )
49 {
50  //Create an image
51  Domain domain(Point(0,0), Point(64,48));
54  unsigned char t=0;
55  for(auto p: image.domain())
56  {
57  image.setValue(p, t);
58  t = ((int)t + 1)%255;
59  }
61 
62  SECTION("Testing feature io/writers/ of MagickWriter")
63  {
64  REQUIRE(( MagickWriter<Image,HueShadeColorMap<unsigned char,2>>::exportMagick("magickwriter.png", image, cmap ) ));
65  REQUIRE(( MagickWriter<Image,HueShadeColorMap<unsigned char,2>>::exportMagick("magickwriter.jpg", image, cmap ) ));
66  REQUIRE(( MagickWriter<Image,HueShadeColorMap<unsigned char,2>>::exportMagick("magickwriter.gif", image, cmap ) ));
67  REQUIRE(( MagickWriter<Image,HueShadeColorMap<unsigned char,2>>::exportMagick("magickwriter.bmp", image, cmap ) ));
68  }
69 }
70 
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:70
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Export image using Imagemagick backend.
Definition: MagickWriter.h:94
MyPointD Point
Definition: testClone2.cpp:383
TEST_CASE("Testing MagickWriter")
Domain domain
Image image(domain)
ImageContainerBySTLVector< Domain, Value > Image
SECTION("Testing constant forward iterators")
REQUIRE(domain.isInside(aPoint))