X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fargb_frame.cc;h=a48f80bb76364a3ca7aea061690780f9f095d8d7;hb=709213a3200cd13b87565cc221f14db0fdb5d00e;hp=7a9ad2b94825b421cf4e7ee2a9b4d28cab073221;hpb=3541f4c9bd91169e55a82b9fa46767b46ca06188;p=libdcp.git diff --git a/src/argb_frame.cc b/src/argb_frame.cc index 7a9ad2b9..a48f80bb 100644 --- a/src/argb_frame.cc +++ b/src/argb_frame.cc @@ -21,11 +21,14 @@ using namespace libdcp; -ARGBFrame::ARGBFrame (int width, int height) - : _width (width) - , _height (height) +/** Construct an empty ARGBFrame of a given size and with + * undefined contents. + * @param size Size in pixels. + */ +ARGBFrame::ARGBFrame (Size size) + : _size (size) { - _data = new uint8_t[width * height * 4]; + _data = new uint8_t[_size.width * _size.height * 4]; } @@ -34,8 +37,9 @@ ARGBFrame::~ARGBFrame () delete[] _data; } +/** @return The stride, in bytes; that is, the number of bytes per row of the image */ int ARGBFrame::stride () const { - return _width * 4; + return _size.width * 4; }