libwebsockets
Lightweight C library for HTML5 websockets
lws-jpeg.h
Go to the documentation of this file.
1 /*
2  * lws jpeg
3  *
4  * Copyright (C) 2019 - 2022 Andy Green <andy@warmcat.com>
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22  * IN THE SOFTWARE.
23  *
24  * Based on public domain original with notice -->
25  *
26  * picojpeg.c v1.1 - Public domain, Rich Geldreich <richgel99@gmail.com>
27  * Nov. 27, 2010 - Initial release
28  * Feb. 9, 2013 - Added H1V2/H2V1 support, cleaned up macros, signed shift fixes
29  * Also integrated and tested changes from Chris Phoenix <cphoenix@gmail.com>.
30  *
31  * This version is rewritten for lws, changing the whole approach to decode on
32  * demand to issue a line of output at a time, statefully. This version is
33  * licensed MIT to match the rest of lws.
34  */
35 
36 typedef struct lws_jpeg lws_jpeg_t;
37 
46 
56 
90  const uint8_t **buf, size_t *size, char hold_at_metadata);
91 
92 LWS_VISIBLE LWS_EXTERN unsigned int
94 LWS_VISIBLE LWS_EXTERN unsigned int
96 LWS_VISIBLE LWS_EXTERN unsigned int
98 LWS_VISIBLE LWS_EXTERN unsigned int
100 LWS_VISIBLE LWS_EXTERN unsigned int
102 LWS_VISIBLE LWS_EXTERN unsigned int
104 
#define LWS_EXTERN
unsigned char uint8_t
lws_stateful_ret_t
#define LWS_VISIBLE
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_width(const lws_jpeg_t *j)
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_height(const lws_jpeg_t *j)
LWS_VISIBLE LWS_EXTERN void lws_jpeg_free(lws_jpeg_t **j)
LWS_VISIBLE LWS_EXTERN lws_stateful_ret_t lws_jpeg_emit_next_line(lws_jpeg_t *j, const uint8_t **ppix, const uint8_t **buf, size_t *size, char hold_at_metadata)
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_bitdepth(const lws_jpeg_t *j)
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_bpp(const lws_jpeg_t *j)
LWS_VISIBLE LWS_EXTERN lws_jpeg_t * lws_jpeg_new(void)
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_components(const lws_jpeg_t *j)
LWS_VISIBLE LWS_EXTERN unsigned int lws_jpeg_get_pixelsize(const lws_jpeg_t *j)
struct lws_jpeg lws_jpeg_t
Definition: lws-jpeg.h:36