diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-08-14 14:49:02 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-08-14 14:49:02 +0200 |
commit | 7db0ce19674393a4dd9af3beed236038bcfa2e65 (patch) | |
tree | a9d1f410fbbac877919ef3a72ce0abd35eabaa43 /plugintest.cc | |
parent | a9eadcc1b483d5d30a8443e78fa4d84c8f18d6c3 (diff) |
Experimental inline display added.
Diffstat (limited to 'plugintest.cc')
-rw-r--r-- | plugintest.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/plugintest.cc b/plugintest.cc index 48dad58..a23c44b 100644 --- a/plugintest.cc +++ b/plugintest.cc @@ -173,6 +173,38 @@ void PluginTest::process(size_t pos, } } +bool PluginTest::hasInlineGUI() +{ + return true; +} + +void PluginTest::onInlineRedraw(std::size_t width, + std::size_t max_height, + InlineDrawContext& context) +{ + std::size_t height = std::min(width / 2, max_height); + if (!context.data || (context.width != width)) + { + delete[] context.data; + context.data = new std::uint8_t[width * height * 4]; + } + + context.width = width; + context.height = height; + + for(std::size_t x = 0; x < context.width; ++x) + { + for(std::size_t y = 0; y < context.height; ++y) + { + unsigned char* p = context.data + ((x + y * context.width) * 4); + p[0] = 0; // B; + p[1] = 0; // G + p[2] = 255; // R + p[3] = 0; // A + } + } +} + bool PluginTest::hasGUI() { return true; |