2 #include <thrust/memory.h>
4 #include "image_allocator_cpu.h"
23 template<
typename PixelType,
class Allocator>
46 Allocator::free(
data_);
56 ImageCpu(
unsigned int _width,
unsigned int _height) :
80 ImageCpu(PixelType* _data,
unsigned int _width,
unsigned int _height,
81 size_t _pitch,
bool ext_data_pointer =
false) :
103 PixelType*
data(
int ox = 0,
int oy = 0)
114 const PixelType*
data(
int ox = 0,
int oy = 0)
const
116 return reinterpret_cast<const PixelType*
>(
150 return pitch_/
sizeof(PixelType);
156 return 8*
sizeof(PixelType);
162 thrust::pointer<PixelType, thrust::host_system_tag>
begin(
void)
164 return thrust::pointer<PixelType, thrust::host_system_tag>(
data());
170 thrust::pointer<PixelType, thrust::host_system_tag>
end(
void)
172 return thrust::pointer<PixelType, thrust::host_system_tag>(
data()+
stride()*
height());
197 ImageCpu(boost::python::api::object& py_arr);
ImageCpu(unsigned int _width, unsigned int _height)
Definition: image_cpu.h:56
iu::Size< 2 > size() const
Definition: image.h:64
ndarray_ref< PixelType, 2 > ref() const
ImageCpu(const iu::Size< 2 > &size)
Definition: image_cpu.h:66
Base class for 2D images (pitched memory).
Definition: image.h:30
IUCORE_DLLAPI void copy(const LinearHostMemory_8u_C1 *src, LinearHostMemory_8u_C1 *dst)
thrust::pointer< PixelType, thrust::host_system_tag > end(void)
Definition: image_cpu.h:170
unsigned int & height
Definition: vector.h:531
virtual bool onDevice() const
Definition: image_cpu.h:176
size_t pitch_
Definition: image_cpu.h:203
PixelType * operator[](unsigned int row)
Definition: image_cpu.h:130
unsigned int & width
Definition: vector.h:529
PixelType getPixel(unsigned int x, unsigned int y)
Definition: image_cpu.h:121
virtual unsigned int bitDepth() const
Definition: image_cpu.h:154
Definition: image_cpu.h:7
PixelType * data_
Definition: image_cpu.h:201
virtual size_t pitch() const
Definition: image_cpu.h:142
ImageCpu()
Definition: image_cpu.h:34
virtual size_t bytes() const
Definition: image_cpu.h:136
virtual size_t stride() const
Definition: image_cpu.h:148
PixelType pixel_type
Definition: image_cpu.h:31
Template specialization for 2-d unsigned int vectors (size vectors).
Definition: vector.h:525
thrust::pointer< PixelType, thrust::host_system_tag > begin(void)
Definition: image_cpu.h:162
unsigned int width() const
Definition: image.h:72
bool ext_data_pointer_
Definition: image_cpu.h:205
const PixelType * data(int ox=0, int oy=0) const
Definition: image_cpu.h:114
ImageCpu(PixelType *_data, unsigned int _width, unsigned int _height, size_t _pitch, bool ext_data_pointer=false)
Definition: image_cpu.h:80
PixelType * data(int ox=0, int oy=0)
Definition: image_cpu.h:103
virtual ~ImageCpu()
Definition: image_cpu.h:41
Host 2D image class (pitched memory).
Definition: image_cpu.h:27
unsigned int height() const
Definition: image.h:80