convert image_reader public interface to use CamelCase to match the rest of codebase

This commit is contained in:
artemp
2014-11-26 17:50:12 +01:00
parent d978feed92
commit 84551d9349
7 changed files with 61 additions and 61 deletions

View File

@@ -9,15 +9,15 @@
namespace mbgl { namespace util {
class image_reader_exception : public std::exception
class ImageReaderException : public std::exception
{
private:
std::string message_;
public:
image_reader_exception(std::string const& message)
ImageReaderException(std::string const& message)
: message_(message) {}
~image_reader_exception() throw() {}
~ImageReaderException() throw() {}
virtual const char* what() const throw()
{
@@ -25,17 +25,17 @@ public:
}
};
struct image_reader : private noncopyable
struct ImageReader : private noncopyable
{
virtual unsigned width() const=0;
virtual unsigned height() const=0;
virtual bool has_alpha() const=0;
virtual bool premultiplied_alpha() const=0;
virtual bool hasAlpha() const=0;
virtual bool premultipliedAlpha() const=0;
virtual void read(unsigned x,unsigned y, unsigned width, unsigned height, char* image)=0;
virtual ~image_reader() {}
virtual ~ImageReader() {}
};
std::unique_ptr<image_reader> get_image_reader(char const* data, size_t size);
std::unique_ptr<ImageReader> getImageReader(char const* data, size_t size);
}}

View File

@@ -14,7 +14,7 @@ extern "C"
namespace mbgl { namespace util {
template <typename T>
class jpeg_reader : public image_reader
class JpegReader : public ImageReader
{
public:
using source_type = T;
@@ -46,12 +46,12 @@ private:
unsigned width_;
unsigned height_;
public:
jpeg_reader(char const* data, size_t size);
~jpeg_reader();
JpegReader(char const* data, size_t size);
~JpegReader();
unsigned width() const;
unsigned height() const;
inline bool has_alpha() const { return false; }
inline bool premultiplied_alpha() const { return true; }
inline bool hasAlpha() const { return false; }
inline bool premultipliedAlpha() const { return true; }
void read(unsigned x,unsigned y, unsigned w, unsigned h, char *image);
private:
void init();

View File

@@ -16,7 +16,7 @@ extern "C"
namespace mbgl { namespace util {
template <typename T>
class png_reader : public image_reader
class PngReader : public ImageReader
{
using source_type = T;
using input_stream = boost::iostreams::stream<source_type>;
@@ -44,12 +44,12 @@ private:
int color_type_;
bool has_alpha_;
public:
png_reader(char const* data, std::size_t size);
~png_reader();
PngReader(char const* data, std::size_t size);
~PngReader();
unsigned width() const;
unsigned height() const;
inline bool has_alpha() const { return has_alpha_; }
bool premultiplied_alpha() const { return true; } // png_set_alpha_mode(png, PNG_ALPHA_PREMULTIPLIED, 2.2)
inline bool hasAlpha() const { return has_alpha_; }
bool premultipliedAlpha() const { return true; } // png_set_alpha_mode(png, PNG_ALPHA_PREMULTIPLIED, 2.2)
void read(unsigned x,unsigned y, unsigned width, unsigned height, char * image);
private:
void init();