decode_image.h 937 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #pragma once
  8. #include <stdint.h>
  9. #include "esp_err.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief Decode the jpeg ``image.jpg`` embedded into the program file into pixel data.
  15. *
  16. * @param pixels A pointer to a pointer for an array of rows, which themselves are an array of pixels.
  17. * Effectively, you can get the pixel data by doing ``decode_image(&myPixels); pixelval=myPixels[ypos][xpos];``
  18. * @return - ESP_ERR_NOT_SUPPORTED if image is malformed or a progressive jpeg file
  19. * - ESP_ERR_NO_MEM if out of memory
  20. * - ESP_OK on succesful decode
  21. */
  22. esp_err_t decode_image(uint16_t ***pixels);
  23. #ifdef __cplusplus
  24. }
  25. #endif