mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Fix embedded V4L2 grabber
Former-commit-id: f9dc759a8fcac8ac95288b12a007e9c78aed82c3
This commit is contained in:
@@ -13,6 +13,14 @@ public:
|
||||
|
||||
typedef Pixel_T pixel_type;
|
||||
|
||||
///
|
||||
/// Default constructor for an image
|
||||
///
|
||||
Image() :
|
||||
Image(1, 1)
|
||||
{
|
||||
}
|
||||
|
||||
///
|
||||
/// Constructor for an image with specified width and height
|
||||
///
|
||||
@@ -22,8 +30,8 @@ public:
|
||||
Image(const unsigned width, const unsigned height) :
|
||||
_width(width),
|
||||
_height(height),
|
||||
_pixels(new Pixel_T[width*height + 1]),
|
||||
_endOfPixels(_pixels + width*height)
|
||||
_pixels(new Pixel_T[width * height + 1]),
|
||||
_endOfPixels(_pixels + width * height)
|
||||
{
|
||||
memset(_pixels, 0, (_width*_height+1)*sizeof(Pixel_T));
|
||||
}
|
||||
@@ -38,12 +46,24 @@ public:
|
||||
Image(const unsigned width, const unsigned height, const Pixel_T background) :
|
||||
_width(width),
|
||||
_height(height),
|
||||
_pixels(new Pixel_T[width*height + 1]),
|
||||
_endOfPixels(_pixels + width*height)
|
||||
_pixels(new Pixel_T[width * height + 1]),
|
||||
_endOfPixels(_pixels + width * height)
|
||||
{
|
||||
std::fill(_pixels, _endOfPixels, background);
|
||||
}
|
||||
|
||||
///
|
||||
/// Copy constructor for an image
|
||||
///
|
||||
Image(const Image & other) :
|
||||
_width(other._width),
|
||||
_height(other._height),
|
||||
_pixels(new Pixel_T[other._width * other._height + 1]),
|
||||
_endOfPixels(_pixels + other._width * other._height)
|
||||
{
|
||||
memcpy(_pixels, other._pixels, other._width * other._height * sizeof(Pixel_T));
|
||||
}
|
||||
|
||||
///
|
||||
/// Destructor
|
||||
///
|
||||
|
Reference in New Issue
Block a user