Commit 19ccb387 authored by Davis King's avatar Davis King

Changed the spec to say that array2d objects don't put padding at the

ends of the rows.
parent 4fdb329f
...@@ -52,10 +52,9 @@ namespace dlib ...@@ -52,10 +52,9 @@ namespace dlib
of this object throw exceptions. of this object throw exceptions.
Finally, note that this object stores each row of data contiguously Finally, note that this object stores its data contiguously and in
in memory, and the overall layout is in row major order. However, row major order. Moreover, there is no padding at the end of each row.
there might be padding at the end of each row. To determine the This means that its width_step() value is always equal to sizeof(type)*nc().
offset from one row to another you can use width_step().
!*/ !*/
...@@ -229,6 +228,12 @@ namespace dlib ...@@ -229,6 +228,12 @@ namespace dlib
- returns the size of one row of the image, in bytes. - returns the size of one row of the image, in bytes.
More precisely, return a number N such that: More precisely, return a number N such that:
(char*)&item[0][0] + N == (char*)&item[1][0]. (char*)&item[0][0] + N == (char*)&item[1][0].
- for dlib::array2d objects, the returned value
is always equal to sizeof(type)*nc(). However,
other objects which implement dlib::array2d style
interfaces might have padding at the ends of their
rows and therefore might return larger numbers.
An example of such an object is the dlib::cv_image.
!*/ !*/
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment