void Image4uint8::copyArray(const Color3* src, int w, int h) { resize(w, h); int N = w * h; Color4uint8* dst = getCArray(); for (int i = 0; i < N; ++i) { dst[i] = Color4uint8(Color4(src[i], 1.0f)); } }
/** Saves in any of the formats supported by G3D::GImage. */ void Image4::save(const std::string& filename, GImage::Format fmt) { GImage im(width(), height(), 4); int N = im.width() * im.height(); Color4uint8* dst = im.pixel4(); for (int i = 0; i < N; ++i) { dst[i] = Color4uint8(data[i]); } im.save(filename, fmt); }