Skip to content

Commit

Permalink
Moved image_null into a header
Browse files Browse the repository at this point in the history
  • Loading branch information
flippmoke committed Mar 16, 2015
1 parent 2e10b2c commit 5a49842
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
1 change: 1 addition & 0 deletions include/mapnik/image_any.hpp
Expand Up @@ -24,6 +24,7 @@
#define MAPNIK_IMAGE_ANY_HPP

#include <mapnik/image.hpp>
#include <mapnik/image_null.hpp>
#include <mapnik/util/variant.hpp>

namespace mapnik {
Expand Down
13 changes: 0 additions & 13 deletions include/mapnik/image_impl.hpp
Expand Up @@ -312,19 +312,6 @@ inline image_dtype image<T>::get_dtype() const
return dtype;
}

/*
using image_rgba8 = image<rgba8_t>;
using image_gray8 = image<gray8_t>;
using image_gray8s = image<gray8s_t>;
using image_gray16 = image<gray16_t>;
using image_gray16s = image<gray16s_t>;
using image_gray32 = image<gray32_t>;
using image_gray32s = image<gray32s_t>;
using image_gray32f = image<gray32f_t>;
using image_gray64 = image<gray64_t>;
using image_gray64s = image<gray64s_t>;
using image_gray64f = image<gray64f_t>;
*/
} // end ns

#endif // MAPNIK_IMAGE_IMPL_HPP
11 changes: 8 additions & 3 deletions src/image_null.cpp → include/mapnik/image_null.hpp
@@ -1,4 +1,3 @@

/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
Expand All @@ -21,9 +20,12 @@
*
*****************************************************************************/

#ifndef MAPNIK_IMAGE_NULL_HPP
#define MAPNIK_IMAGE_NULL_HPP

// mapnik
#include <mapnik/config.hpp>
#include <mapnik/image.hpp>
//#include <mapnik/image.hpp>
#include <mapnik/pixel_types.hpp>

//stl
Expand All @@ -49,12 +51,13 @@ class image<null_t>
image(image<null_t> const& rhs) {}
image(image<null_t> && rhs) noexcept {}

void swap(image<null_t> & rhs) {}
std::size_t width() const { return 0; }
std::size_t height() const { return 0; }
unsigned getSize() const { return 0; }
unsigned getRowSize() const { return 0; }
void set(pixel_type const& t) { throw std::runtime_error("Can not set values for null image"); }
pixel_type& operator() (std::size_t i, std::size_t j) { throw std::runtime_error("Can not get or set values for null image"); }
const pixel_type& operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get or set values for null image"); }
const unsigned char* getBytes() const { return nullptr; }
unsigned char* getBytes() {return nullptr; }
double get_offset() const { return 0.0; }
Expand All @@ -69,3 +72,5 @@ class image<null_t>
};

} // end ns mapnik

#endif // MAPNIK_IMAGE_NULL_HPP
1 change: 0 additions & 1 deletion src/build.py
Expand Up @@ -178,7 +178,6 @@ def ldconfig(*args,**kwargs):
image_view.cpp
image_view_any.cpp
image_any.cpp
image_null.cpp
image_util.cpp
image_util_jpeg.cpp
image_util_png.cpp
Expand Down
1 change: 1 addition & 0 deletions src/image.cpp
Expand Up @@ -23,6 +23,7 @@
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/image.hpp>
#include <mapnik/image_null.hpp>
#include <mapnik/image_impl.hpp>
#include <mapnik/pixel_types.hpp>

Expand Down

0 comments on commit 5a49842

Please sign in to comment.