summaryrefslogtreecommitdiff
path: root/include/libopenraw/rawfile.h
blob: 57808d6dbd8b4173a98d8cccd780f7926e45a155 (plain)
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
/*
 * libopenraw - rawfile.h
 *
 * Copyright (C) 2007 Hubert Figuiere
 *
 * 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 3 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, see
 * <http://www.gnu.org/licenses/>.
 */


#ifndef __LIBOPENRAW_RAWFILE_H_
#define __LIBOPENRAW_RAWFILE_H_

#include <libopenraw/types.h>
#include <libopenraw/consts.h>
#include <libopenraw/rawdata.h>
#include <libopenraw/thumbnails.h>
#include <libopenraw/metadata.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _RawFile *ORRawFileRef;

ORRawFileRef
or_rawfile_new(const char* filename, or_rawfile_type type);

ORRawFileRef
or_rawfile_new_from_memory(const uint8_t *buffer, uint32_t len, or_rawfile_type type);

or_error
or_rawfile_release(ORRawFileRef rawfile);

or_rawfile_type
or_rawfile_get_type(ORRawFileRef rawfile);

/** return the typeid to identify the exact file type */
or_rawfile_typeid
or_rawfile_get_typeid(ORRawFileRef rawfile);

or_error
or_rawfile_get_thumbnail(ORRawFileRef rawfile, uint32_t preferred_size,
						 ORThumbnailRef thumb);

or_error
or_rawfile_get_rawdata(ORRawFileRef rawfile, ORRawDataRef rawdata, 
						   uint32_t options);

/** Get the orientation, This is a convenience method.
 * @param rawfile the RAW file object.
 * @return the orienation using EXIF semantics. If
 * there is no orientation attribute, return 0.
 */
int32_t
or_rawfile_get_orientation(ORRawFileRef rawfile);

#if 0
/** Get the metadata value
 * @param rawfile the RAW file object.
 * @param meta_index the index value which is NS | index
 */
ORConstMetaValueRef
or_rawfile_get_metavalue(ORRawFileRef rawfile, int32_t meta_index);

/** Get the metadata out of the raw file as XMP
 * @param rawfile the rawfile object
 * @return the XMP meta. It belongs to the rawfile.
 * Use Exempi to deal with the content.
 */
XmpPtr
or_rawfile_get_xmp(ORRawFileRef rawfile);

#endif

#ifdef __cplusplus
}
#endif

#endif