summaryrefslogtreecommitdiff
path: root/src/lib/image.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-14 20:51:43 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-14 20:51:43 +0100
commitade28a703b15af710161faa017cddf95d66c4118 (patch)
treec581d457104195a0219a0197c523981756bf9ecd /src/lib/image.h
parent129afab72bfc026b5704c41a6bfc0f4b3a2c4033 (diff)
Try to clarify the difference between line size and stride.
Diffstat (limited to 'src/lib/image.h')
-rw-r--r--src/lib/image.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/image.h b/src/lib/image.h
index ea35fa0b9..3e16d43bf 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -57,9 +57,12 @@ public:
/** @return Array of pointers to arrays of the component data */
virtual uint8_t ** data () const = 0;
- /** @return Array of sizes of each line, in pixels */
+ /** @return Array of sizes of the data in each line, in bytes (without any alignment padding bytes) */
virtual int * line_size () const = 0;
+ /** @return Array of strides for each line (including any alignment padding bytes) */
+ virtual int * stride () const = 0;
+
/** @return Size of the image, in pixels */
virtual Size size () const = 0;
@@ -91,6 +94,7 @@ public:
uint8_t ** data () const;
int * line_size () const;
+ int * stride () const;
Size size () const;
private:
@@ -108,12 +112,15 @@ public:
uint8_t ** data () const;
int * line_size () const;
+ int * stride () const;
Size size () const;
private:
Size _size; ///< size in pixels
uint8_t** _data; ///< array of pointers to components
- int* _line_size; ///< array of widths of each line, in bytes
+ int* _line_size; ///< array of sizes of the data in each line, in pixels (without any alignment padding bytes)
+ int* _stride; ///< array of strides for each line (including any alignment padding bytes)
+
};
/** @class RGBFrameImage
@@ -127,6 +134,7 @@ public:
uint8_t ** data () const;
int * line_size () const;
+ int * stride () const;
Size size () const;
AVFrame * frame () const {
return _frame;