claraty::Camera_Image< Pixel_Type > Class Template Reference
#include <camera_image.h>
Inheritance diagram for claraty::Camera_Image< Pixel_Type >:


| Camera_Image (const Camera_Model *model=NULL, Time timestamp=Time(), Camera_Image_Properties *properties=NULL) | |
| Camera_Image (int nrows, int ncols, const Camera_Model *model=NULL, Time timestamp=Time()) | |
| Camera_Image (const Image< Pixel_Type > &src_image, const Camera_Model *model=NULL, Time timestamp=Time(), Camera_Image_Properties *properties=NULL) | |
| Camera_Image (const Camera_Image< Pixel_Type > &src_image) | |
| virtual | ~Camera_Image () |
| Camera_Image & | operator= (const Camera_Image &rhs) |
Public Types | |
| enum | Interpolation_t |
| enum | SIZE_TYPE |
| typedef Pixel_Type | value_type |
| typedef value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef N_2D_Array_Iterator< Pixel_Type > | iterator |
| typedef N_2D_Array_const_Iterator< Pixel_Type > | const_iterator |
| typedef value_type & | reference |
| typedef const value_type & | const_reference |
| typedef size_t | size_type |
| typedef ptrdiff_t | difference_type |
Public Member Functions | |
| bool | io (FDM_Map m) |
| int | get_width () const |
| int | get_height () const |
| void | set_interpolation_type (Interpolation_t itype) |
| Interpolation_t | get_interpolation_type () const |
| void | set_maximum_value (Pixel_Typeval) |
| Pixel_Type | get_maximum_value () const |
| Get the maximum effective pixel value (not computed, nor enforced). | |
| double | pixel (double x, double y) const |
| double | pixel (const N_2D_Point< I > &pt) const |
| void | bilinear_xy_ret (I x, I y, R &ret) const |
| void | bilinear_xy_ret (const N_2D_Point< I > &pt, R &ret) const |
| double | bilinear_xy (I x, I y) const |
| double | bilinear_xy (const N_2D_Point< I > &pt) const |
| virtual bool | io_headers (FDM_Map &map) |
| Pixel_Type * | get_raster () |
| const Pixel_Type * | get_raster () const |
| void | copy_into_columns (const Vector< Pixel_Type > *columns[]) |
| operator vnl_matrix_ref () | |
| Matrix & | operator+= (const Pixel_Type &rhs) |
| Matrix & | operator+= (const Matrix< rhsType > &rhs) |
| Matrix & | operator-= (const Pixel_Type &rhs) |
| Matrix & | operator-= (const Matrix< rhsType > &rhs) |
| Matrix & | operator *= (const Pixel_Type &rhs) |
| Matrix & | operator/= (const Pixel_Type &rhs) |
| Matrix | operator- () const |
| Matrix | transpose () const |
| Pixel_Type | sum_of_squares () const |
| Matrix | transpose_times (const Matrix< Pixel_Type > &B) const |
| Vector< Pixel_Type > | row (int r) const |
| Vector< Pixel_Type > | column (int c) const |
| Pixel_Type | min_value (int *min_row=NULL, int *min_col=NULL) const |
| Pixel_Type | max_value (int *max_row=NULL, int *max_col=NULL) const |
| Matrix | abs () const |
| Pixel_Type | average () const |
| Pixel_Type | sum () const |
| N_2D_Array & | set_diagonal (int size, In start) |
| N_2D_Array & | set_diagonal (const N_2D_Array< Pixel_Type > &a) |
| int | get_size () const |
| int | ncols () const |
| int | get_num_of_cols () const |
| int | nrows () const |
| int | get_num_of_rows () const |
| bool | is_square () const |
| void | resize (int newNumRows, int newNumCols) |
| bool | is_subarray () const |
| iterator | begin () |
| const_iterator | begin () const |
| iterator | end () |
| const_iterator | end () const |
| N_2D_Array & | displace_subarray (int delta_x, int delta_y) |
| N_2D_Array & | resize_subarray (int left, int top, int width, int height) |
| N_2D_Array & | associate_subarray (const N_2D_Array &parent, int left, int top, int width, int height) |
| int | get_full_num_cols () const |
| int | get_full_num_rows () const |
| void | dissociate (int new_nrows=-1, int new_ncols=-1) |
| N_2D_Array< Pixel_Type > | get_row (int row) const |
| N_2D_Array< Pixel_Type > | get_col (int col) const |
| const Pixel_Type * | get_row_pointer (int row) const |
| iterator | column_iterator (int col) |
| const_iterator | column_iterator (int col) const |
| Pixel_Type & | operator() (int r, int c) |
| const Pixel_Type & | operator() (int r, int c) const |
| Pixel_Type & | rc (int row, int column) |
| const Pixel_Type & | rc (int row, int column) const |
| Pixel_Type & | xy (int x, int y) |
| const Pixel_Type & | xy (int x, int y) const |
| Pixel_Type & | xy (const N_2D_Point_i &p) |
| const Pixel_Type & | xy (const N_2D_Point_i &p) const |
| void | write (std::ostream &os) const |
| operator void * () const | |
| N_2D_Array | operator== (const N_2D_Array &rhs) const |
| const Camera_Model & | get_camera_model () const |
| Time | get_timestamp () const |
| const Camera_Image_Properties & | get_properties () const |
| void | set_camera_model (const Camera_Model &model) |
| void | set_timestamp (Time timestamp) |
| void | set_properties (Camera_Image_Properties &p) |
Protected Member Functions | |
| Matrix & | scalar_apply (BinOp op, const Pixel_Type &rhs) |
| Pixel_Type & | element (int i) |
| const Pixel_Type & | element (int i) const |
| Pixel_Type * | get_data () |
| const Pixel_Type * | get_data () const |
| void | _copy (In start) |
| void | _copy (Pixel_Typefiller) |
| int | _check_size (SIZE_TYPE type, const N_2D_Array< rhsType > &rhs) const |
| void | _init_special (int nr, int nc, Pixel_Type *data, int memwidth) |
| void | _drop_memory () |
| void | _init_index (bool allocate=true) |
| bool | _is_noncontiguous () const |
Protected Attributes | |
| int | _num_of_rows |
| int | _num_of_cols |
| int | _mem_width |
| int | _mem_height |
| Pixel_Type * | _elements |
| Pixel_Type ** | _index |
| Pixel_Type * | _mem_base |
| Reference_Count * | _ref_count |
| bool | _isSubarray |
Private Attributes | |
| Time | _timestamp |
| Camera_Model * | _model |
| Camera_Image_Properties * | _properties |
Friends | |
| class | Camera |
Detailed Description
template<typename Pixel_Type>
class claraty::Camera_Image< Pixel_Type >
Extends the Image class to include a camera model, timestamp, a frame number (for video reconstruction), and camera image properties (e.g. exposure time, shutter speed, etc) for that image. A Camera_Image is simply an Image which was produced from a camera.The Camera_Image own a copy of the Camera_Model and hence does not tie the lifetime of its objects to those of the camera that generated the Camera_Image.
Definition at line 87 of file camera_image.h.
Member Typedef Documentation
typedef Pixel_Type claraty::N_2D_Array< Pixel_Type >::value_type [inherited] |
Definition at line 64 of file 2d_array.h.
typedef value_type* claraty::N_2D_Array< Pixel_Type >::pointer [inherited] |
Definition at line 65 of file 2d_array.h.
typedef const value_type* claraty::N_2D_Array< Pixel_Type >::const_pointer [inherited] |
Definition at line 66 of file 2d_array.h.
typedef N_2D_Array_Iterator<Pixel_Type > claraty::N_2D_Array< Pixel_Type >::iterator [inherited] |
Definition at line 67 of file 2d_array.h.
typedef N_2D_Array_const_Iterator<Pixel_Type > claraty::N_2D_Array< Pixel_Type >::const_iterator [inherited] |
Definition at line 68 of file 2d_array.h.
typedef value_type& claraty::N_2D_Array< Pixel_Type >::reference [inherited] |
Definition at line 69 of file 2d_array.h.
typedef const value_type& claraty::N_2D_Array< Pixel_Type >::const_reference [inherited] |
Definition at line 70 of file 2d_array.h.
typedef size_t claraty::N_2D_Array< Pixel_Type >::size_type [inherited] |
Definition at line 71 of file 2d_array.h.
typedef ptrdiff_t claraty::N_2D_Array< Pixel_Type >::difference_type [inherited] |
Definition at line 72 of file 2d_array.h.
Member Enumeration Documentation
enum claraty::Image::Interpolation_t [inherited] |
enum claraty::N_2D_Array::SIZE_TYPE [inherited] |
Constructor & Destructor Documentation
| claraty::Camera_Image< Pixel_Type >::Camera_Image | ( | const Camera_Model * | model = NULL, |
|
| Time | timestamp = Time(), |
|||
| Camera_Image_Properties * | properties = NULL | |||
| ) |
Creates a Camera_Image using default Image constructor with (0,0) image size. If no camera model is given, it will be initialized to NULL. Paramters such as timestamp are similarly set
- Parameters:
-
[in] model the Camera_Model to use (if non-NULL). The model will be copied. [in] timestamp the time the image was acquired (zero if not provided) [in] properties the frame number used to reconstruct a video stream
Definition at line 42 of file camera_image.ipp.
00044 : 00045 _model(model == NULL ? NULL : new Camera_Model(model)), 00046 _timestamp(timestamp), 00047 _properties((properties==NULL) ? NULL : new Camera_Image_Properties(properties)) 00048 { 00049 }
| claraty::Camera_Image< Pixel_Type >::Camera_Image | ( | int | nrows, | |
| int | ncols, | |||
| const Camera_Model * | model = NULL, |
|||
| Time | timestamp = Time() | |||
| ) |
| claraty::Camera_Image< Pixel_Type >::Camera_Image | ( | const Image< Pixel_Type > & | src_image, | |
| const Camera_Model * | model = NULL, |
|||
| Time | timestamp = Time(), |
|||
| Camera_Image_Properties * | properties = NULL | |||
| ) |
Creates a new Camera_Image from the provided source Image. Deep copies the source Image (all data) to the new Camera_Image.
- Parameters:
-
[in] src_image The Image to copy into the new Camera_Image. [in] model The Camera_Model to use. [in] timestamp The timestamp (zero if not provided). [in] properties Camera image properties.
Definition at line 83 of file camera_image.ipp.
00087 : Image<Pixel_Type >(src_image), 00088 _model(model == NULL ? NULL : new Camera_Model(model)), 00089 _timestamp(timestamp), 00090 _properties((properties==NULL) ? NULL : 00091 new Camera_Image_Properties(properties)) 00092 { 00093 }
| claraty::Camera_Image< Pixel_Type >::Camera_Image | ( | const Camera_Image< Pixel_Type > & | src_image | ) |
Copy constructor: creates a new Camera_Image from a source Camera_Image. Does a deep copy of the src_image to the new image.
- Parameters:
-
[in] src_image Camera_Image to use to construct the new Camera_Image.
Definition at line 104 of file camera_image.ipp.
00105 : Image<Pixel_Type>(src_image), 00106 _model(src_image._model == NULL ? NULL : src_image._model->clone()), 00107 _timestamp(src_image._timestamp), 00108 _properties(src_image._properties) 00109 { 00110 }
| claraty::Camera_Image< Pixel_Type >::~Camera_Image | ( | ) | [virtual] |
Destructor.
Definition at line 118 of file camera_image.ipp.
References claraty::Camera_Image< Pixel_Type >::_model, and claraty::Camera_Image< Pixel_Type >::_properties.
00119 { 00120 delete _model; 00121 delete _properties; 00122 }
Member Function Documentation
| Camera_Image< Pixel_Type > & claraty::Camera_Image< Pixel_Type >::operator= | ( | const Camera_Image< Pixel_Type > & | rhs | ) |
Definition at line 128 of file camera_image.ipp.
References claraty::Camera_Image< Pixel_Type >::_properties, claraty::Camera_Image< Pixel_Type >::_timestamp, and claraty::Camera_Image< Pixel_Type >::set_camera_model().
00129 { 00130 if (this != &rhs) { 00131 Image<Pixel_Type>::operator=(rhs); 00132 /* 00133 resize(rhs.nrows(), rhs.ncols()); 00134 if (rhs.is_subarray()) 00135 _copy(rhs.begin()); 00136 else 00137 _copy(rhs.get_raster()); 00138 set_maximum_value(rhs.get_maximum_value()); 00139 set_interpolation_type(rhs.get_interpolation_type()); 00140 */ 00141 set_camera_model(rhs._model); 00142 _timestamp = rhs._timestamp; 00143 _properties = rhs._properties; 00144 } 00145 return *this; 00146 }
Here is the call graph for this function:

| const Camera_Model& claraty::Camera_Image< Pixel_Type >::get_camera_model | ( | ) | const [inline] |
Definition at line 115 of file camera_image.h.
Referenced by claraty::Stereovision::compute_point_image().
00115 { return *_model; }
| Time claraty::Camera_Image< Pixel_Type >::get_timestamp | ( | ) | const [inline] |
| const Camera_Image_Properties& claraty::Camera_Image< Pixel_Type >::get_properties | ( | ) | const [inline] |
| void claraty::Camera_Image< Pixel_Type >::set_camera_model | ( | const Camera_Model & | model | ) |
Sets the image's Camera_Model.
- Parameters:
-
[in] model The Camera_Model to associate w/ the image.
Definition at line 172 of file camera_image.ipp.
References claraty::Camera_Image< Pixel_Type >::_model.
Referenced by claraty::Camera_Image< Pixel_Type >::operator=().
| void claraty::Camera_Image< Pixel_Type >::set_timestamp | ( | Time | timestamp | ) | [inline] |
| void claraty::Camera_Image< Pixel_Type >::set_properties | ( | Camera_Image_Properties & | p | ) | [inline] |
| bool claraty::Camera_Image< Pixel_Type >::io | ( | FDM_Map | m | ) |
Serializing and unserializing camera images.
- Parameters:
-
[out] m A flexible data marshalling map that contains the serializable format
- Returns:
- true if the operation is successful, otherwise false
Reimplemented from claraty::N_2D_Array< Pixel_Type >.
Definition at line 186 of file camera_image.ipp.
References claraty::Camera_Image< Pixel_Type >::_model, claraty::Camera_Image< Pixel_Type >::_timestamp, claraty::FDM_Map::field(), claraty::io_image(), claraty::FDM_Map::is_read(), and claraty::FDM_Map::peekfield().
00187 { 00188 bool ret = io_image(m, (Image<Pixel_Type>&)(*this)); 00189 00190 if (m.is_read()) { 00191 delete _model; 00192 std::string cmString; 00193 ret &= m.peekfield("model", cmString); 00194 if (cmString == "none") { 00195 ret &= m.field("model", cmString); // swallow it 00196 _model = NULL; 00197 } else { 00198 std::auto_ptr<Camera_Model> cm; 00199 ret &= m.field("model", cm); 00200 _model = cm.release(); 00201 } 00202 } else { // write 00203 if (_model) 00204 ret &= m.field("model", *_model); 00205 else { 00206 std::string none("none"); 00207 ret &= m.field("model", none); 00208 } 00209 } 00210 00211 ret &= m.field("timestamp", _timestamp); 00212 // ret &= m.field("features", _feature_map); 00213 return ret; 00214 }
Here is the call graph for this function:

| int claraty::Image< Pixel_Type >::get_width | ( | ) | const [inline, inherited] |
Returns the width of the Image (number of columns).
- Returns:
- the width of the Image (number of columns)
Definition at line 200 of file image.h.
00200 { return this->get_num_of_cols(); }
| int claraty::Image< Pixel_Type >::get_height | ( | ) | const [inline, inherited] |
Returns the height of the Image (number of rows).
- Returns:
- the height of the Image (number of rows)
Definition at line 205 of file image.h.
00205 { return this->get_num_of_rows(); }
| void claraty::Image< Pixel_Type >::set_interpolation_type | ( | Interpolation_t | itype | ) | [inline, inherited] |
Set the interpolation type to use when accessing a pixel in the Image. Interpolation type can by NOINTERP (return the nearest pixel) or BILINEAR (return a bilinearly interpolated pixel).
- Parameters:
-
[in] itype The interpolation type to use (NOINTERP, BILINEAR)
Definition at line 215 of file image.h.
00215 { 00216 _interpolation = itype; 00217 }
| Interpolation_t claraty::Image< Pixel_Type >::get_interpolation_type | ( | ) | const [inline, inherited] |
Returns the interpolation type being used by the Image.
- Returns:
- the interpolation type being used by the Image.
Definition at line 222 of file image.h.
00222 { return _interpolation; }
| void claraty::Image< Pixel_Type >::set_maximum_value | ( | Pixel_Type | val | ) | [inline, inherited] |
Set the effective maximum pixel value (not enforced) - this is the full saturated, or white reference value for this image.
Definition at line 228 of file image.h.
00228 { maximum_value = val; }
| Pixel_Type claraty::Image< Pixel_Type >::get_maximum_value | ( | ) | const [inline, inherited] |
Get the maximum effective pixel value (not computed, nor enforced).
Definition at line 231 of file image.h.
00231 { return maximum_value; }
| double claraty::Image< Pixel_Type >::pixel | ( | double | x, | |
| double | y | |||
| ) | const [inherited] |
Returns the interpolated (according to interpolation type) pixel at x, y. This is more expensive than normal (non-interpolated operator(x,y)) access even w/ NOINTERP interpolation.
- Parameters:
-
[in] x The pixel x value to access (the column value). [in] y The pixel y value to access (the row value).
- Returns:
- The pixel at x,y, interpolated according to the current interpolation type (note: always a double, regardless of Image pixel type.
| double claraty::Image< Pixel_Type >::pixel | ( | const N_2D_Point< I > & | pt | ) | const [inherited] |
| void claraty::Image< Pixel_Type >::bilinear_xy_ret | ( | I | x, | |
| I | y, | |||
| R & | ret | |||
| ) | const [inherited] |
| void claraty::Image< Pixel_Type >::bilinear_xy_ret | ( | const N_2D_Point< I > & | pt, | |
| R & | ret | |||
| ) | const [inherited] |
| double claraty::Image< Pixel_Type >::bilinear_xy | ( | I | x, | |
| I | y | |||
| ) | const [inherited] |
| double claraty::Image< Pixel_Type >::bilinear_xy | ( | const N_2D_Point< I > & | pt | ) | const [inherited] |
| virtual bool claraty::Image< Pixel_Type >::io_headers | ( | FDM_Map & | map | ) | [inline, virtual, inherited] |
| Pixel_Type * claraty::Image< Pixel_Type >::get_raster | ( | ) | [inline, inherited] |
| const Pixel_Type * claraty::Image< Pixel_Type >::get_raster | ( | ) | const [inline, inherited] |
| void claraty::Matrix< Pixel_Type >::copy_into_columns | ( | const Vector< Pixel_Type > * | columns[] | ) | [inherited] |
| claraty::Matrix< Pixel_Type >::operator vnl_matrix_ref | ( | ) | [inline, inherited] |
| Matrix& claraty::Matrix< Pixel_Type >::operator+= | ( | const Pixel_Type & | rhs | ) | [inline, inherited] |
Definition at line 137 of file matrix.h.
00137 { 00138 return scalar_apply(cl_plus<T>(), rhs); 00139 }
| Matrix& claraty::Matrix< Pixel_Type >::operator+= | ( | const Matrix< rhsType > & | rhs | ) | [inline, inherited] |
Definition at line 156 of file matrix.h.
00156 { 00157 if (_check_size(N_2D_Array<T>::EQUALS, rhs) == OK) 00158 cl_transform(rhs.begin(), rhs.end(), this->begin(), this->begin(), cl_plus<T>()); 00159 return *this; 00160 }
| Matrix& claraty::Matrix< Pixel_Type >::operator-= | ( | const Pixel_Type & | rhs | ) | [inline, inherited] |
Definition at line 140 of file matrix.h.
00140 { 00141 return scalar_apply(cl_minus<T>(), rhs); 00142 }
| Matrix& claraty::Matrix< Pixel_Type >::operator-= | ( | const Matrix< rhsType > & | rhs | ) | [inline, inherited] |
Definition at line 164 of file matrix.h.
00164 { 00165 if (_check_size(N_2D_Array<T>::EQUALS, rhs) == OK) 00166 cl_transform(this->begin(), this->end(), rhs.begin(), this->begin(), cl_minus<T>()); 00167 return *this; 00168 }
| Matrix& claraty::Matrix< Pixel_Type >::operator *= | ( | const Pixel_Type & | rhs | ) | [inline, inherited] |
Definition at line 143 of file matrix.h.
00143 { 00144 return scalar_apply(cl_multiplies<T>(), rhs); 00145 }
| Matrix& claraty::Matrix< Pixel_Type >::operator/= | ( | const Pixel_Type & | rhs | ) | [inline, inherited] |
Definition at line 146 of file matrix.h.
00146 { 00147 return scalar_apply(cl_divides<T>(), rhs); 00148 }
| Matrix claraty::Matrix< Pixel_Type >::operator- | ( | ) | const [inherited] |
| Matrix claraty::Matrix< Pixel_Type >::transpose | ( | ) | const [inherited] |
Reimplemented from claraty::N_2D_Array< Pixel_Type >.
| Pixel_Type claraty::Matrix< Pixel_Type >::sum_of_squares | ( | ) | const [inherited] |
| Matrix claraty::Matrix< Pixel_Type >::transpose_times | ( | const Matrix< Pixel_Type > & | B | ) | const [inherited] |
| Vector<Pixel_Type > claraty::Matrix< Pixel_Type >::row | ( | int | r | ) | const [inline, inherited] |
Definition at line 174 of file matrix.h.
00174 { 00175 assert(r < this->nrows()); 00176 return Vector<T>(this->ncols(), this->get_row_pointer(r)); 00177 }
| Vector<Pixel_Type > claraty::Matrix< Pixel_Type >::column | ( | int | c | ) | const [inline, inherited] |
Definition at line 179 of file matrix.h.
00179 { 00180 assert(c < this->ncols()); 00181 return Vector<T>(this->nrows(), this->column_iterator(c), COL_VECTOR); 00182 }
| Pixel_Type claraty::Matrix< Pixel_Type >::min_value | ( | int * | min_row = NULL, |
|
| int * | min_col = NULL | |||
| ) | const [inline, inherited] |
| Pixel_Type claraty::Matrix< Pixel_Type >::max_value | ( | int * | max_row = NULL, |
|
| int * | max_col = NULL | |||
| ) | const [inline, inherited] |
| Matrix claraty::Matrix< Pixel_Type >::abs | ( | ) | const [inline, inherited] |
| Pixel_Type claraty::Matrix< Pixel_Type >::average | ( | ) | const [inherited] |
| Pixel_Type claraty::Matrix< Pixel_Type >::sum | ( | ) | const [inherited] |
| Matrix& claraty::Matrix< Pixel_Type >::scalar_apply | ( | BinOp | op, | |
| const Pixel_Type & | rhs | |||
| ) | [inline, protected, inherited] |
Definition at line 194 of file matrix.h.
00194 { 00195 if (this->is_subarray()) 00196 cl_apply(*this, cl_bind2nd(op, rhs)); 00197 else 00198 cl_transform(this->get_data(), this->get_data() + this->get_size(), 00199 this->get_data(), cl_bind2nd(op, rhs)); 00200 return *this; 00201 }
| N_2D_Array& claraty::N_2D_Array< Pixel_Type >::set_diagonal | ( | int | size, | |
| In | start | |||
| ) | [inherited] |
| N_2D_Array& claraty::N_2D_Array< Pixel_Type >::set_diagonal | ( | const N_2D_Array< Pixel_Type > & | a | ) | [inline, inherited] |
Definition at line 143 of file 2d_array.h.
00143 { 00144 return set_diagonal(a.get_size(), a.begin()); 00145 }
| int claraty::N_2D_Array< Pixel_Type >::get_size | ( | ) | const [inline, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::ncols | ( | ) | const [inline, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::get_num_of_cols | ( | ) | const [inline, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::nrows | ( | ) | const [inline, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::get_num_of_rows | ( | ) | const [inline, inherited] |
| bool claraty::N_2D_Array< Pixel_Type >::is_square | ( | ) | const [inline, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::resize | ( | int | newNumRows, | |
| int | newNumCols | |||
| ) | [inline, inherited] |
Definition at line 168 of file 2d_array.h.
00168 { 00169 if (_num_of_rows != newNumRows || _num_of_cols != newNumCols) { 00170 if (_isSubarray) { 00171 std::cerr << "N_2D_Array::resize cannot be used on a subarray!" 00172 << std::endl; 00173 // throw exception 00174 } else if (_ref_count->get_value() != 1) { 00175 std::cerr << "N_2D_Array::resize cannot be used on an array being " 00176 "shared by subarrays" << std::endl; 00177 // throw exception 00178 } else if (get_size() == newNumRows * newNumCols && 00179 get_size() != 0) { 00180 delete [] _index; 00181 _num_of_rows = newNumRows; 00182 _num_of_cols = newNumCols; 00183 _mem_width = newNumCols; 00184 _mem_height = newNumRows; 00185 _init_index(true); 00186 } else { 00187 // total array size is different - reallocate everything. technically, 00188 // we could check the number of rows, and save a new/delete cycle on 00189 // the _index, but it's not that big of a deal if we're reallocating 00190 // the underlying data space anyway. 00191 delete [] _mem_base; 00192 delete [] _index; 00193 _init(newNumRows, newNumCols); 00194 } 00195 } 00196 }
| bool claraty::N_2D_Array< Pixel_Type >::is_subarray | ( | ) | const [inline, inherited] |
| iterator claraty::N_2D_Array< Pixel_Type >::begin | ( | ) | [inline, inherited] |
Definition at line 201 of file 2d_array.h.
00201 { 00202 return iterator(_elements, _is_noncontiguous(), _num_of_cols, _mem_width); 00203 }
| const_iterator claraty::N_2D_Array< Pixel_Type >::begin | ( | ) | const [inline, inherited] |
Definition at line 204 of file 2d_array.h.
00204 { 00205 return const_iterator(_elements, _is_noncontiguous(), _num_of_cols, 00206 _mem_width); 00207 }
| iterator claraty::N_2D_Array< Pixel_Type >::end | ( | ) | [inline, inherited] |
Definition at line 208 of file 2d_array.h.
00208 { 00209 return iterator(_elements + _num_of_rows * _mem_width, 00210 _is_noncontiguous(), _num_of_cols, _mem_width); 00211 }
| const_iterator claraty::N_2D_Array< Pixel_Type >::end | ( | ) | const [inline, inherited] |
Definition at line 212 of file 2d_array.h.
00212 { 00213 return const_iterator(_elements + _num_of_rows * _mem_width, 00214 _is_noncontiguous(), _num_of_cols, _mem_width); 00215 }
| N_2D_Array& claraty::N_2D_Array< Pixel_Type >::displace_subarray | ( | int | delta_x, | |
| int | delta_y | |||
| ) | [inherited] |
| N_2D_Array& claraty::N_2D_Array< Pixel_Type >::resize_subarray | ( | int | left, | |
| int | top, | |||
| int | width, | |||
| int | height | |||
| ) | [inherited] |
| N_2D_Array& claraty::N_2D_Array< Pixel_Type >::associate_subarray | ( | const N_2D_Array< Pixel_Type > & | parent, | |
| int | left, | |||
| int | top, | |||
| int | width, | |||
| int | height | |||
| ) | [inherited] |
| int claraty::N_2D_Array< Pixel_Type >::get_full_num_cols | ( | ) | const [inline, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::get_full_num_rows | ( | ) | const [inline, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::dissociate | ( | int | new_nrows = -1, |
|
| int | new_ncols = -1 | |||
| ) | [inline, inherited] |
Definition at line 251 of file 2d_array.h.
00251 { 00252 int nrows = new_nrows, ncols = new_ncols; 00253 if(nrows < 0) { 00254 nrows = _num_of_rows; 00255 } 00256 if(ncols < 0) { 00257 ncols = _num_of_cols; 00258 } 00259 00260 if (_isSubarray) { 00261 _isSubarray = false; 00262 _num_of_rows = 0; // force re-allocation / compaction 00263 _num_of_cols = 0; 00264 } 00265 if (_ref_count->get_value() != 1) { 00266 _ref_count->decrement(); 00267 _mem_base = 0; // to prevent destruction of shared space on resize 00268 _num_of_rows = 0; // force re-allocation 00269 _num_of_cols = 0; 00270 _ref_count = new Reference_Count(1); // get an independent reference count 00271 } 00272 // Resize if necessary 00273 if((nrows != _num_of_rows) || (ncols != _num_of_cols)) { 00274 resize(nrows, ncols); 00275 } 00276 }
| N_2D_Array<Pixel_Type > claraty::N_2D_Array< Pixel_Type >::get_row | ( | int | row | ) | const [inherited] |
| N_2D_Array<Pixel_Type > claraty::N_2D_Array< Pixel_Type >::get_col | ( | int | col | ) | const [inherited] |
| const Pixel_Type * claraty::N_2D_Array< Pixel_Type >::get_row_pointer | ( | int | row | ) | const [inline, inherited] |
| iterator claraty::N_2D_Array< Pixel_Type >::column_iterator | ( | int | col | ) | [inline, inherited] |
Definition at line 285 of file 2d_array.h.
00285 { 00286 return iterator(_elements + col, true, 1, _mem_width); 00287 }
| const_iterator claraty::N_2D_Array< Pixel_Type >::column_iterator | ( | int | col | ) | const [inline, inherited] |
Definition at line 288 of file 2d_array.h.
00288 { 00289 return const_iterator(_elements + col, true, 1, _mem_width); 00290 }
| Pixel_Type & claraty::N_2D_Array< Pixel_Type >::operator() | ( | int | r, | |
| int | c | |||
| ) | [inline, inherited] |
| const Pixel_Type & claraty::N_2D_Array< Pixel_Type >::operator() | ( | int | r, | |
| int | c | |||
| ) | const [inline, inherited] |
| Pixel_Type & claraty::N_2D_Array< Pixel_Type >::rc | ( | int | row, | |
| int | column | |||
| ) | [inline, inherited] |
| const Pixel_Type & claraty::N_2D_Array< Pixel_Type >::rc | ( | int | row, | |
| int | column | |||
| ) | const [inline, inherited] |
| Pixel_Type & claraty::N_2D_Array< Pixel_Type >::xy | ( | int | x, | |
| int | y | |||
| ) | [inline, inherited] |
| const Pixel_Type & claraty::N_2D_Array< Pixel_Type >::xy | ( | int | x, | |
| int | y | |||
| ) | const [inline, inherited] |
| Pixel_Type & claraty::N_2D_Array< Pixel_Type >::xy | ( | const N_2D_Point_i & | p | ) | [inline, inherited] |
| const Pixel_Type & claraty::N_2D_Array< Pixel_Type >::xy | ( | const N_2D_Point_i & | p | ) | const [inline, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::write | ( | std::ostream & | os | ) | const [inherited] |
| claraty::N_2D_Array< Pixel_Type >::operator void * | ( | ) | const [inherited] |
| N_2D_Array claraty::N_2D_Array< Pixel_Type >::operator== | ( | const N_2D_Array< Pixel_Type > & | rhs | ) | const [inherited] |
| Pixel_Type & claraty::N_2D_Array< Pixel_Type >::element | ( | int | i | ) | [inline, protected, inherited] |
| const Pixel_Type & claraty::N_2D_Array< Pixel_Type >::element | ( | int | i | ) | const [inline, protected, inherited] |
| Pixel_Type * claraty::N_2D_Array< Pixel_Type >::get_data | ( | ) | [inline, protected, inherited] |
| const Pixel_Type * claraty::N_2D_Array< Pixel_Type >::get_data | ( | ) | const [inline, protected, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::_copy | ( | In | start | ) | [protected, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::_copy | ( | Pixel_Type | filler | ) | [protected, inherited] |
| int claraty::N_2D_Array< Pixel_Type >::_check_size | ( | SIZE_TYPE | type, | |
| const N_2D_Array< rhsType > & | rhs | |||
| ) | const [protected, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::_init_special | ( | int | nr, | |
| int | nc, | |||
| Pixel_Type * | data, | |||
| int | memwidth | |||
| ) | [protected, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::_drop_memory | ( | ) | [inline, protected, inherited] |
| void claraty::N_2D_Array< Pixel_Type >::_init_index | ( | bool | allocate = true |
) | [protected, inherited] |
| bool claraty::N_2D_Array< Pixel_Type >::_is_noncontiguous | ( | ) | const [inline, protected, inherited] |
Friends And Related Function Documentation
friend class Camera [friend] |
Definition at line 89 of file camera_image.h.
Member Data Documentation
Time claraty::Camera_Image< Pixel_Type >::_timestamp [private] |
Definition at line 134 of file camera_image.h.
Referenced by claraty::Camera_Image< uint16_t >::get_timestamp(), claraty::Camera_Image< Pixel_Type >::io(), claraty::Camera_Image< Pixel_Type >::operator=(), and claraty::Camera_Image< uint16_t >::set_timestamp().
Camera_Model* claraty::Camera_Image< Pixel_Type >::_model [private] |
Definition at line 135 of file camera_image.h.
Referenced by claraty::Camera_Image< uint16_t >::get_camera_model(), claraty::Camera_Image< Pixel_Type >::io(), claraty::Camera_Image< Pixel_Type >::set_camera_model(), and claraty::Camera_Image< Pixel_Type >::~Camera_Image().
Camera_Image_Properties* claraty::Camera_Image< Pixel_Type >::_properties [private] |
Definition at line 136 of file camera_image.h.
Referenced by claraty::Camera_Image< uint16_t >::get_properties(), claraty::Camera_Image< Pixel_Type >::operator=(), claraty::Camera_Image< uint16_t >::set_properties(), and claraty::Camera_Image< Pixel_Type >::~Camera_Image().
int claraty::N_2D_Array< Pixel_Type >::_num_of_rows [protected, inherited] |
Definition at line 77 of file 2d_array.h.
int claraty::N_2D_Array< Pixel_Type >::_num_of_cols [protected, inherited] |
Definition at line 77 of file 2d_array.h.
int claraty::N_2D_Array< Pixel_Type >::_mem_width [protected, inherited] |
Definition at line 77 of file 2d_array.h.
int claraty::N_2D_Array< Pixel_Type >::_mem_height [protected, inherited] |
Definition at line 77 of file 2d_array.h.
Pixel_Type * claraty::N_2D_Array< Pixel_Type >::_elements [protected, inherited] |
Definition at line 79 of file 2d_array.h.
Pixel_Type ** claraty::N_2D_Array< Pixel_Type >::_index [protected, inherited] |
Definition at line 80 of file 2d_array.h.
Pixel_Type * claraty::N_2D_Array< Pixel_Type >::_mem_base [protected, inherited] |
Definition at line 82 of file 2d_array.h.
Reference_Count* claraty::N_2D_Array< Pixel_Type >::_ref_count [protected, inherited] |
Definition at line 83 of file 2d_array.h.
bool claraty::N_2D_Array< Pixel_Type >::_isSubarray [protected, inherited] |
Definition at line 85 of file 2d_array.h.
The documentation for this class was generated from the following files: