MeVisLab Toolbox Reference
mlXYLibReaderPlugin.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
14 #include <mlModuleIncludes.h>
15 #include <mlTypeDefs.h>
17 #include "XYLibHeader.h"
18 
19 #include <ThirdPartyWarningsDisable.h>
20 #include <string>
21 #include <ThirdPartyWarningsRestore.h>
22 
23 
24 ML_START_NAMESPACE
25 
27 class SubImage;
28 class PagedImage;
29 
30 //----------------------------------------------------------------------------------
32 //----------------------------------------------------------------------------------
34 public:
36  static std::string getStringIdentifier();
37 
40 
42  ~XYLibReaderPlugin() override;
43 
47  bool isSupported(const std::string &fileName) const override;
48 
54  double getPluginPriority() const override;
55 
62  MLErrorCode loadFile(const std::string &fileName) override;
63 
66  size_t getNumberOfImagesInFile() override;
67 
71 
84  MLErrorCode fillSubImage(SubImage &dstSubImage) override;
85 
88  std::string getTagDump(const size_t maxNumBinaryEntries=8,
89  const size_t maxNumStringEntries=20) override;
90 
93  void close() override;
94 
97 
99  virtual const XYLibHeader &getHeader() const;
100 
101 private:
102 
104  void _reset();
105 
107  PagedImage _imgProps;
108 
110  XYLibHeader _header;
111 
113  MLErrorCode _headerLoadCode;
114 
117 };
118 
119 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLXYLibReaderPlugin_EXPORT
DLL export macro definition.
Interface of a header loader for Fraunhofer EZRT (.raw and .rek) images.
Base class for a generic file reader plugin with factory interface.
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition: mlSubImage.h:75
Header information loader for files supported by xylib.
Definition: XYLibHeader.h:27
Representation for the DM file as data structure.
XYLibReaderPlugin()
Constructor.
static std::string getStringIdentifier()
Returns the string identifier for this plugin.
MLErrorCode loadFile(const std::string &fileName) override
Opens and loads a file such that getPagedImageProperties() and fillSubImage() can be used to retrieve...
double getPluginPriority() const override
XYLibReaderPlugin might detect a loadable file which actually is of another format.
std::string getTagDump(const size_t maxNumBinaryEntries=8, const size_t maxNumStringEntries=20) override
This function returns a tag dump of the loaded file or "" if not possible.
MLErrorCode fillSubImage(SubImage &dstSubImage) override
Copy overlapping regions in dstSubImage with image data from the loaded file; note that the calculati...
void close() override
Closes the file and cleans up data structures.
virtual const XYLibHeader & getHeader() const
For convenience allow access to _header.
bool isSupported(const std::string &fileName) const override
Applies a fast check whether the file is probably supported or not, for example via the suffix.
bool supportsFillingInReferenceCoordinates() const override
Returns true if the loader instance support SubImage filling in reference coordinates,...
~XYLibReaderPlugin() override
Destructor. If still open the the file will also be closed.
const PagedImage & getPagedImageProperties() override
Returns the image properties of the currently loaded image.
size_t getNumberOfImagesInFile() override
Returns the number of images which are accessible in the loaded file; normally one,...
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
Header file of base class for a generic file reader plugin with factory interface.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.