///////////////////////////////////////////////////////
| 77 | |
| 78 | //////////////////////////////////////////////////////////// |
| 79 | std::optional<Cursor> Cursor::createFromPixels(const std::uint8_t* pixels, Vector2u size, Vector2u hotspot) |
| 80 | { |
| 81 | if ((pixels == nullptr) || (size.x == 0) || (size.y == 0)) |
| 82 | { |
| 83 | err() << "Failed to create cursor from pixels (invalid arguments)" << std::endl; |
| 84 | return std::nullopt; |
| 85 | } |
| 86 | |
| 87 | Cursor cursor; |
| 88 | if (!cursor.m_impl->loadFromPixels(pixels, size, hotspot)) |
| 89 | { |
| 90 | // Error message generated in called function. |
| 91 | return std::nullopt; |
| 92 | } |
| 93 | |
| 94 | return cursor; |
| 95 | } |
| 96 | |
| 97 | |
| 98 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected