Project Name  Version 1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
jh_datatypes.h
Go to the documentation of this file.
1 /******************************************************************************
2  * This program is protected under international and U.S. copyright laws as *
3  * an unpublished work. This program is confidential and proprietary to the *
4  * copyright owners. Reproduction or disclosure, in whole or in part, or the *
5  * production of derivative works therefrom without the express permission of *
6  * the copyright owners is prohibited. *
7  * *
8  * Copyright (C) 2011-2012 by Dolby Laboratories. *
9  * All rights reserved. *
10  ******************************************************************************/
11 
23 #ifndef _JH_DATATYPES_H
24 #define _JH_DATATYPES_H
25 #include <stddef.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
33 typedef enum jh_pixel_type_ts {
34  JH_RGB8 = 1,
35  JH_RGBA8 = 2,
36  JH_RGB16 = 3,
37  JH_RGBF = 4,
41 
44 typedef struct jh_rect_ts {
45  int x;
46  int y;
47  int width;
48  int height;
49 } jh_rect_t;
50 
53 typedef enum jh_result_ts {
54  JH_OK = 0,
55  JH_MEMORY = 1,
65  JH_ERROR = 11,
67 } jh_result_t;
68 
71 #define MSG_SIZE 200
72 
78 typedef struct jh_error_ts {
82 } jh_error_t;
83 
86 typedef struct jh_image_ts {
87  int columns;
88  int rows;
89  int stride;
91  void *data;
92  int lut_size;
94  float *decoding_lut;
95  void *loglum;
96 } jh_image_t;
97 
114 typedef struct jh_monitor_ts {
115  volatile int cancel;
116  volatile float progress;
117 } jh_monitor_t;
118  /* end of defgroup share */
120 
121 #define JH_SEEK_SET 0 /* beginning of the stream */
122 #define JH_SEEK_CUR 1 /* current position */
123 #define JH_SEEK_END 2 /* end of the stream */
124 
125 struct jh_stream_ts;
126 typedef struct {
127  int (*on_init)(struct jh_stream_ts *stream, unsigned char **buf, size_t *buf_size);
128  int (*on_empty)(struct jh_stream_ts *stream, unsigned char **buf, size_t *buf_size);
129  int (*on_term)(struct jh_stream_ts *stream, size_t free_in_buffer);
130 } jh_dst_mgr_t;
131 
132 typedef struct jh_stream_ts{
133 
140  int (*read)(struct jh_stream_ts *stream,
141  unsigned char *buffer,
142  size_t bytes
143  );
150  int (*write)(struct jh_stream_ts *stream,
151  unsigned char *buffer,
152  size_t bytes
153  );
154 
160  int (*seek)(struct jh_stream_ts *stream,
161  long long position,
162  unsigned origin
163  );
164  jh_dst_mgr_t *pri;
165 
166 } jh_stream_t;
167 
168 
169 
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif /*_JH_DATATYPES_H*/
176 
177