/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
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
*/
+/** @file src/argb_frame.cc
+ * @brief ARGBFrame class.
+ */
+
#include "argb_frame.h"
-using namespace libdcp;
+using namespace dcp;
-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];
}
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;
}