File: jpeg-data.h

package info (click to toggle)
exif 0.6.22-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 860 kB
  • sloc: ansic: 1,772; sh: 777; makefile: 80
file content (92 lines) | stat: -rw-r--r-- 2,576 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* jpeg-data.h
 *
 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301  USA.
 */

#ifndef __JPEG_DATA_H__
#define __JPEG_DATA_H__

#include "libjpeg/jpeg-marker.h"

#include <libexif/exif-data.h>
#include <libexif/exif-log.h>

typedef ExifData * JPEGContentAPP1;

typedef struct _JPEGContentGeneric JPEGContentGeneric;
struct _JPEGContentGeneric
{
	unsigned char *data;
	unsigned int size;
};

typedef union _JPEGContent JPEGContent;
union _JPEGContent
{
	JPEGContentGeneric generic;
	JPEGContentAPP1    app1;
};

typedef struct _JPEGSection JPEGSection;
struct _JPEGSection
{
	JPEGMarker marker;
	JPEGContent content;
};

typedef struct _JPEGData        JPEGData;
typedef struct _JPEGDataPrivate JPEGDataPrivate;

struct _JPEGData
{
	JPEGSection *sections;
	unsigned int count;

	unsigned char *data;
	unsigned int size;

	JPEGDataPrivate *priv;
};

JPEGData *jpeg_data_new           (void);
JPEGData *jpeg_data_new_from_file (const char *path);
JPEGData *jpeg_data_new_from_data (const unsigned char *data,
				   unsigned int size);

void      jpeg_data_ref   (JPEGData *data);
void      jpeg_data_unref (JPEGData *data);
void      jpeg_data_free  (JPEGData *data);

void      jpeg_data_load_data     (JPEGData *data, const unsigned char *d,
				   unsigned int size);
void      jpeg_data_save_data     (JPEGData *data, unsigned char **d,
				   unsigned int *size);

void      jpeg_data_load_file     (JPEGData *data, const char *path);
int       jpeg_data_save_file     (JPEGData *data, const char *path);

void      jpeg_data_set_exif_data (JPEGData *data, ExifData *exif_data);
ExifData *jpeg_data_get_exif_data (JPEGData *data);

void      jpeg_data_dump (JPEGData *data);

void      jpeg_data_append_section (JPEGData *data);

void      jpeg_data_log (JPEGData *data, ExifLog *log);

#endif /* __JPEG_DATA_H__ */