| 454 | return _is_loaded; |
| 455 | } |
| 456 | void open(const std::string &filename) override |
| 457 | { |
| 458 | int bpp, width, height; |
| 459 | uint8_t *rgb_image = stbi_load(filename.c_str(), &width, &height, &bpp, 3); |
| 460 | if (rgb_image == NULL) |
| 461 | { |
| 462 | ARM_COMPUTE_ERROR_VAR("Accessing %s failed", filename.c_str()); |
| 463 | } |
| 464 | else |
| 465 | { |
| 466 | _width = width; |
| 467 | _height = height; |
| 468 | _data = std::unique_ptr<uint8_t, malloc_deleter>(rgb_image); |
| 469 | _is_loaded = true; |
| 470 | _feeder = std::make_unique<MemoryImageFeeder>(_data.get()); |
| 471 | } |
| 472 | } |
| 473 | void close() override |
| 474 | { |
| 475 | if (is_open()) |