DGtal  1.0.0
testMagickWriter.cpp
Go to the documentation of this file.
1 
30 #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: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Domain domain
REQUIRE(domain.isInside(aPoint))
TEST_CASE("Testing MagickWriter")
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383
ImageContainerBySTLVector< Domain, Value > Image
SECTION("Testing constant forward iterators")
Image image(domain)
Aim: Export image using Imagemagick backend.
Definition: MagickWriter.h:93