Image Utilities (IU)
|
Host 2D image class (pitched memory). More...
#include <image_cpu.h>
Public Types | |
typedef PixelType | pixel_type |
Public Member Functions | |
ImageCpu () | |
virtual | ~ImageCpu () |
ImageCpu (unsigned int _width, unsigned int _height) | |
ImageCpu (const iu::Size< 2 > &size) | |
ImageCpu (PixelType *_data, unsigned int _width, unsigned int _height, size_t _pitch, bool ext_data_pointer=false) | |
PixelType * | data (int ox=0, int oy=0) |
const PixelType * | data (int ox=0, int oy=0) const |
PixelType | getPixel (unsigned int x, unsigned int y) |
PixelType * | operator[] (unsigned int row) |
virtual size_t | bytes () const |
virtual size_t | pitch () const |
virtual size_t | stride () const |
virtual unsigned int | bitDepth () const |
thrust::pointer< PixelType, thrust::host_system_tag > | begin (void) |
thrust::pointer< PixelType, thrust::host_system_tag > | end (void) |
virtual bool | onDevice () const |
ndarray_ref< PixelType, 2 > | ref () const |
ImageCpu (const ndarray_ref< PixelType, 2 > &x) | |
ImageCpu (boost::python::api::object &py_arr) | |
Public Member Functions inherited from iu::Image | |
Image () | |
virtual | ~Image () |
Image (unsigned int width, unsigned int height) | |
Image (const iu::Size< 2 > &size) | |
iu::Size< 2 > | size () const |
unsigned int | width () const |
unsigned int | height () const |
bool | sameType (const Image &from) |
size_t | numel () const |
Protected Attributes | |
PixelType * | data_ |
size_t | pitch_ |
bool | ext_data_pointer_ |
Protected Attributes inherited from iu::Image | |
iu::Size< 2 > | size_ |
Host 2D image class (pitched memory).
typedef PixelType iu::ImageCpu< PixelType, Allocator >::pixel_type |
Define the current pixel type.
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
inline |
|
inline |
|
inline |
iu::ImageCpu< PixelType, Allocator >::ImageCpu | ( | const ndarray_ref< PixelType, 2 > & | x | ) |
construct from ndarray_ref – include ndarray/ndarray_iu.h
iu::ImageCpu< PixelType, Allocator >::ImageCpu | ( | boost::python::api::object & | py_arr | ) |
ImageCpu constructor from numpy array. It wraps the numpy data pointer i.e. does not perform a deep copy. This means that changes to the ImageCpu are transparent to python. Attention: It performs just a basic check if the datatyps are compatible: If you have a numpy array with uint8 and you try to construct a ImageCpu_32f_C1 from it, it will throw an exception. Constructing a ImageCpu_32u_C1 from a numpy float32 array will not give an error (both are 32-bit datatypes)!
include iuypthon.h!
py_arr | a boost::python::object representing a numpy array |
|
inline |
Returns a thrust pointer that can be used in custom operators
|
inlinevirtual |
Returns the bit depth of the data pointer.
Reimplemented from iu::Image.
|
inlinevirtual |
Returns the total amount of bytes saved in the data buffer.
Reimplemented from iu::Image.
|
inline |
Returns a pointer to the pixel data. The pointer can be offset to position (ox/oy).
ox | Horizontal offset of the pointer array. |
oy | Vertical offset of the pointer array. |
|
inline |
Returns a const pointer to the pixel data. The pointer can be offset to position (ox/oy).
ox | Horizontal offset of the pointer array. |
oy | Vertical offset of the pointer array. |
|
inline |
Returns a thrust pointer that can be used in custom operators
|
inline |
Get Pixel value at position x,y.
|
inlinevirtual |
Returns flag if the image data resides on the device/GPU (TRUE) or host/GPU (FALSE)
Reimplemented from iu::Image.
|
inline |
Get Pointer to beginning of row (y index). This enables the usage of [y][x] operator.
row | y index / beginning of row |
|
inlinevirtual |
Returns the distance in bytes between starts of consecutive rows.
Reimplemented from iu::Image.
ndarray_ref<PixelType,2> iu::ImageCpu< PixelType, Allocator >::ref | ( | ) | const |
convert to ndarray_ref – include ndarray/ndarray_iu.h
|
inlinevirtual |
Returns the distance in pixels between starts of consecutive rows.
Reimplemented from iu::Image.
|
protected |
Pointer to host buffer.
|
protected |
Flag if data pointer is handled outside the image class.
|
protected |
Distance in bytes between starts of consecutive rows.