/* * Copyright (c) 2012 Yoann Blein * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include namespace Swift { Image::Image(int width, int height, uint8_t* rgb24data) : width(width), height(height) { int len = width * height * 3; if (rgb24data) { data.insert(data.begin(), rgb24data, rgb24data + len); } else { data.resize(len); } } }