-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
713 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "imageloadexception.h" | ||
|
||
namespace ELS | ||
{ | ||
|
||
class XISFException : public ImageLoadException | ||
{ | ||
public: | ||
XISFException(const char* errText); | ||
virtual ~XISFException(); | ||
|
||
virtual const char* getErrText() const; | ||
|
||
protected: | ||
XISFException(); | ||
|
||
protected: | ||
static const int g_bufSize = 200; | ||
|
||
protected: | ||
char _errText[g_bufSize]; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#pragma once | ||
|
||
// Need to define this properly, but it's all linux all the time right now | ||
#define __PCL_LINUX | ||
|
||
// Suppress the MANY warnings from PCL | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wunused-parameter" | ||
#pragma GCC diagnostic ignored "-Wparentheses" | ||
#pragma GCC diagnostic ignored "-Wdangling-else" | ||
#include <pcl/XISF.h> | ||
#pragma GCC diagnostic pop | ||
|
||
#include <inttypes.h> | ||
|
||
#include "image.h" | ||
#include "pixelvisitor.h" | ||
#include "rastertypes.h" | ||
|
||
namespace ELS | ||
{ | ||
|
||
class XISFImage : public Image | ||
{ | ||
public: | ||
static XISFImage* load(const char* filename); | ||
|
||
public: | ||
virtual ~XISFImage() override; | ||
|
||
virtual bool isColor() const override; | ||
|
||
virtual int getWidth() const override; | ||
virtual int getHeight() const override; | ||
|
||
virtual RasterFormat getRasterFormat() const override; | ||
virtual SampleFormat getSampleFormat() const override; | ||
|
||
virtual void visitPixels(PixelVisitor* visitor) const override; | ||
|
||
private: | ||
XISFImage(SampleFormat sampleFormat, | ||
bool isColor, | ||
int width, | ||
int height, | ||
pcl::UInt8Image* img); | ||
XISFImage(SampleFormat sampleFormat, | ||
bool isColor, | ||
int width, | ||
int height, | ||
pcl::UInt16Image* img); | ||
XISFImage(SampleFormat sampleFormat, | ||
bool isColor, | ||
int width, | ||
int height, | ||
pcl::UInt32Image* img); | ||
XISFImage(SampleFormat sampleFormat, | ||
bool isColor, | ||
int width, | ||
int height, | ||
pcl::FImage* img); | ||
XISFImage(SampleFormat sampleFormat, | ||
bool isColor, | ||
int width, | ||
int height, | ||
pcl::DImage* img); | ||
|
||
void visitPixels(pcl::UInt8Image* img, | ||
PixelVisitor* visitor) const; | ||
void visitPixels(pcl::UInt16Image* img, | ||
PixelVisitor* visitor) const; | ||
void visitPixels(pcl::UInt32Image* img, | ||
PixelVisitor* visitor) const; | ||
void visitPixels(pcl::FImage* img, | ||
PixelVisitor* visitor) const; | ||
void visitPixels(pcl::DImage* img, | ||
PixelVisitor* visitor) const; | ||
|
||
private: | ||
SampleFormat _sampleFormat; | ||
bool _isColor; | ||
int _width; | ||
int _height; | ||
union | ||
{ | ||
pcl::UInt8Image* u8; | ||
pcl::UInt16Image* u16; | ||
pcl::UInt32Image* u32; | ||
pcl::FImage* f; | ||
pcl::DImage* d; | ||
} _pixels; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <string.h> | ||
|
||
#include "xisfexception.h" | ||
|
||
namespace ELS | ||
{ | ||
|
||
XISFException::XISFException(const char* errText) | ||
{ | ||
strncpy(_errText, errText, g_bufSize - 1); | ||
_errText[g_bufSize - 1] = 0; | ||
} | ||
|
||
/* virtual */ | ||
XISFException::~XISFException() {} | ||
|
||
/* virtual */ | ||
const char* XISFException::getErrText() const | ||
{ | ||
return _errText; | ||
} | ||
|
||
/* protected */ | ||
XISFException::XISFException() | ||
{ | ||
_errText[g_bufSize - 1] = 0; | ||
} | ||
|
||
} |
Oops, something went wrong.