decode_image.h 588 B

1234567891011121314
  1. #pragma once
  2. #include <stdint.h>
  3. #include "esp_err.h"
  4. /**
  5. * @brief Decode the jpeg ``image.jpg`` embedded into the program file into pixel data.
  6. *
  7. * @param pixels A pointer to a pointer for an array of rows, which themselves are an array of pixels.
  8. * Effectively, you can get the pixel data by doing ``decode_image(&myPixels); pixelval=myPixels[ypos][xpos];``
  9. * @return - ESP_ERR_NOT_SUPPORTED if image is malformed or a progressive jpeg file
  10. * - ESP_ERR_NO_MEM if out of memory
  11. * - ESP_OK on succesful decode
  12. */
  13. esp_err_t decode_image(uint16_t ***pixels);