+#include "image.h"
#include <msp/core/refptr.h>
#include <msp/fs/utils.h>
#include <msp/io/file.h>
#include <msp/io/memory.h>
-#include "image.h"
#include "imageloader.h"
using namespace std;
namespace Msp {
namespace Graphics {
-Image::Data::Data():
- fmt(RGB),
- width(0),
- height(0),
- owned_pixels(0),
- pixels(0)
-{ }
-
Image::Data::Data(const Data &other):
fmt(other.fmt),
width(other.width),
height(other.height),
stride(other.stride),
- owned_pixels(other.pixels ? new char[stride*height] : 0),
+ owned_pixels(other.pixels ? new char[stride*height] : nullptr),
pixels(owned_pixels)
{
if(pixels)
Image::Data &Image::Data::operator=(const Data &other)
{
delete[] owned_pixels;
- pixels = owned_pixels = 0;
+ pixels = owned_pixels = nullptr;
fmt = other.fmt;
width = other.width;