X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fargb_frame.h;h=419227bbbb19bd1504d18ae661db4cbd9944d831;hb=77b0ffe6c50796b8fb132f56394995e0df089713;hp=bc78b8fba5ef2c33b7d25b8de347f1f38bd5a10e;hpb=3541f4c9bd91169e55a82b9fa46767b46ca06188;p=libdcp.git diff --git a/src/argb_frame.h b/src/argb_frame.h index bc78b8fb..419227bb 100644 --- a/src/argb_frame.h +++ b/src/argb_frame.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,27 +17,53 @@ */ +/** @file src/argb_frame.h + * @brief ARGBFrame class. + */ + +#include "util.h" #include -namespace libdcp +namespace dcp { -class ARGBFrame +/** @class ARGBFrame + * @brief A single frame of picture data held in an ARGB buffer. + * + * The format of the data is: + * + *
+ *  Byte   /- 0 -------|- 1 --------|- 2 --------|- 3 --------|- 4 --------|- 5 --------| ...
+ *         |(0, 0) Blue|(0, 0)Green |(0, 0) Red  |(0, 0) Alpha|(0, 1) Blue |(0, 1) Green| ...
+ *  
+ * + * So that the first byte is the blue component of the pixel at x=0, y=0, the second + * is the green component, and so on. + * + * Lines are packed so that the second row directly follows the first. + */ +class ARGBFrame : boost::noncopyable { public: - ARGBFrame (int width, int height); + ARGBFrame (Size size); ~ARGBFrame (); + /** @return pointer to the image data */ uint8_t* data () const { return _data; } + /** @return length of one picture row in bytes */ int stride () const; + /** @return size of the picture in pixels */ + Size size () const { + return _size; + } + private: - int _width; - int _height; - uint8_t* _data; + Size _size; ///< frame size in pixels + uint8_t* _data; ///< pointer to image data }; }