summaryrefslogtreecommitdiff
path: root/src/lib/image.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-16 23:43:22 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-16 23:43:22 +0000
commit4e79cb88c22a7b2d52381f0a1a1ffdb5015fa617 (patch)
tree8f199cd05396353a263e156448ca2ef1bf30eaa6 /src/lib/image.h
parenta7f27819cbb7db110587603c2d0717dd4c018c11 (diff)
Try again to sort out image alignment a bit.
Diffstat (limited to 'src/lib/image.h')
-rw-r--r--src/lib/image.h31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/lib/image.h b/src/lib/image.h
index 0cd38da11..22758a6cf 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -69,9 +69,10 @@ public:
int components () const;
int lines (int) const;
- boost::shared_ptr<Image> scale_and_convert_to_rgb (Size, int, Scaler const *) const;
- boost::shared_ptr<Image> scale (Size, Scaler const *) const;
- boost::shared_ptr<Image> post_process (std::string) const;
+
+ boost::shared_ptr<Image> scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scaler, bool aligned) const;
+ boost::shared_ptr<Image> scale (Size, Scaler const *, bool aligned) const;
+ boost::shared_ptr<Image> post_process (std::string, bool aligned) const;
void alpha_blend (boost::shared_ptr<const Image> image, Position pos);
void make_black ();
@@ -111,7 +112,8 @@ private:
class SimpleImage : public Image
{
public:
- SimpleImage (AVPixelFormat, Size, boost::function<int (int, int const *)> rounder);
+ SimpleImage (AVPixelFormat, Size, bool);
+ SimpleImage (boost::shared_ptr<const Image>, bool aligned);
~SimpleImage ();
uint8_t ** data () const;
@@ -125,26 +127,7 @@ private:
uint8_t** _data; ///< array of pointers to components
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 AlignedImage
- * @brief An image whose pixel data is padded so that rows always start on 32-byte boundaries.
- */
-class AlignedImage : public SimpleImage
-{
-public:
- AlignedImage (AVPixelFormat, Size);
- AlignedImage (boost::shared_ptr<const Image>);
-};
-
-/** @class CompactImage
- * @brief An image whose pixel data is not padded, so rows may start at any pixel alignment.
- */
-class CompactImage : public SimpleImage
-{
-public:
- CompactImage (AVPixelFormat, Size);
- CompactImage (boost::shared_ptr<const Image>);
+ bool _aligned;
};
class RGBPlusAlphaImage : public SimpleImage