fix document naming and file dialogs preset, add touch scroll, flip thumbnail, scroll gesture and wheel for sidebar
This commit is contained in:
@@ -22,3 +22,18 @@ bool Image::load(std::string filename)
|
||||
m_data = std::unique_ptr<uint8_t[]>(buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Image::flip()
|
||||
{
|
||||
auto flipped = std::make_unique<uint8_t[]>(width*height*4);
|
||||
int line_size = width * 4;
|
||||
const uint8_t* src = m_data.get();
|
||||
uint8_t* dst = flipped.get() + line_size * (height - 1);
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
std::copy(src, src+line_size, dst);
|
||||
src += line_size;
|
||||
dst -= line_size;
|
||||
}
|
||||
std::swap(m_data, flipped);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user