home.cpp 508 B

12345678910111213141516
  1. Home::Home(View* parent) : Panel(parent, Size{~0, ~0}) {
  2. setCollapsible().setVisible(false);
  3. image icon{Resource::Higan::Icon};
  4. icon.shrink();
  5. for(uint y : range(icon.height())) {
  6. auto data = icon.data() + y * icon.pitch();
  7. for(uint x : range(icon.width())) {
  8. uint8_t alpha = icon.read(data) >> 24;
  9. icon.write(data, uint8_t(alpha * 0.15) << 24);
  10. data += icon.stride();
  11. }
  12. }
  13. icon.scale(sx(icon.width() * 0.75), sy(icon.height() * 0.75));
  14. iconCanvas.setIcon(icon);
  15. }