xbmc
imagedecoder.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #ifndef C_API_ADDONINSTANCE_IMAGEDECODER_H
10 #define C_API_ADDONINSTANCE_IMAGEDECODER_H
11 
12 #include "../addon_base.h"
13 
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif /* __cplusplus */
18 
19  typedef KODI_ADDON_INSTANCE_HDL KODI_ADDON_IMAGEDECODER_HDL;
20 
21  //============================================================================
29  typedef enum ADDON_IMG_FMT
30  {
34 
37 
40 
43  } ADDON_IMG_FMT;
45  //----------------------------------------------------------------------------
46 
47  //============================================================================
54  typedef enum ADDON_IMG_ORIENTATION
55  {
58 
61 
64 
67 
70 
73 
76 
81  //----------------------------------------------------------------------------
82 
83  //============================================================================
90  typedef enum ADDON_IMG_COLOR
91  {
94 
99  //----------------------------------------------------------------------------
100 
101  //============================================================================
108  {
111 
114 
117 
120 
123 
126 
129 
134  //----------------------------------------------------------------------------
135 
136  //============================================================================
144  {
147 
150 
153 
156 
159 
162 
165 
168 
171 
177  //----------------------------------------------------------------------------
178 
179  //============================================================================
190  {
193 
196 
201  //----------------------------------------------------------------------------
202 
203  //============================================================================
210  {
213 
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
249 
252 
255 
258 
261 
264 
267 
270 
275  //----------------------------------------------------------------------------
276 
277  //============================================================================
283  typedef enum ADDON_IMG_FLASH_TYPE
284  {
287 
290 
293 
296 
299 
302 
305 
308 
311 
314 
317 
320 
323 
326 
329 
332 
335 
338 
341 
344 
347 
350 
353 
356 
359 
362 
367  //----------------------------------------------------------------------------
368 
370  {
371  int width;
372  int height;
373  float distance;
374  enum ADDON_IMG_ORIENTATION orientation;
375  enum ADDON_IMG_COLOR color;
376  enum ADDON_IMG_METERING_MODE metering_mode;
377  float exposure_time;
378  float exposure_bias;
379  enum ADDON_IMG_EXPOSURE_PROGRAM exposure_program;
380  enum ADDON_IMG_EXPOSURE_MODE exposure_mode;
381  time_t time_created;
382  float aperture_f_number;
383  enum ADDON_IMG_FLASH_TYPE flash_used;
384  int focal_length;
385  int focal_length_in_35mm_format;
386  float digital_zoom_ratio;
387  float iso_speed;
388  enum ADDON_IMG_LIGHT_SOURCE light_source;
389 
390  bool gps_info_present;
391  char latitude_ref;
392  float latitude[3]; /* Deg,min,sec */
393  char longitude_ref;
394  float longitude[3]; /* Deg,min,sec */
395  int altitude_ref;
396  float altitude;
397 
398  char* camera_manufacturer;
399  char* camera_model;
400  char* author;
401  char* description;
402  char* copyright;
403  };
404 
405  typedef bool(ATTR_APIENTRYP PFN_KODI_ADDON_IMAGEDECODER_SUPPORTS_FILE_V1)(
406  const KODI_ADDON_IMAGEDECODER_HDL hdl, const char* file);
407  typedef bool(ATTR_APIENTRYP PFN_KODI_ADDON_IMAGEDECODER_READ_TAG_V1)(
408  const KODI_ADDON_IMAGEDECODER_HDL hdl,
409  const char* file,
410  struct KODI_ADDON_IMAGEDECODER_INFO_TAG* info);
411  typedef bool(ATTR_APIENTRYP PFN_KODI_ADDON_IMAGEDECODER_LOAD_IMAGE_FROM_MEMORY_V1)(
412  const KODI_ADDON_IMAGEDECODER_HDL hdl,
413  const char* mimetype,
414  const uint8_t* buffer,
415  size_t buf_size,
416  unsigned int* width,
417  unsigned int* height);
418  typedef bool(ATTR_APIENTRYP PFN_KODI_ADDON_IMAGEDECODER_DECODE_V1)(
419  const KODI_ADDON_IMAGEDECODER_HDL hdl,
420  uint8_t* pixels,
421  size_t pixels_size,
422  unsigned int width,
423  unsigned int height,
424  unsigned int pitch,
425  enum ADDON_IMG_FMT format);
426 
428  {
429  PFN_KODI_ADDON_IMAGEDECODER_SUPPORTS_FILE_V1 supports_file;
430  PFN_KODI_ADDON_IMAGEDECODER_READ_TAG_V1 read_tag;
431  PFN_KODI_ADDON_IMAGEDECODER_LOAD_IMAGE_FROM_MEMORY_V1 load_image_from_memory;
432  PFN_KODI_ADDON_IMAGEDECODER_DECODE_V1 decode;
434 
436  {
437  KODI_HANDLE kodi_instance;
439 
441  {
442  struct AddonToKodiFuncTable_ImageDecoder* toKodi;
443  struct KodiToAddonFuncTable_ImageDecoder* toAddon;
445 
446 #ifdef __cplusplus
447 } /* extern "C" */
448 #endif /* __cplusplus */
449 
450 #endif /* !C_API_ADDONINSTANCE_IMAGEDECODER_H */
0 = Unknown
Definition: imagedecoder.h:110
20 = D55
Definition: imagedecoder.h:257
Black/White image.
Definition: imagedecoder.h:96
5 = Creative program (biased toward depth of field)
Definition: imagedecoder.h:161
0x18 = Auto, Did not fire
Definition: imagedecoder.h:316
0x5f = Auto, Fired, Red-eye reduction, Return detected
Definition: imagedecoder.h:364
9 = Bulb
Definition: imagedecoder.h:174
2 = Center-weighted average
Definition: imagedecoder.h:116
0x59 = Auto, Fired, Red-eye reduction
Definition: imagedecoder.h:358
0x8 = On, Did not fire
Definition: imagedecoder.h:298
0xd = On, Return not detected
Definition: imagedecoder.h:304
0x20 = No flash function
Definition: imagedecoder.h:328
0x45 = Fired, Red-eye reduction, Return not detected
Definition: imagedecoder.h:337
0 = Unknown
Definition: imagedecoder.h:212
Rotate 90° CCW.
Definition: imagedecoder.h:78
3 = Aperture-priority
Definition: imagedecoder.h:155
ADDON_IMG_EXPOSURE_PROGRAM
Definition: imagedecoder.h:143
0x30 = Off, No flash function
Definition: imagedecoder.h:331
11 = Shade
Definition: imagedecoder.h:233
Rotate 270° CCW.
Definition: imagedecoder.h:72
ADDON_IMG_COLOR
Definition: imagedecoder.h:90
8 = Landscape mode (for landscape photos with the background in focus)
Definition: imagedecoder.h:170
14 = Cool white fluorescent (W 3900 - 4500K)
Definition: imagedecoder.h:242
ADDON_IMG_FMT
Definition: imagedecoder.h:29
0x14 = Off, Did not fire, Return not detected
Definition: imagedecoder.h:313
0x5d = Auto, Fired, Red-eye reduction, Return not detected
Definition: imagedecoder.h:361
0x41 = Fired, Red-eye reduction
Definition: imagedecoder.h:334
1 = Manual
Definition: imagedecoder.h:149
Definition: imagedecoder.h:435
3 = Tungsten (incandescent light)
Definition: imagedecoder.h:221
0x49 = On, Red-eye reduction
Definition: imagedecoder.h:343
6 = Action program (biased toward fast shutter speed)
Definition: imagedecoder.h:164
22 = D75
Definition: imagedecoder.h:263
2 = Normal program
Definition: imagedecoder.h:152
0x58 = Auto, Did not fire, Red-eye reduction
Definition: imagedecoder.h:355
5 = Pattern
Definition: imagedecoder.h:125
255 = other
Definition: imagedecoder.h:131
Rotate 180° CCW.
Definition: imagedecoder.h:63
Definition: imagedecoder.h:427
2 = Auto bracket
Definition: imagedecoder.h:198
0x9 = On, Fired
Definition: imagedecoder.h:301
15 = White fluorescent (WW 3200 - 3700K)
Definition: imagedecoder.h:245
13 = Day white fluorescent (N 4600 - 5400K)
Definition: imagedecoder.h:239
10 = Cloudy weather
Definition: imagedecoder.h:230
12 = Daylight fluorescent (D 5700 - 7100K)
Definition: imagedecoder.h:236
0x10 = Off, Did not fire
Definition: imagedecoder.h:310
ADDON_IMG_ORIENTATION
Definition: imagedecoder.h:54
255 = Other
Definition: imagedecoder.h:272
Definition: imagedecoder.h:369
4 = MultiSpot
Definition: imagedecoder.h:122
If not available.
Definition: imagedecoder.h:57
0x0 = No Flash
Definition: imagedecoder.h:286
21 = D65
Definition: imagedecoder.h:260
3 = Spot
Definition: imagedecoder.h:119
0x1f = Auto, Fired, Return detected
Definition: imagedecoder.h:325
ADDON_IMG_METERING_MODE
Definition: imagedecoder.h:107
RGB 8:8:8, with alpha, 24bpp, RGBRGB...
Definition: imagedecoder.h:42
Colored image.
Definition: imagedecoder.h:93
ADDON_IMG_LIGHT_SOURCE
Definition: imagedecoder.h:209
A 32-bit ARGB pixel format, with alpha, that uses 8 bits per channel, ARGBARGB... ...
Definition: imagedecoder.h:33
0xf = On, Return detected
Definition: imagedecoder.h:307
4 = Flash
Definition: imagedecoder.h:224
17 = Standard light A
Definition: imagedecoder.h:248
Transpose.
Definition: imagedecoder.h:69
0x4f = On, Red-eye reduction, Return detected
Definition: imagedecoder.h:349
7 = Portrait mode (for closeup photos with the background out of focus)
Definition: imagedecoder.h:167
RGBA 8:8:8:8, with alpha, 32bpp, RGBARGBA...
Definition: imagedecoder.h:39
0x1d = Auto, Fired, Return not detected
Definition: imagedecoder.h:322
0x4d = On, Red-eye reduction, Return not detected
Definition: imagedecoder.h:346
23 = D50
Definition: imagedecoder.h:266
0x19 = Auto, Fired
Definition: imagedecoder.h:319
6 = Partial
Definition: imagedecoder.h:128
1 = Daylight
Definition: imagedecoder.h:215
0x5 = Fired, Return not detected
Definition: imagedecoder.h:292
4 = Shutter speed priority
Definition: imagedecoder.h:158
Definition: imagedecoder.h:440
Flip horizontal.
Definition: imagedecoder.h:60
Transpose off axis.
Definition: imagedecoder.h:75
0x47 = Fired, Red-eye reduction, Return detected
Definition: imagedecoder.h:340
A 8, alpha only, 8bpp, AAA...
Definition: imagedecoder.h:36
18 = Standard light B
Definition: imagedecoder.h:251
0x1 = Fired
Definition: imagedecoder.h:289
ADDON_IMG_FLASH_TYPE
Definition: imagedecoder.h:283
2 = Fluorescent
Definition: imagedecoder.h:218
ADDON_IMG_EXPOSURE_MODE
Definition: imagedecoder.h:189
0 = Auto exposure
Definition: imagedecoder.h:192
24 = ISO Studio Tungsten
Definition: imagedecoder.h:269
19 = Standard light C
Definition: imagedecoder.h:254
0 = Not Defined
Definition: imagedecoder.h:146
1 = Average
Definition: imagedecoder.h:113
0x50 = Off, Red-eye reduction
Definition: imagedecoder.h:352
9 = Fine weather
Definition: imagedecoder.h:227
Flip vertical.
Definition: imagedecoder.h:66
0x7 = Fired, Return detected
Definition: imagedecoder.h:295
1 = Manual exposure
Definition: imagedecoder.h:195