fw4spl
JpgImageWriterService.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "ioITK/config.hpp"
10 
11 #include <fwIO/IWriter.hpp>
12 
13 #include <boost/filesystem/path.hpp>
14 
15 #include <string>
16 
17 namespace fwData
18 {
19 class Image;
20 }
21 
22 namespace ioITK
23 {
24 
42 class IOITK_CLASS_API JpgImageWriterService : public ::fwIO::IWriter
43 {
44 
45 public:
47 
48  IOITK_API JpgImageWriterService() noexcept;
49 
50  IOITK_API virtual ~JpgImageWriterService() noexcept;
51 
52  IOITK_API static void saveImage(
53  const ::boost::filesystem::path& imgPath,
54  const CSPTR(::fwData::Image)& img);
55 
56 protected:
57 
59  IOITK_API virtual void starting() override;
60 
62  IOITK_API virtual void stopping() override;
63 
65  IOITK_API virtual void configuring() override;
66 
68  IOITK_API void updating() override;
69 
71  IOITK_API void info(std::ostream& _sstream ) override;
72 
74  IOITK_API virtual void configureWithIHM() override;
75 
77  IOITK_API ::fwIO::IOPathType getIOPathType() const override;
78 
79 };
80 
81 } // namespace ioITK
#define CSPTR(_cls_)
STL namespace.
Write an image to jpg format.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Writer service API. It manages extension points definition and extension configuration.
Definition: IWriter.hpp:33
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16
Contains the representation of the data objects used in the framework.
The namespace ioITK contains services for reader, writer and helper for itk image.