Ejemplo n.º 1
0
void ArrayPixMap::resize(Size new_size) {
    using sfz::swap;
    using std::min;
    ArrayPixMap new_pix_map(new_size.width, new_size.height);
    Size min_size(min(size().width, new_size.width), min(size().height, new_size.height));
    Rect transfer = min_size.as_rect();
    new_pix_map.view(transfer).copy(view(transfer));
    _size = new_size;
    swap(_bytes, new_pix_map._bytes);
}
Ejemplo n.º 2
0
void ArrayPixMap::swap(ArrayPixMap& other) {
    using sfz::swap;
    using std::swap;
    swap(_size, other._size);
    swap(_bytes, other._bytes);
}