image: add constructor from extent

This commit is contained in:
Danny Robson 2015-05-26 16:25:21 +10:00
parent a61ea32228
commit 3ff420978e
2 changed files with 10 additions and 0 deletions

View File

@ -122,6 +122,13 @@ private:
};
//-----------------------------------------------------------------------------
template <typename T>
util::image::buffer<T>::buffer (util::extent2u _size):
buffer<T> (_size.w, _size.h)
{ ; }
//-----------------------------------------------------------------------------
template <typename T>
util::image::buffer<T>::buffer (size_t _w, size_t _h, size_t _s):

View File

@ -17,6 +17,8 @@
#ifndef __UTIL_IMAGE_HPP
#define __UTIL_IMAGE_HPP
#include "extent.hpp"
#include <cstdint>
#include <cstdlib>
#include <memory>
@ -29,6 +31,7 @@ namespace util {
struct buffer {
typedef T value_type;
buffer (util::extent2u);
buffer (size_t w, size_t h);
buffer (size_t w, size_t h, size_t s);
buffer (size_t w, size_t h, size_t s, std::unique_ptr<T[]> &&data);