minidlna: update to 1.1.5
[tomato.git] / release / src / router / minidlna / image_utils.h
blob7011c73856a0e19819945c98aea2db900fdcb3c3
1 /* Image manipulation functions
3 * Project : minidlna
4 * Website : http://sourceforge.net/projects/minidlna/
5 * Author : Justin Maggard
7 * MiniDLNA media server
8 * Copyright (C) 2009 Justin Maggard
10 * This file is part of MiniDLNA.
12 * MiniDLNA is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
16 * MiniDLNA is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
24 #include <inttypes.h>
26 #define ROTATE_NONE 0x0
27 #define ROTATE_90 0x1
28 #define ROTATE_180 0x2
29 #define ROTATE_270 0x4
31 typedef uint32_t pix;
33 typedef struct {
34 int32_t width;
35 int32_t height;
36 pix *buf;
37 } image_s;
39 void
40 image_free(image_s *pimage);
42 int
43 image_get_jpeg_date_xmp(const char * path, char ** date);
45 int
46 image_get_jpeg_resolution(const char * path, int * width, int * height);
48 image_s *
49 image_new_from_jpeg(const char *path, int is_file, const uint8_t *ptr, int size, int scale, int resize);
51 image_s *
52 image_resize(image_s * src_image, int32_t width, int32_t height);
54 unsigned char *
55 image_save_to_jpeg_buf(image_s * pimage, int * size);
57 char *
58 image_save_to_jpeg_file(image_s * pimage, char * path);