esp_jpg_decode.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _ESP_JPG_DECODE_H_
  15. #define _ESP_JPG_DECODE_H_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include <stddef.h>
  20. #include <stdint.h>
  21. #include <stdbool.h>
  22. #include "esp_err.h"
  23. typedef enum {
  24. JPG_SCALE_NONE,
  25. JPG_SCALE_2X,
  26. JPG_SCALE_4X,
  27. JPG_SCALE_8X,
  28. JPG_SCALE_MAX = JPG_SCALE_8X
  29. } jpg_scale_t;
  30. typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len);
  31. typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data);
  32. esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif /* _ESP_JPG_DECODE_H_ */