libcvd
Public Member Functions | List of all members
CVD::BasicImage< T > Class Template Reference

A generic image class to manage a block of arbitrarily padded data as an image. More...

#include <image.h>

Inheritance diagram for CVD::BasicImage< T >:
Inheritance graph
[legend]
Collaboration diagram for CVD::BasicImage< T >:
Collaboration graph
[legend]

Public Member Functions

virtual ~BasicImage ()
 The image data is not destroyed when a BasicImage is destroyed.
 
ConstPointerType data () const
 Returns the raw image data.
 
PointerType data ()
 Returns the raw image data.
 
void copy_from (const BasicImage< T > &other)
 
ImageRef size () const
 What is the size of this image?
 
void zero ()
 Set image data to all zero bytes. More...
 
void fill (const T d)
 Set all the pixels in the image to a value. More...
 
 BasicImage (const BasicImage &copyof)=default
 Copy constructor. More...
 
BasicImageoperator= (const BasicImage &copyof)=default
 Assignment operator. More...
 
- Public Member Functions inherited from CVD::Internal::ImageData< T >
 ImageData (const ImageData &)=default
 
 ImageData (void *data, size_t len, ImageRef sz)
 
 ImageData (void *data, ImageRef sz)
 
ImageDataoperator= (const ImageData &)=default
 
size_t datalength () const
 What is the row stride of the image?
 

Additional Inherited Members

- Protected Types inherited from CVD::Internal::ImageData< T >
using PointerType = void *
 
using ConstPointerType = const void *
 
- Protected Attributes inherited from CVD::Internal::ImageData< T >
void * my_data
 
ImageRef my_size
 
size_t data_length
 

Detailed Description

template<class T>
class CVD::BasicImage< T >

A generic image class to manage a block of arbitrarily padded data as an image.

Provides basic image access such as accessing a particular pixel co-ordinate.

Parameters
TThe pixel type for this image. Typically either CVD::byte or CVD::Rgb<CVD::byte> > are used, but images could be constructed of any available type.

A BasicImage does not manage its own data, but provides access to an arbitrary externally-managed block of data as though it were an image. Use the derived Image class if you want an image which also has its own data.

Constructor & Destructor Documentation

◆ BasicImage()

template<class T>
CVD::BasicImage< T >::BasicImage ( const BasicImage< T > &  copyof)
default

Copy constructor.

Parameters
copyofThe image to copy

Member Function Documentation

◆ fill()

template<class T>
void CVD::BasicImage< T >::fill ( const T  d)
inline

Set all the pixels in the image to a value.

This is a relatively fast operation, using memfill. Safe to run on empty images.

Parameters
dThe value to write into the image

◆ operator=()

template<class T>
BasicImage& CVD::BasicImage< T >::operator= ( const BasicImage< T > &  copyof)
default

Assignment operator.

Parameters
copyofThe image to copy

◆ zero()

template<class T>
void CVD::BasicImage< T >::zero ( )
inline

Set image data to all zero bytes.

This only works on POD


The documentation for this class was generated from the following file: