1 | /* ************************************************************************** */
|
---|
2 | /* * For conditions of distribution and use, * */
|
---|
3 | /* * see copyright notice in libmng.h * */
|
---|
4 | /* ************************************************************************** */
|
---|
5 | /* * * */
|
---|
6 | /* * project : libmng * */
|
---|
7 | /* * file : libmng_prop_xs.c copyright (c) 2000 G.Juyn * */
|
---|
8 | /* * version : 1.0.4 * */
|
---|
9 | /* * * */
|
---|
10 | /* * purpose : property get/set interface (implementation) * */
|
---|
11 | /* * * */
|
---|
12 | /* * author : G.Juyn * */
|
---|
13 | /* * web : http://www.3-t.com * */
|
---|
14 | /* * email : mailto:info@3-t.com * */
|
---|
15 | /* * * */
|
---|
16 | /* * comment : implementation of the property get/set functions * */
|
---|
17 | /* * * */
|
---|
18 | /* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
---|
19 | /* * - fixed calling convention * */
|
---|
20 | /* * - changed strict-ANSI stuff * */
|
---|
21 | /* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
---|
22 | /* * - added set_outputprofile2 & set_srgbprofile2 * */
|
---|
23 | /* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
---|
24 | /* * - changed trace to macro for callback error-reporting * */
|
---|
25 | /* * * */
|
---|
26 | /* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
---|
27 | /* * - changed inclusion of cms-routines * */
|
---|
28 | /* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
---|
29 | /* * - added support for get/set default zlib/IJG parms * */
|
---|
30 | /* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
---|
31 | /* * - fixed up punctuation (contribution by Tim Rowley) * */
|
---|
32 | /* * 0.5.2 - 06/05/2000 - G.Juyn * */
|
---|
33 | /* * - added support for RGB8_A8 canvasstyle * */
|
---|
34 | /* * * */
|
---|
35 | /* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
---|
36 | /* * - added get/set for speedtype to facilitate testing * */
|
---|
37 | /* * - added get for imagelevel during processtext callback * */
|
---|
38 | /* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
---|
39 | /* * - changed userdata variable to mng_ptr * */
|
---|
40 | /* * 0.5.3 - 06/29/2000 - G.Juyn * */
|
---|
41 | /* * - fixed incompatible return-types * */
|
---|
42 | /* * * */
|
---|
43 | /* * 0.9.1 - 07/08/2000 - G.Juyn * */
|
---|
44 | /* * - added get routines for internal display variables * */
|
---|
45 | /* * - added get/set routines for suspensionmode variable * */
|
---|
46 | /* * 0.9.1 - 07/15/2000 - G.Juyn * */
|
---|
47 | /* * - added get/set routines for sectionbreak variable * */
|
---|
48 | /* * * */
|
---|
49 | /* * 0.9.2 - 07/31/2000 - G.Juyn * */
|
---|
50 | /* * - added status_xxxx functions * */
|
---|
51 | /* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
---|
52 | /* * - changed file-prefixes * */
|
---|
53 | /* * * */
|
---|
54 | /* * 0.9.3 - 10/10/2000 - G.Juyn * */
|
---|
55 | /* * - added support for alpha-depth prediction * */
|
---|
56 | /* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
---|
57 | /* * - added functions to retrieve PNG/JNG specific header-info * */
|
---|
58 | /* * 0.9.3 - 10/20/2000 - G.Juyn * */
|
---|
59 | /* * - added get/set for bKGD preference setting * */
|
---|
60 | /* * 0.9.3 - 10/21/2000 - G.Juyn * */
|
---|
61 | /* * - added get function for interlace/progressive display * */
|
---|
62 | /* * * */
|
---|
63 | /* * 1.0.1 - 04/21/2001 - G.Juyn (code by G.Kelly) * */
|
---|
64 | /* * - added BGRA8 canvas with premultiplied alpha * */
|
---|
65 | /* * 1.0.1 - 05/02/2001 - G.Juyn * */
|
---|
66 | /* * - added "default" sRGB generation (Thanks Marti!) * */
|
---|
67 | /* * * */
|
---|
68 | /* * 1.0.2 - 06/23/2001 - G.Juyn * */
|
---|
69 | /* * - added optimization option for MNG-video playback * */
|
---|
70 | /* * 1.0.2 - 06/25/2001 - G.Juyn * */
|
---|
71 | /* * - added option to turn off progressive refresh * */
|
---|
72 | /* * * */
|
---|
73 | /* * 1.0.3 - 08/06/2001 - G.Juyn * */
|
---|
74 | /* * - added get function for last processed BACK chunk * */
|
---|
75 | /* * * */
|
---|
76 | /* * 1.0.4 - 06/22/2002 - G.Juyn * */
|
---|
77 | /* * - B495442 - invalid returnvalue in mng_get_suspensionmode * */
|
---|
78 | /* * * */
|
---|
79 | /* ************************************************************************** */
|
---|
80 |
|
---|
81 | #include "libmng.h"
|
---|
82 | #include "libmng_data.h"
|
---|
83 | #include "libmng_error.h"
|
---|
84 | #include "libmng_trace.h"
|
---|
85 | #ifdef __BORLANDC__
|
---|
86 | #pragma hdrstop
|
---|
87 | #endif
|
---|
88 | #include "libmng_cms.h"
|
---|
89 |
|
---|
90 | #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
---|
91 | #pragma option -A /* force ANSI-C */
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | /* ************************************************************************** */
|
---|
95 | /* * * */
|
---|
96 | /* * Property set functions * */
|
---|
97 | /* * * */
|
---|
98 | /* ************************************************************************** */
|
---|
99 |
|
---|
100 | mng_retcode MNG_DECL mng_set_userdata (mng_handle hHandle,
|
---|
101 | mng_ptr pUserdata)
|
---|
102 | {
|
---|
103 | #ifdef MNG_SUPPORT_TRACE
|
---|
104 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USERDATA, MNG_LC_START)
|
---|
105 | #endif
|
---|
106 |
|
---|
107 | MNG_VALIDHANDLE (hHandle)
|
---|
108 | ((mng_datap)hHandle)->pUserdata = pUserdata;
|
---|
109 |
|
---|
110 | #ifdef MNG_SUPPORT_TRACE
|
---|
111 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USERDATA, MNG_LC_END)
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | return MNG_NOERROR;
|
---|
115 | }
|
---|
116 |
|
---|
117 | /* ************************************************************************** */
|
---|
118 |
|
---|
119 | mng_retcode MNG_DECL mng_set_canvasstyle (mng_handle hHandle,
|
---|
120 | mng_uint32 iStyle)
|
---|
121 | {
|
---|
122 | #ifdef MNG_SUPPORT_TRACE
|
---|
123 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CANVASSTYLE, MNG_LC_START)
|
---|
124 | #endif
|
---|
125 |
|
---|
126 | MNG_VALIDHANDLE (hHandle)
|
---|
127 |
|
---|
128 | switch (iStyle)
|
---|
129 | {
|
---|
130 | case MNG_CANVAS_RGB8 : break;
|
---|
131 | case MNG_CANVAS_RGBA8 : break;
|
---|
132 | case MNG_CANVAS_ARGB8 : break;
|
---|
133 | case MNG_CANVAS_RGB8_A8 : break;
|
---|
134 | case MNG_CANVAS_BGR8 : break;
|
---|
135 | case MNG_CANVAS_BGRA8 : break;
|
---|
136 | case MNG_CANVAS_BGRA8PM : break;
|
---|
137 | case MNG_CANVAS_ABGR8 : break;
|
---|
138 | /* case MNG_CANVAS_RGB16 : break; */
|
---|
139 | /* case MNG_CANVAS_RGBA16 : break; */
|
---|
140 | /* case MNG_CANVAS_ARGB16 : break; */
|
---|
141 | /* case MNG_CANVAS_BGR16 : break; */
|
---|
142 | /* case MNG_CANVAS_BGRA16 : break; */
|
---|
143 | /* case MNG_CANVAS_ABGR16 : break; */
|
---|
144 | /* case MNG_CANVAS_INDEX8 : break; */
|
---|
145 | /* case MNG_CANVAS_INDEXA8 : break; */
|
---|
146 | /* case MNG_CANVAS_AINDEX8 : break; */
|
---|
147 | /* case MNG_CANVAS_GRAY8 : break; */
|
---|
148 | /* case MNG_CANVAS_GRAY16 : break; */
|
---|
149 | /* case MNG_CANVAS_GRAYA8 : break; */
|
---|
150 | /* case MNG_CANVAS_GRAYA16 : break; */
|
---|
151 | /* case MNG_CANVAS_AGRAY8 : break; */
|
---|
152 | /* case MNG_CANVAS_AGRAY16 : break; */
|
---|
153 | /* case MNG_CANVAS_DX15 : break; */
|
---|
154 | /* case MNG_CANVAS_DX16 : break; */
|
---|
155 | default : { MNG_ERROR (((mng_datap)hHandle), MNG_INVALIDCNVSTYLE) }
|
---|
156 | }
|
---|
157 |
|
---|
158 | ((mng_datap)hHandle)->iCanvasstyle = iStyle;
|
---|
159 |
|
---|
160 | #ifdef MNG_SUPPORT_TRACE
|
---|
161 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CANVASSTYLE, MNG_LC_END)
|
---|
162 | #endif
|
---|
163 |
|
---|
164 | return MNG_NOERROR;
|
---|
165 | }
|
---|
166 |
|
---|
167 | /* ************************************************************************** */
|
---|
168 |
|
---|
169 | mng_retcode MNG_DECL mng_set_bkgdstyle (mng_handle hHandle,
|
---|
170 | mng_uint32 iStyle)
|
---|
171 | {
|
---|
172 | #ifdef MNG_SUPPORT_TRACE
|
---|
173 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_BKGDSTYLE, MNG_LC_START)
|
---|
174 | #endif
|
---|
175 |
|
---|
176 | MNG_VALIDHANDLE (hHandle)
|
---|
177 |
|
---|
178 | switch (iStyle) /* alpha-modes not supported */
|
---|
179 | {
|
---|
180 | case MNG_CANVAS_RGB8 : break;
|
---|
181 | case MNG_CANVAS_BGR8 : break;
|
---|
182 | /* case MNG_CANVAS_RGB16 : break; */
|
---|
183 | /* case MNG_CANVAS_BGR16 : break; */
|
---|
184 | /* case MNG_CANVAS_INDEX8 : break; */
|
---|
185 | /* case MNG_CANVAS_GRAY8 : break; */
|
---|
186 | /* case MNG_CANVAS_GRAY16 : break; */
|
---|
187 | /* case MNG_CANVAS_DX15 : break; */
|
---|
188 | /* case MNG_CANVAS_DX16 : break; */
|
---|
189 | default : MNG_ERROR (((mng_datap)hHandle), MNG_INVALIDCNVSTYLE)
|
---|
190 | }
|
---|
191 |
|
---|
192 | ((mng_datap)hHandle)->iBkgdstyle = iStyle;
|
---|
193 |
|
---|
194 | #ifdef MNG_SUPPORT_TRACE
|
---|
195 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_BKGDSTYLE, MNG_LC_END)
|
---|
196 | #endif
|
---|
197 |
|
---|
198 | return MNG_NOERROR;
|
---|
199 | }
|
---|
200 |
|
---|
201 | /* ************************************************************************** */
|
---|
202 |
|
---|
203 | mng_retcode MNG_DECL mng_set_bgcolor (mng_handle hHandle,
|
---|
204 | mng_uint16 iRed,
|
---|
205 | mng_uint16 iGreen,
|
---|
206 | mng_uint16 iBlue)
|
---|
207 | {
|
---|
208 | #ifdef MNG_SUPPORT_TRACE
|
---|
209 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_BGCOLOR, MNG_LC_START)
|
---|
210 | #endif
|
---|
211 |
|
---|
212 | MNG_VALIDHANDLE (hHandle)
|
---|
213 | ((mng_datap)hHandle)->iBGred = iRed;
|
---|
214 | ((mng_datap)hHandle)->iBGgreen = iGreen;
|
---|
215 | ((mng_datap)hHandle)->iBGblue = iBlue;
|
---|
216 | ((mng_datap)hHandle)->bUseBKGD = MNG_FALSE;
|
---|
217 |
|
---|
218 | #ifdef MNG_SUPPORT_TRACE
|
---|
219 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_BGCOLOR, MNG_LC_END)
|
---|
220 | #endif
|
---|
221 |
|
---|
222 | return MNG_NOERROR;
|
---|
223 | }
|
---|
224 |
|
---|
225 | /* ************************************************************************** */
|
---|
226 |
|
---|
227 | mng_retcode MNG_DECL mng_set_usebkgd (mng_handle hHandle,
|
---|
228 | mng_bool bUseBKGD)
|
---|
229 | {
|
---|
230 | #ifdef MNG_SUPPORT_TRACE
|
---|
231 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USEBKGD, MNG_LC_START)
|
---|
232 | #endif
|
---|
233 |
|
---|
234 | MNG_VALIDHANDLE (hHandle)
|
---|
235 | ((mng_datap)hHandle)->bUseBKGD = bUseBKGD;
|
---|
236 |
|
---|
237 | #ifdef MNG_SUPPORT_TRACE
|
---|
238 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USEBKGD, MNG_LC_END)
|
---|
239 | #endif
|
---|
240 |
|
---|
241 | return MNG_NOERROR;
|
---|
242 | }
|
---|
243 |
|
---|
244 | /* ************************************************************************** */
|
---|
245 |
|
---|
246 | mng_retcode MNG_DECL mng_set_storechunks (mng_handle hHandle,
|
---|
247 | mng_bool bStorechunks)
|
---|
248 | {
|
---|
249 | #ifdef MNG_SUPPORT_TRACE
|
---|
250 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_STORECHUNKS, MNG_LC_START)
|
---|
251 | #endif
|
---|
252 |
|
---|
253 | MNG_VALIDHANDLE (hHandle)
|
---|
254 | ((mng_datap)hHandle)->bStorechunks = bStorechunks;
|
---|
255 |
|
---|
256 | #ifdef MNG_SUPPORT_TRACE
|
---|
257 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_STORECHUNKS, MNG_LC_END)
|
---|
258 | #endif
|
---|
259 |
|
---|
260 | return MNG_NOERROR;
|
---|
261 | }
|
---|
262 |
|
---|
263 | /* ************************************************************************** */
|
---|
264 |
|
---|
265 | mng_retcode MNG_DECL mng_set_sectionbreaks (mng_handle hHandle,
|
---|
266 | mng_bool bSectionbreaks)
|
---|
267 | {
|
---|
268 | #ifdef MNG_SUPPORT_TRACE
|
---|
269 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SECTIONBREAKS, MNG_LC_START)
|
---|
270 | #endif
|
---|
271 |
|
---|
272 | MNG_VALIDHANDLE (hHandle)
|
---|
273 | ((mng_datap)hHandle)->bSectionbreaks = bSectionbreaks;
|
---|
274 |
|
---|
275 | #ifdef MNG_SUPPORT_TRACE
|
---|
276 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SECTIONBREAKS, MNG_LC_END)
|
---|
277 | #endif
|
---|
278 |
|
---|
279 | return MNG_NOERROR;
|
---|
280 | }
|
---|
281 |
|
---|
282 | /* ************************************************************************** */
|
---|
283 |
|
---|
284 | mng_retcode MNG_DECL mng_set_cacheplayback (mng_handle hHandle,
|
---|
285 | mng_bool bCacheplayback)
|
---|
286 | {
|
---|
287 | #ifdef MNG_SUPPORT_TRACE
|
---|
288 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CACHEPLAYBACK, MNG_LC_START)
|
---|
289 | #endif
|
---|
290 |
|
---|
291 | MNG_VALIDHANDLE (hHandle)
|
---|
292 |
|
---|
293 | if (((mng_datap)hHandle)->bHasheader)
|
---|
294 | MNG_ERROR (((mng_datap)hHandle), MNG_FUNCTIONINVALID)
|
---|
295 |
|
---|
296 | ((mng_datap)hHandle)->bCacheplayback = bCacheplayback;
|
---|
297 |
|
---|
298 | #ifdef MNG_SUPPORT_TRACE
|
---|
299 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CACHEPLAYBACK, MNG_LC_END)
|
---|
300 | #endif
|
---|
301 |
|
---|
302 | return MNG_NOERROR;
|
---|
303 | }
|
---|
304 |
|
---|
305 | /* ************************************************************************** */
|
---|
306 |
|
---|
307 | mng_retcode MNG_DECL mng_set_doprogressive (mng_handle hHandle,
|
---|
308 | mng_bool bDoProgressive)
|
---|
309 | {
|
---|
310 | #ifdef MNG_SUPPORT_TRACE
|
---|
311 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DOPROGRESSIVE, MNG_LC_START)
|
---|
312 | #endif
|
---|
313 |
|
---|
314 | MNG_VALIDHANDLE (hHandle)
|
---|
315 |
|
---|
316 | ((mng_datap)hHandle)->bDoProgressive = bDoProgressive;
|
---|
317 |
|
---|
318 | #ifdef MNG_SUPPORT_TRACE
|
---|
319 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DOPROGRESSIVE, MNG_LC_END)
|
---|
320 | #endif
|
---|
321 |
|
---|
322 | return MNG_NOERROR;
|
---|
323 | }
|
---|
324 |
|
---|
325 | /* ************************************************************************** */
|
---|
326 |
|
---|
327 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
328 | mng_retcode MNG_DECL mng_set_srgb (mng_handle hHandle,
|
---|
329 | mng_bool bIssRGB)
|
---|
330 | {
|
---|
331 | #ifdef MNG_SUPPORT_TRACE
|
---|
332 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGB, MNG_LC_START)
|
---|
333 | #endif
|
---|
334 |
|
---|
335 | MNG_VALIDHANDLE (hHandle)
|
---|
336 | ((mng_datap)hHandle)->bIssRGB = bIssRGB;
|
---|
337 |
|
---|
338 | #ifdef MNG_SUPPORT_TRACE
|
---|
339 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGB, MNG_LC_END)
|
---|
340 | #endif
|
---|
341 |
|
---|
342 | return MNG_NOERROR;
|
---|
343 | }
|
---|
344 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
345 |
|
---|
346 | /* ************************************************************************** */
|
---|
347 |
|
---|
348 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
349 | mng_retcode MNG_DECL mng_set_outputprofile (mng_handle hHandle,
|
---|
350 | mng_pchar zFilename)
|
---|
351 | {
|
---|
352 | #ifdef MNG_INCLUDE_LCMS
|
---|
353 | mng_datap pData;
|
---|
354 | #endif
|
---|
355 |
|
---|
356 | #ifdef MNG_SUPPORT_TRACE
|
---|
357 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE, MNG_LC_START)
|
---|
358 | #endif
|
---|
359 |
|
---|
360 | #ifdef MNG_INCLUDE_LCMS
|
---|
361 | MNG_VALIDHANDLE (hHandle)
|
---|
362 |
|
---|
363 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
364 |
|
---|
365 | if (pData->hProf2) /* previously defined ? */
|
---|
366 | mnglcms_freeprofile (pData->hProf2);
|
---|
367 | /* allocate new CMS profile handle */
|
---|
368 | pData->hProf2 = mnglcms_createfileprofile (zFilename);
|
---|
369 |
|
---|
370 | if (!pData->hProf2) /* handle error ? */
|
---|
371 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
372 | #endif /* MNG_INCLUDE_LCMS */
|
---|
373 |
|
---|
374 | #ifdef MNG_SUPPORT_TRACE
|
---|
375 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE, MNG_LC_END)
|
---|
376 | #endif
|
---|
377 |
|
---|
378 | return MNG_NOERROR;
|
---|
379 | }
|
---|
380 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
381 |
|
---|
382 | /* ************************************************************************** */
|
---|
383 |
|
---|
384 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
385 | mng_retcode MNG_DECL mng_set_outputprofile2 (mng_handle hHandle,
|
---|
386 | mng_uint32 iProfilesize,
|
---|
387 | mng_ptr pProfile)
|
---|
388 | {
|
---|
389 | #ifdef MNG_INCLUDE_LCMS
|
---|
390 | mng_datap pData;
|
---|
391 | #endif
|
---|
392 |
|
---|
393 | #ifdef MNG_SUPPORT_TRACE
|
---|
394 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE2, MNG_LC_START)
|
---|
395 | #endif
|
---|
396 |
|
---|
397 | #ifdef MNG_INCLUDE_LCMS
|
---|
398 | MNG_VALIDHANDLE (hHandle)
|
---|
399 |
|
---|
400 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
401 |
|
---|
402 | if (pData->hProf2) /* previously defined ? */
|
---|
403 | mnglcms_freeprofile (pData->hProf2);
|
---|
404 | /* allocate new CMS profile handle */
|
---|
405 | pData->hProf2 = mnglcms_creatememprofile (iProfilesize, pProfile);
|
---|
406 |
|
---|
407 | if (!pData->hProf2) /* handle error ? */
|
---|
408 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
409 | #endif /* MNG_INCLUDE_LCMS */
|
---|
410 |
|
---|
411 | #ifdef MNG_SUPPORT_TRACE
|
---|
412 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE2, MNG_LC_END)
|
---|
413 | #endif
|
---|
414 |
|
---|
415 | return MNG_NOERROR;
|
---|
416 | }
|
---|
417 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
418 |
|
---|
419 | /* ************************************************************************** */
|
---|
420 |
|
---|
421 | mng_retcode MNG_DECL mng_set_outputsrgb (mng_handle hHandle)
|
---|
422 | {
|
---|
423 | #ifdef MNG_INCLUDE_LCMS
|
---|
424 | mng_datap pData;
|
---|
425 | #endif
|
---|
426 |
|
---|
427 | #ifdef MNG_SUPPORT_TRACE
|
---|
428 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTSRGB, MNG_LC_START)
|
---|
429 | #endif
|
---|
430 |
|
---|
431 | #ifdef MNG_INCLUDE_LCMS
|
---|
432 | MNG_VALIDHANDLE (hHandle)
|
---|
433 |
|
---|
434 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
435 |
|
---|
436 | if (pData->hProf2) /* previously defined ? */
|
---|
437 | mnglcms_freeprofile (pData->hProf2);
|
---|
438 | /* allocate new CMS profile handle */
|
---|
439 | pData->hProf2 = mnglcms_createsrgbprofile ();
|
---|
440 |
|
---|
441 | if (!pData->hProf2) /* handle error ? */
|
---|
442 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
443 | #endif /* MNG_INCLUDE_LCMS */
|
---|
444 |
|
---|
445 | #ifdef MNG_SUPPORT_TRACE
|
---|
446 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTSRGB, MNG_LC_END)
|
---|
447 | #endif
|
---|
448 |
|
---|
449 | return MNG_NOERROR;
|
---|
450 | }
|
---|
451 |
|
---|
452 | /* ************************************************************************** */
|
---|
453 |
|
---|
454 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
455 | mng_retcode MNG_DECL mng_set_srgbprofile (mng_handle hHandle,
|
---|
456 | mng_pchar zFilename)
|
---|
457 | {
|
---|
458 | #ifdef MNG_INCLUDE_LCMS
|
---|
459 | mng_datap pData;
|
---|
460 | #endif
|
---|
461 |
|
---|
462 | #ifdef MNG_SUPPORT_TRACE
|
---|
463 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE2, MNG_LC_START)
|
---|
464 | #endif
|
---|
465 |
|
---|
466 | #ifdef MNG_INCLUDE_LCMS
|
---|
467 | MNG_VALIDHANDLE (hHandle)
|
---|
468 |
|
---|
469 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
470 |
|
---|
471 | if (pData->hProf3) /* previously defined ? */
|
---|
472 | mnglcms_freeprofile (pData->hProf3);
|
---|
473 | /* allocate new CMS profile handle */
|
---|
474 | pData->hProf3 = mnglcms_createfileprofile (zFilename);
|
---|
475 |
|
---|
476 | if (!pData->hProf3) /* handle error ? */
|
---|
477 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
478 | #endif /* MNG_INCLUDE_LCMS */
|
---|
479 |
|
---|
480 | #ifdef MNG_SUPPORT_TRACE
|
---|
481 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE2, MNG_LC_END)
|
---|
482 | #endif
|
---|
483 |
|
---|
484 | return MNG_NOERROR;
|
---|
485 | }
|
---|
486 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
487 |
|
---|
488 | /* ************************************************************************** */
|
---|
489 |
|
---|
490 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
491 | mng_retcode MNG_DECL mng_set_srgbprofile2 (mng_handle hHandle,
|
---|
492 | mng_uint32 iProfilesize,
|
---|
493 | mng_ptr pProfile)
|
---|
494 | {
|
---|
495 | #ifdef MNG_INCLUDE_LCMS
|
---|
496 | mng_datap pData;
|
---|
497 | #endif
|
---|
498 |
|
---|
499 | #ifdef MNG_SUPPORT_TRACE
|
---|
500 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE, MNG_LC_START)
|
---|
501 | #endif
|
---|
502 |
|
---|
503 | #ifdef MNG_INCLUDE_LCMS
|
---|
504 | MNG_VALIDHANDLE (hHandle)
|
---|
505 |
|
---|
506 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
507 |
|
---|
508 | if (pData->hProf3) /* previously defined ? */
|
---|
509 | mnglcms_freeprofile (pData->hProf3);
|
---|
510 | /* allocate new CMS profile handle */
|
---|
511 | pData->hProf3 = mnglcms_creatememprofile (iProfilesize, pProfile);
|
---|
512 |
|
---|
513 | if (!pData->hProf3) /* handle error ? */
|
---|
514 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
515 | #endif /* MNG_INCLUDE_LCMS */
|
---|
516 |
|
---|
517 | #ifdef MNG_SUPPORT_TRACE
|
---|
518 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE, MNG_LC_END)
|
---|
519 | #endif
|
---|
520 |
|
---|
521 | return MNG_NOERROR;
|
---|
522 | }
|
---|
523 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
524 |
|
---|
525 | /* ************************************************************************** */
|
---|
526 |
|
---|
527 | mng_retcode MNG_DECL mng_set_srgbimplicit (mng_handle hHandle)
|
---|
528 | {
|
---|
529 | #ifdef MNG_INCLUDE_LCMS
|
---|
530 | mng_datap pData;
|
---|
531 | #endif
|
---|
532 |
|
---|
533 | #ifdef MNG_SUPPORT_TRACE
|
---|
534 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBIMPLICIT, MNG_LC_START)
|
---|
535 | #endif
|
---|
536 |
|
---|
537 | #ifdef MNG_INCLUDE_LCMS
|
---|
538 | MNG_VALIDHANDLE (hHandle)
|
---|
539 |
|
---|
540 | pData = (mng_datap)hHandle; /* address the structure */
|
---|
541 |
|
---|
542 | if (pData->hProf3) /* previously defined ? */
|
---|
543 | mnglcms_freeprofile (pData->hProf3);
|
---|
544 | /* allocate new CMS profile handle */
|
---|
545 | pData->hProf3 = mnglcms_createsrgbprofile ();
|
---|
546 |
|
---|
547 | if (!pData->hProf3) /* handle error ? */
|
---|
548 | MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
|
---|
549 | #endif /* MNG_INCLUDE_LCMS */
|
---|
550 |
|
---|
551 | #ifdef MNG_SUPPORT_TRACE
|
---|
552 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBIMPLICIT, MNG_LC_END)
|
---|
553 | #endif
|
---|
554 |
|
---|
555 | return MNG_NOERROR;
|
---|
556 | }
|
---|
557 |
|
---|
558 | /* ************************************************************************** */
|
---|
559 |
|
---|
560 | mng_retcode MNG_DECL mng_set_viewgamma (mng_handle hHandle,
|
---|
561 | mng_float dGamma)
|
---|
562 | {
|
---|
563 | #ifdef MNG_SUPPORT_TRACE
|
---|
564 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_START)
|
---|
565 | #endif
|
---|
566 |
|
---|
567 | MNG_VALIDHANDLE (hHandle)
|
---|
568 | ((mng_datap)hHandle)->dViewgamma = dGamma;
|
---|
569 |
|
---|
570 | #ifdef MNG_SUPPORT_TRACE
|
---|
571 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_END)
|
---|
572 | #endif
|
---|
573 |
|
---|
574 | return MNG_NOERROR;
|
---|
575 | }
|
---|
576 |
|
---|
577 | /* ************************************************************************** */
|
---|
578 |
|
---|
579 | mng_retcode MNG_DECL mng_set_displaygamma (mng_handle hHandle,
|
---|
580 | mng_float dGamma)
|
---|
581 | {
|
---|
582 | #ifdef MNG_SUPPORT_TRACE
|
---|
583 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_START)
|
---|
584 | #endif
|
---|
585 |
|
---|
586 | MNG_VALIDHANDLE (hHandle)
|
---|
587 | ((mng_datap)hHandle)->dDisplaygamma = dGamma;
|
---|
588 |
|
---|
589 | #ifdef MNG_SUPPORT_TRACE
|
---|
590 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_END)
|
---|
591 | #endif
|
---|
592 |
|
---|
593 | return MNG_NOERROR;
|
---|
594 | }
|
---|
595 |
|
---|
596 | /* ************************************************************************** */
|
---|
597 |
|
---|
598 | mng_retcode MNG_DECL mng_set_dfltimggamma (mng_handle hHandle,
|
---|
599 | mng_float dGamma)
|
---|
600 | {
|
---|
601 | #ifdef MNG_SUPPORT_TRACE
|
---|
602 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_START)
|
---|
603 | #endif
|
---|
604 |
|
---|
605 | MNG_VALIDHANDLE (hHandle)
|
---|
606 | ((mng_datap)hHandle)->dDfltimggamma = dGamma;
|
---|
607 |
|
---|
608 | #ifdef MNG_SUPPORT_TRACE
|
---|
609 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_END)
|
---|
610 | #endif
|
---|
611 |
|
---|
612 | return MNG_NOERROR;
|
---|
613 | }
|
---|
614 |
|
---|
615 | /* ************************************************************************** */
|
---|
616 |
|
---|
617 | mng_retcode MNG_DECL mng_set_viewgammaint (mng_handle hHandle,
|
---|
618 | mng_uint32 iGamma)
|
---|
619 | {
|
---|
620 | #ifdef MNG_SUPPORT_TRACE
|
---|
621 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_START)
|
---|
622 | #endif
|
---|
623 |
|
---|
624 | MNG_VALIDHANDLE (hHandle)
|
---|
625 | ((mng_datap)hHandle)->dViewgamma = (mng_float)iGamma / 100000;
|
---|
626 |
|
---|
627 | #ifdef MNG_SUPPORT_TRACE
|
---|
628 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_END)
|
---|
629 | #endif
|
---|
630 |
|
---|
631 | return MNG_NOERROR;
|
---|
632 | }
|
---|
633 |
|
---|
634 | /* ************************************************************************** */
|
---|
635 |
|
---|
636 | mng_retcode MNG_DECL mng_set_displaygammaint (mng_handle hHandle,
|
---|
637 | mng_uint32 iGamma)
|
---|
638 | {
|
---|
639 | #ifdef MNG_SUPPORT_TRACE
|
---|
640 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_START)
|
---|
641 | #endif
|
---|
642 |
|
---|
643 | MNG_VALIDHANDLE (hHandle)
|
---|
644 | ((mng_datap)hHandle)->dDisplaygamma = (mng_float)iGamma / 100000;
|
---|
645 |
|
---|
646 | #ifdef MNG_SUPPORT_TRACE
|
---|
647 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_END)
|
---|
648 | #endif
|
---|
649 |
|
---|
650 | return MNG_NOERROR;
|
---|
651 | }
|
---|
652 |
|
---|
653 | /* ************************************************************************** */
|
---|
654 |
|
---|
655 | mng_retcode MNG_DECL mng_set_dfltimggammaint (mng_handle hHandle,
|
---|
656 | mng_uint32 iGamma)
|
---|
657 | {
|
---|
658 | #ifdef MNG_SUPPORT_TRACE
|
---|
659 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_START)
|
---|
660 | #endif
|
---|
661 |
|
---|
662 | MNG_VALIDHANDLE (hHandle)
|
---|
663 | ((mng_datap)hHandle)->dDfltimggamma = (mng_float)iGamma / 100000;
|
---|
664 |
|
---|
665 | #ifdef MNG_SUPPORT_TRACE
|
---|
666 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_END)
|
---|
667 | #endif
|
---|
668 |
|
---|
669 | return MNG_NOERROR;
|
---|
670 | }
|
---|
671 |
|
---|
672 | /* ************************************************************************** */
|
---|
673 |
|
---|
674 | mng_retcode MNG_DECL mng_set_maxcanvaswidth (mng_handle hHandle,
|
---|
675 | mng_uint32 iMaxwidth)
|
---|
676 | {
|
---|
677 | #ifdef MNG_SUPPORT_TRACE
|
---|
678 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASWIDTH, MNG_LC_START)
|
---|
679 | #endif
|
---|
680 |
|
---|
681 | MNG_VALIDHANDLE (hHandle)
|
---|
682 | ((mng_datap)hHandle)->iMaxwidth = iMaxwidth;
|
---|
683 |
|
---|
684 | #ifdef MNG_SUPPORT_TRACE
|
---|
685 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASWIDTH, MNG_LC_END)
|
---|
686 | #endif
|
---|
687 |
|
---|
688 | return MNG_NOERROR;
|
---|
689 | }
|
---|
690 |
|
---|
691 | /* ************************************************************************** */
|
---|
692 |
|
---|
693 | mng_retcode MNG_DECL mng_set_maxcanvasheight (mng_handle hHandle,
|
---|
694 | mng_uint32 iMaxheight)
|
---|
695 | {
|
---|
696 | #ifdef MNG_SUPPORT_TRACE
|
---|
697 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASHEIGHT, MNG_LC_START)
|
---|
698 | #endif
|
---|
699 |
|
---|
700 | MNG_VALIDHANDLE (hHandle)
|
---|
701 | ((mng_datap)hHandle)->iMaxheight = iMaxheight;
|
---|
702 |
|
---|
703 | #ifdef MNG_SUPPORT_TRACE
|
---|
704 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASHEIGHT, MNG_LC_END)
|
---|
705 | #endif
|
---|
706 |
|
---|
707 | return MNG_NOERROR;
|
---|
708 | }
|
---|
709 |
|
---|
710 | /* ************************************************************************** */
|
---|
711 |
|
---|
712 | mng_retcode MNG_DECL mng_set_maxcanvassize (mng_handle hHandle,
|
---|
713 | mng_uint32 iMaxwidth,
|
---|
714 | mng_uint32 iMaxheight)
|
---|
715 | {
|
---|
716 | #ifdef MNG_SUPPORT_TRACE
|
---|
717 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASSIZE, MNG_LC_START)
|
---|
718 | #endif
|
---|
719 |
|
---|
720 | MNG_VALIDHANDLE (hHandle)
|
---|
721 | ((mng_datap)hHandle)->iMaxwidth = iMaxwidth;
|
---|
722 | ((mng_datap)hHandle)->iMaxheight = iMaxheight;
|
---|
723 |
|
---|
724 | #ifdef MNG_SUPPORT_TRACE
|
---|
725 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASSIZE, MNG_LC_END)
|
---|
726 | #endif
|
---|
727 |
|
---|
728 | return MNG_NOERROR;
|
---|
729 | }
|
---|
730 |
|
---|
731 | /* ************************************************************************** */
|
---|
732 |
|
---|
733 | #ifdef MNG_INCLUDE_ZLIB
|
---|
734 | mng_retcode MNG_DECL mng_set_zlib_level (mng_handle hHandle,
|
---|
735 | mng_int32 iZlevel)
|
---|
736 | {
|
---|
737 | #ifdef MNG_SUPPORT_TRACE
|
---|
738 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_LEVEL, MNG_LC_START)
|
---|
739 | #endif
|
---|
740 |
|
---|
741 | MNG_VALIDHANDLE (hHandle)
|
---|
742 | ((mng_datap)hHandle)->iZlevel = iZlevel;
|
---|
743 |
|
---|
744 | #ifdef MNG_SUPPORT_TRACE
|
---|
745 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_LEVEL, MNG_LC_END)
|
---|
746 | #endif
|
---|
747 |
|
---|
748 | return MNG_NOERROR;
|
---|
749 | }
|
---|
750 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
751 |
|
---|
752 | /* ************************************************************************** */
|
---|
753 |
|
---|
754 | #ifdef MNG_INCLUDE_ZLIB
|
---|
755 | mng_retcode MNG_DECL mng_set_zlib_method (mng_handle hHandle,
|
---|
756 | mng_int32 iZmethod)
|
---|
757 | {
|
---|
758 | #ifdef MNG_SUPPORT_TRACE
|
---|
759 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_METHOD, MNG_LC_START)
|
---|
760 | #endif
|
---|
761 |
|
---|
762 | MNG_VALIDHANDLE (hHandle)
|
---|
763 | ((mng_datap)hHandle)->iZmethod = iZmethod;
|
---|
764 |
|
---|
765 | #ifdef MNG_SUPPORT_TRACE
|
---|
766 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_METHOD, MNG_LC_END)
|
---|
767 | #endif
|
---|
768 |
|
---|
769 | return MNG_NOERROR;
|
---|
770 | }
|
---|
771 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
772 |
|
---|
773 | /* ************************************************************************** */
|
---|
774 |
|
---|
775 | #ifdef MNG_INCLUDE_ZLIB
|
---|
776 | mng_retcode MNG_DECL mng_set_zlib_windowbits (mng_handle hHandle,
|
---|
777 | mng_int32 iZwindowbits)
|
---|
778 | {
|
---|
779 | #ifdef MNG_SUPPORT_TRACE
|
---|
780 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_WINDOWBITS, MNG_LC_START)
|
---|
781 | #endif
|
---|
782 |
|
---|
783 | MNG_VALIDHANDLE (hHandle)
|
---|
784 | ((mng_datap)hHandle)->iZwindowbits = iZwindowbits;
|
---|
785 |
|
---|
786 | #ifdef MNG_SUPPORT_TRACE
|
---|
787 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_WINDOWBITS, MNG_LC_END)
|
---|
788 | #endif
|
---|
789 |
|
---|
790 | return MNG_NOERROR;
|
---|
791 | }
|
---|
792 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
793 |
|
---|
794 | /* ************************************************************************** */
|
---|
795 |
|
---|
796 | #ifdef MNG_INCLUDE_ZLIB
|
---|
797 | mng_retcode MNG_DECL mng_set_zlib_memlevel (mng_handle hHandle,
|
---|
798 | mng_int32 iZmemlevel)
|
---|
799 | {
|
---|
800 | #ifdef MNG_SUPPORT_TRACE
|
---|
801 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_MEMLEVEL, MNG_LC_START)
|
---|
802 | #endif
|
---|
803 |
|
---|
804 | MNG_VALIDHANDLE (hHandle)
|
---|
805 | ((mng_datap)hHandle)->iZmemlevel = iZmemlevel;
|
---|
806 |
|
---|
807 | #ifdef MNG_SUPPORT_TRACE
|
---|
808 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_MEMLEVEL, MNG_LC_END)
|
---|
809 | #endif
|
---|
810 |
|
---|
811 | return MNG_NOERROR;
|
---|
812 | }
|
---|
813 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
814 |
|
---|
815 | /* ************************************************************************** */
|
---|
816 |
|
---|
817 | #ifdef MNG_INCLUDE_ZLIB
|
---|
818 | mng_retcode MNG_DECL mng_set_zlib_strategy (mng_handle hHandle,
|
---|
819 | mng_int32 iZstrategy)
|
---|
820 | {
|
---|
821 | #ifdef MNG_SUPPORT_TRACE
|
---|
822 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_STRATEGY, MNG_LC_START)
|
---|
823 | #endif
|
---|
824 |
|
---|
825 | MNG_VALIDHANDLE (hHandle)
|
---|
826 | ((mng_datap)hHandle)->iZstrategy = iZstrategy;
|
---|
827 |
|
---|
828 | #ifdef MNG_SUPPORT_TRACE
|
---|
829 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_STRATEGY, MNG_LC_END)
|
---|
830 | #endif
|
---|
831 |
|
---|
832 | return MNG_NOERROR;
|
---|
833 | }
|
---|
834 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
835 |
|
---|
836 | /* ************************************************************************** */
|
---|
837 |
|
---|
838 | #ifdef MNG_INCLUDE_ZLIB
|
---|
839 | mng_retcode MNG_DECL mng_set_zlib_maxidat (mng_handle hHandle,
|
---|
840 | mng_uint32 iMaxIDAT)
|
---|
841 | {
|
---|
842 | #ifdef MNG_SUPPORT_TRACE
|
---|
843 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_MAXIDAT, MNG_LC_START)
|
---|
844 | #endif
|
---|
845 |
|
---|
846 | MNG_VALIDHANDLE (hHandle)
|
---|
847 | ((mng_datap)hHandle)->iMaxIDAT = iMaxIDAT;
|
---|
848 |
|
---|
849 | #ifdef MNG_SUPPORT_TRACE
|
---|
850 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_MAXIDAT, MNG_LC_END)
|
---|
851 | #endif
|
---|
852 |
|
---|
853 | return MNG_NOERROR;
|
---|
854 | }
|
---|
855 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
856 |
|
---|
857 | /* ************************************************************************** */
|
---|
858 |
|
---|
859 | #ifdef MNG_INCLUDE_JNG
|
---|
860 | mng_retcode MNG_DECL mng_set_jpeg_dctmethod (mng_handle hHandle,
|
---|
861 | mngjpeg_dctmethod eJPEGdctmethod)
|
---|
862 | {
|
---|
863 | #ifdef MNG_SUPPORT_TRACE
|
---|
864 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_DCTMETHOD, MNG_LC_START)
|
---|
865 | #endif
|
---|
866 |
|
---|
867 | MNG_VALIDHANDLE (hHandle)
|
---|
868 | ((mng_datap)hHandle)->eJPEGdctmethod = eJPEGdctmethod;
|
---|
869 |
|
---|
870 | #ifdef MNG_SUPPORT_TRACE
|
---|
871 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_DCTMETHOD, MNG_LC_END)
|
---|
872 | #endif
|
---|
873 |
|
---|
874 | return MNG_NOERROR;
|
---|
875 | }
|
---|
876 | #endif /* MNG_INCLUDE_JNG */
|
---|
877 |
|
---|
878 | /* ************************************************************************** */
|
---|
879 |
|
---|
880 | #ifdef MNG_INCLUDE_JNG
|
---|
881 | mng_retcode MNG_DECL mng_set_jpeg_quality (mng_handle hHandle,
|
---|
882 | mng_int32 iJPEGquality)
|
---|
883 | {
|
---|
884 | #ifdef MNG_SUPPORT_TRACE
|
---|
885 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_QUALITY, MNG_LC_START)
|
---|
886 | #endif
|
---|
887 |
|
---|
888 | MNG_VALIDHANDLE (hHandle)
|
---|
889 | ((mng_datap)hHandle)->iJPEGquality = iJPEGquality;
|
---|
890 |
|
---|
891 | #ifdef MNG_SUPPORT_TRACE
|
---|
892 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_QUALITY, MNG_LC_END)
|
---|
893 | #endif
|
---|
894 |
|
---|
895 | return MNG_NOERROR;
|
---|
896 | }
|
---|
897 | #endif /* MNG_INCLUDE_JNG */
|
---|
898 |
|
---|
899 | /* ************************************************************************** */
|
---|
900 |
|
---|
901 | #ifdef MNG_INCLUDE_JNG
|
---|
902 | mng_retcode MNG_DECL mng_set_jpeg_smoothing (mng_handle hHandle,
|
---|
903 | mng_int32 iJPEGsmoothing)
|
---|
904 | {
|
---|
905 | #ifdef MNG_SUPPORT_TRACE
|
---|
906 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_SMOOTHING, MNG_LC_START)
|
---|
907 | #endif
|
---|
908 |
|
---|
909 | MNG_VALIDHANDLE (hHandle)
|
---|
910 | ((mng_datap)hHandle)->iJPEGsmoothing = iJPEGsmoothing;
|
---|
911 |
|
---|
912 | #ifdef MNG_SUPPORT_TRACE
|
---|
913 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_SMOOTHING, MNG_LC_END)
|
---|
914 | #endif
|
---|
915 |
|
---|
916 | return MNG_NOERROR;
|
---|
917 | }
|
---|
918 | #endif /* MNG_INCLUDE_JNG */
|
---|
919 |
|
---|
920 | /* ************************************************************************** */
|
---|
921 |
|
---|
922 | #ifdef MNG_INCLUDE_JNG
|
---|
923 | mng_retcode MNG_DECL mng_set_jpeg_progressive (mng_handle hHandle,
|
---|
924 | mng_bool bJPEGprogressive)
|
---|
925 | {
|
---|
926 | #ifdef MNG_SUPPORT_TRACE
|
---|
927 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_PROGRESSIVE, MNG_LC_START)
|
---|
928 | #endif
|
---|
929 |
|
---|
930 | MNG_VALIDHANDLE (hHandle)
|
---|
931 | ((mng_datap)hHandle)->bJPEGcompressprogr = bJPEGprogressive;
|
---|
932 |
|
---|
933 | #ifdef MNG_SUPPORT_TRACE
|
---|
934 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_PROGRESSIVE, MNG_LC_END)
|
---|
935 | #endif
|
---|
936 |
|
---|
937 | return MNG_NOERROR;
|
---|
938 | }
|
---|
939 | #endif /* MNG_INCLUDE_JNG */
|
---|
940 |
|
---|
941 | /* ************************************************************************** */
|
---|
942 |
|
---|
943 | #ifdef MNG_INCLUDE_JNG
|
---|
944 | mng_retcode MNG_DECL mng_set_jpeg_optimized (mng_handle hHandle,
|
---|
945 | mng_bool bJPEGoptimized)
|
---|
946 | {
|
---|
947 | #ifdef MNG_SUPPORT_TRACE
|
---|
948 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_OPTIMIZED, MNG_LC_START)
|
---|
949 | #endif
|
---|
950 |
|
---|
951 | MNG_VALIDHANDLE (hHandle)
|
---|
952 | ((mng_datap)hHandle)->bJPEGcompressopt = bJPEGoptimized;
|
---|
953 |
|
---|
954 | #ifdef MNG_SUPPORT_TRACE
|
---|
955 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_OPTIMIZED, MNG_LC_END)
|
---|
956 | #endif
|
---|
957 |
|
---|
958 | return MNG_NOERROR;
|
---|
959 | }
|
---|
960 | #endif /* MNG_INCLUDE_JNG */
|
---|
961 |
|
---|
962 | /* ************************************************************************** */
|
---|
963 |
|
---|
964 | #ifdef MNG_INCLUDE_JNG
|
---|
965 | mng_retcode MNG_DECL mng_set_jpeg_maxjdat (mng_handle hHandle,
|
---|
966 | mng_uint32 iMaxJDAT)
|
---|
967 | {
|
---|
968 | #ifdef MNG_SUPPORT_TRACE
|
---|
969 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_MAXJDAT, MNG_LC_START)
|
---|
970 | #endif
|
---|
971 |
|
---|
972 | MNG_VALIDHANDLE (hHandle)
|
---|
973 | ((mng_datap)hHandle)->iMaxJDAT = iMaxJDAT;
|
---|
974 |
|
---|
975 | #ifdef MNG_SUPPORT_TRACE
|
---|
976 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_JPEG_MAXJDAT, MNG_LC_END)
|
---|
977 | #endif
|
---|
978 |
|
---|
979 | return MNG_NOERROR;
|
---|
980 | }
|
---|
981 | #endif /* MNG_INCLUDE_JNG */
|
---|
982 |
|
---|
983 | /* ************************************************************************** */
|
---|
984 |
|
---|
985 | #ifdef MNG_SUPPORT_READ
|
---|
986 | mng_retcode MNG_DECL mng_set_suspensionmode (mng_handle hHandle,
|
---|
987 | mng_bool bSuspensionmode)
|
---|
988 | {
|
---|
989 | #ifdef MNG_SUPPORT_TRACE
|
---|
990 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SUSPENSIONMODE, MNG_LC_START)
|
---|
991 | #endif
|
---|
992 |
|
---|
993 | MNG_VALIDHANDLE (hHandle)
|
---|
994 |
|
---|
995 | if (((mng_datap)hHandle)->bReading) /* we must NOT be reading !!! */
|
---|
996 | MNG_ERROR ((mng_datap)hHandle, MNG_FUNCTIONINVALID)
|
---|
997 |
|
---|
998 | ((mng_datap)hHandle)->bSuspensionmode = bSuspensionmode;
|
---|
999 |
|
---|
1000 | #ifdef MNG_SUPPORT_TRACE
|
---|
1001 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SUSPENSIONMODE, MNG_LC_END)
|
---|
1002 | #endif
|
---|
1003 |
|
---|
1004 | return MNG_NOERROR;
|
---|
1005 | }
|
---|
1006 | #endif /* MNG_SUPPORT_READ */
|
---|
1007 |
|
---|
1008 | /* ************************************************************************** */
|
---|
1009 |
|
---|
1010 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
1011 | mng_retcode MNG_DECL mng_set_speed (mng_handle hHandle,
|
---|
1012 | mng_speedtype iSpeed)
|
---|
1013 | {
|
---|
1014 | #ifdef MNG_SUPPORT_TRACE
|
---|
1015 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SPEED, MNG_LC_START)
|
---|
1016 | #endif
|
---|
1017 |
|
---|
1018 | MNG_VALIDHANDLE (hHandle)
|
---|
1019 | ((mng_datap)hHandle)->iSpeed = iSpeed;
|
---|
1020 |
|
---|
1021 | #ifdef MNG_SUPPORT_TRACE
|
---|
1022 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SPEED, MNG_LC_END)
|
---|
1023 | #endif
|
---|
1024 |
|
---|
1025 | return MNG_NOERROR;
|
---|
1026 | }
|
---|
1027 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
1028 |
|
---|
1029 | /* ************************************************************************** */
|
---|
1030 | /* * * */
|
---|
1031 | /* * Property get functions * */
|
---|
1032 | /* * * */
|
---|
1033 | /* ************************************************************************** */
|
---|
1034 |
|
---|
1035 | mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle)
|
---|
1036 | { /* no tracing in here to prevent recursive calls */
|
---|
1037 | MNG_VALIDHANDLEX (hHandle)
|
---|
1038 | return ((mng_datap)hHandle)->pUserdata;
|
---|
1039 | }
|
---|
1040 |
|
---|
1041 | /* ************************************************************************** */
|
---|
1042 |
|
---|
1043 | mng_imgtype MNG_DECL mng_get_sigtype (mng_handle hHandle)
|
---|
1044 | {
|
---|
1045 | #ifdef MNG_SUPPORT_TRACE
|
---|
1046 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SIGTYPE, MNG_LC_START)
|
---|
1047 | #endif
|
---|
1048 |
|
---|
1049 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
1050 | return mng_it_unknown;
|
---|
1051 |
|
---|
1052 | #ifdef MNG_SUPPORT_TRACE
|
---|
1053 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SIGTYPE, MNG_LC_END)
|
---|
1054 | #endif
|
---|
1055 |
|
---|
1056 | return ((mng_datap)hHandle)->eSigtype;
|
---|
1057 | }
|
---|
1058 |
|
---|
1059 | /* ************************************************************************** */
|
---|
1060 |
|
---|
1061 | mng_imgtype MNG_DECL mng_get_imagetype (mng_handle hHandle)
|
---|
1062 | {
|
---|
1063 | #ifdef MNG_SUPPORT_TRACE
|
---|
1064 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGETYPE, MNG_LC_START)
|
---|
1065 | #endif
|
---|
1066 |
|
---|
1067 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
1068 | return mng_it_unknown;
|
---|
1069 |
|
---|
1070 | #ifdef MNG_SUPPORT_TRACE
|
---|
1071 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGETYPE, MNG_LC_END)
|
---|
1072 | #endif
|
---|
1073 |
|
---|
1074 | return ((mng_datap)hHandle)->eImagetype;
|
---|
1075 | }
|
---|
1076 |
|
---|
1077 | /* ************************************************************************** */
|
---|
1078 |
|
---|
1079 | mng_uint32 MNG_DECL mng_get_imagewidth (mng_handle hHandle)
|
---|
1080 | {
|
---|
1081 | #ifdef MNG_SUPPORT_TRACE
|
---|
1082 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGEWIDTH, MNG_LC_START)
|
---|
1083 | #endif
|
---|
1084 |
|
---|
1085 | MNG_VALIDHANDLEX (hHandle)
|
---|
1086 |
|
---|
1087 | #ifdef MNG_SUPPORT_TRACE
|
---|
1088 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGEWIDTH, MNG_LC_END)
|
---|
1089 | #endif
|
---|
1090 |
|
---|
1091 | return ((mng_datap)hHandle)->iWidth;
|
---|
1092 | }
|
---|
1093 |
|
---|
1094 | /* ************************************************************************** */
|
---|
1095 |
|
---|
1096 | mng_uint32 MNG_DECL mng_get_imageheight (mng_handle hHandle)
|
---|
1097 | {
|
---|
1098 | #ifdef MNG_SUPPORT_TRACE
|
---|
1099 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGEWIDTH, MNG_LC_START)
|
---|
1100 | #endif
|
---|
1101 |
|
---|
1102 | MNG_VALIDHANDLEX (hHandle)
|
---|
1103 |
|
---|
1104 | #ifdef MNG_SUPPORT_TRACE
|
---|
1105 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGEHEIGHT, MNG_LC_END)
|
---|
1106 | #endif
|
---|
1107 |
|
---|
1108 | return ((mng_datap)hHandle)->iHeight;
|
---|
1109 | }
|
---|
1110 |
|
---|
1111 | /* ************************************************************************** */
|
---|
1112 |
|
---|
1113 | mng_uint32 MNG_DECL mng_get_ticks (mng_handle hHandle)
|
---|
1114 | {
|
---|
1115 | #ifdef MNG_SUPPORT_TRACE
|
---|
1116 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_TICKS, MNG_LC_START)
|
---|
1117 | #endif
|
---|
1118 |
|
---|
1119 | MNG_VALIDHANDLEX (hHandle)
|
---|
1120 |
|
---|
1121 | #ifdef MNG_SUPPORT_TRACE
|
---|
1122 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_TICKS, MNG_LC_END)
|
---|
1123 | #endif
|
---|
1124 |
|
---|
1125 | return ((mng_datap)hHandle)->iTicks;
|
---|
1126 | }
|
---|
1127 |
|
---|
1128 | /* ************************************************************************** */
|
---|
1129 |
|
---|
1130 | mng_uint32 MNG_DECL mng_get_framecount (mng_handle hHandle)
|
---|
1131 | {
|
---|
1132 | #ifdef MNG_SUPPORT_TRACE
|
---|
1133 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_FRAMECOUNT, MNG_LC_START)
|
---|
1134 | #endif
|
---|
1135 |
|
---|
1136 | MNG_VALIDHANDLEX (hHandle)
|
---|
1137 |
|
---|
1138 | #ifdef MNG_SUPPORT_TRACE
|
---|
1139 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_FRAMECOUNT, MNG_LC_END)
|
---|
1140 | #endif
|
---|
1141 |
|
---|
1142 | return ((mng_datap)hHandle)->iFramecount;
|
---|
1143 | }
|
---|
1144 |
|
---|
1145 | /* ************************************************************************** */
|
---|
1146 |
|
---|
1147 | mng_uint32 MNG_DECL mng_get_layercount (mng_handle hHandle)
|
---|
1148 | {
|
---|
1149 | #ifdef MNG_SUPPORT_TRACE
|
---|
1150 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LAYERCOUNT, MNG_LC_START)
|
---|
1151 | #endif
|
---|
1152 |
|
---|
1153 | MNG_VALIDHANDLEX (hHandle)
|
---|
1154 |
|
---|
1155 | #ifdef MNG_SUPPORT_TRACE
|
---|
1156 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LAYERCOUNT, MNG_LC_END)
|
---|
1157 | #endif
|
---|
1158 |
|
---|
1159 | return ((mng_datap)hHandle)->iLayercount;
|
---|
1160 | }
|
---|
1161 |
|
---|
1162 | /* ************************************************************************** */
|
---|
1163 |
|
---|
1164 | mng_uint32 MNG_DECL mng_get_playtime (mng_handle hHandle)
|
---|
1165 | {
|
---|
1166 | #ifdef MNG_SUPPORT_TRACE
|
---|
1167 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_PLAYTIME, MNG_LC_START)
|
---|
1168 | #endif
|
---|
1169 |
|
---|
1170 | MNG_VALIDHANDLEX (hHandle)
|
---|
1171 |
|
---|
1172 | #ifdef MNG_SUPPORT_TRACE
|
---|
1173 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_PLAYTIME, MNG_LC_END)
|
---|
1174 | #endif
|
---|
1175 |
|
---|
1176 | return ((mng_datap)hHandle)->iPlaytime;
|
---|
1177 | }
|
---|
1178 |
|
---|
1179 | /* ************************************************************************** */
|
---|
1180 |
|
---|
1181 | mng_uint32 MNG_DECL mng_get_simplicity (mng_handle hHandle)
|
---|
1182 | {
|
---|
1183 | #ifdef MNG_SUPPORT_TRACE
|
---|
1184 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SIMPLICITY, MNG_LC_START)
|
---|
1185 | #endif
|
---|
1186 |
|
---|
1187 | MNG_VALIDHANDLEX (hHandle)
|
---|
1188 |
|
---|
1189 | #ifdef MNG_SUPPORT_TRACE
|
---|
1190 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SIMPLICITY, MNG_LC_END)
|
---|
1191 | #endif
|
---|
1192 |
|
---|
1193 | return ((mng_datap)hHandle)->iSimplicity;
|
---|
1194 | }
|
---|
1195 |
|
---|
1196 | /* ************************************************************************** */
|
---|
1197 |
|
---|
1198 | mng_uint8 MNG_DECL mng_get_bitdepth (mng_handle hHandle)
|
---|
1199 | {
|
---|
1200 | mng_uint8 iRslt;
|
---|
1201 |
|
---|
1202 | #ifdef MNG_SUPPORT_TRACE
|
---|
1203 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_BITDEPTH, MNG_LC_START)
|
---|
1204 | #endif
|
---|
1205 |
|
---|
1206 | MNG_VALIDHANDLEX (hHandle)
|
---|
1207 |
|
---|
1208 | if (((mng_datap)hHandle)->eImagetype == mng_it_png)
|
---|
1209 | iRslt = ((mng_datap)hHandle)->iBitdepth;
|
---|
1210 | else
|
---|
1211 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1212 | iRslt = ((mng_datap)hHandle)->iJHDRimgbitdepth;
|
---|
1213 | else
|
---|
1214 | iRslt = 0;
|
---|
1215 |
|
---|
1216 | #ifdef MNG_SUPPORT_TRACE
|
---|
1217 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_BITDEPTH, MNG_LC_END)
|
---|
1218 | #endif
|
---|
1219 |
|
---|
1220 | return iRslt;
|
---|
1221 | }
|
---|
1222 |
|
---|
1223 | /* ************************************************************************** */
|
---|
1224 |
|
---|
1225 | mng_uint8 MNG_DECL mng_get_colortype (mng_handle hHandle)
|
---|
1226 | {
|
---|
1227 | mng_uint8 iRslt;
|
---|
1228 |
|
---|
1229 | #ifdef MNG_SUPPORT_TRACE
|
---|
1230 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_COLORTYPE, MNG_LC_START)
|
---|
1231 | #endif
|
---|
1232 |
|
---|
1233 | MNG_VALIDHANDLEX (hHandle)
|
---|
1234 |
|
---|
1235 | if (((mng_datap)hHandle)->eImagetype == mng_it_png)
|
---|
1236 | iRslt = ((mng_datap)hHandle)->iColortype;
|
---|
1237 | else
|
---|
1238 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1239 | iRslt = ((mng_datap)hHandle)->iJHDRcolortype;
|
---|
1240 | else
|
---|
1241 | iRslt = 0;
|
---|
1242 |
|
---|
1243 | #ifdef MNG_SUPPORT_TRACE
|
---|
1244 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_COLORTYPE, MNG_LC_END)
|
---|
1245 | #endif
|
---|
1246 |
|
---|
1247 | return iRslt;
|
---|
1248 | }
|
---|
1249 |
|
---|
1250 | /* ************************************************************************** */
|
---|
1251 |
|
---|
1252 | mng_uint8 MNG_DECL mng_get_compression (mng_handle hHandle)
|
---|
1253 | {
|
---|
1254 | mng_uint8 iRslt;
|
---|
1255 |
|
---|
1256 | #ifdef MNG_SUPPORT_TRACE
|
---|
1257 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_COMPRESSION, MNG_LC_START)
|
---|
1258 | #endif
|
---|
1259 |
|
---|
1260 | MNG_VALIDHANDLEX (hHandle)
|
---|
1261 |
|
---|
1262 | if (((mng_datap)hHandle)->eImagetype == mng_it_png)
|
---|
1263 | iRslt = ((mng_datap)hHandle)->iCompression;
|
---|
1264 | else
|
---|
1265 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1266 | iRslt = ((mng_datap)hHandle)->iJHDRimgcompression;
|
---|
1267 | else
|
---|
1268 | iRslt = 0;
|
---|
1269 |
|
---|
1270 | #ifdef MNG_SUPPORT_TRACE
|
---|
1271 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_COMPRESSION, MNG_LC_END)
|
---|
1272 | #endif
|
---|
1273 |
|
---|
1274 | return iRslt;
|
---|
1275 | }
|
---|
1276 |
|
---|
1277 | /* ************************************************************************** */
|
---|
1278 |
|
---|
1279 | mng_uint8 MNG_DECL mng_get_filter (mng_handle hHandle)
|
---|
1280 | {
|
---|
1281 | mng_uint8 iRslt;
|
---|
1282 |
|
---|
1283 | #ifdef MNG_SUPPORT_TRACE
|
---|
1284 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_FILTER, MNG_LC_START)
|
---|
1285 | #endif
|
---|
1286 |
|
---|
1287 | MNG_VALIDHANDLEX (hHandle)
|
---|
1288 |
|
---|
1289 | if (((mng_datap)hHandle)->eImagetype == mng_it_png)
|
---|
1290 | iRslt = ((mng_datap)hHandle)->iFilter;
|
---|
1291 | else
|
---|
1292 | iRslt = 0;
|
---|
1293 |
|
---|
1294 | #ifdef MNG_SUPPORT_TRACE
|
---|
1295 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_FILTER, MNG_LC_END)
|
---|
1296 | #endif
|
---|
1297 |
|
---|
1298 | return iRslt;
|
---|
1299 | }
|
---|
1300 |
|
---|
1301 | /* ************************************************************************** */
|
---|
1302 |
|
---|
1303 | mng_uint8 MNG_DECL mng_get_interlace (mng_handle hHandle)
|
---|
1304 | {
|
---|
1305 | mng_uint8 iRslt;
|
---|
1306 |
|
---|
1307 | #ifdef MNG_SUPPORT_TRACE
|
---|
1308 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_INTERLACE, MNG_LC_START)
|
---|
1309 | #endif
|
---|
1310 |
|
---|
1311 | MNG_VALIDHANDLEX (hHandle)
|
---|
1312 |
|
---|
1313 | if (((mng_datap)hHandle)->eImagetype == mng_it_png)
|
---|
1314 | iRslt = ((mng_datap)hHandle)->iInterlace;
|
---|
1315 | else
|
---|
1316 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1317 | iRslt = ((mng_datap)hHandle)->iJHDRimginterlace;
|
---|
1318 | else
|
---|
1319 | iRslt = 0;
|
---|
1320 |
|
---|
1321 | #ifdef MNG_SUPPORT_TRACE
|
---|
1322 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_INTERLACE, MNG_LC_END)
|
---|
1323 | #endif
|
---|
1324 |
|
---|
1325 | return iRslt;
|
---|
1326 | }
|
---|
1327 |
|
---|
1328 | /* ************************************************************************** */
|
---|
1329 |
|
---|
1330 | mng_uint8 MNG_DECL mng_get_alphabitdepth (mng_handle hHandle)
|
---|
1331 | {
|
---|
1332 | mng_uint8 iRslt;
|
---|
1333 |
|
---|
1334 | #ifdef MNG_SUPPORT_TRACE
|
---|
1335 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHABITDEPTH, MNG_LC_START)
|
---|
1336 | #endif
|
---|
1337 |
|
---|
1338 | MNG_VALIDHANDLEX (hHandle)
|
---|
1339 |
|
---|
1340 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1341 | iRslt = ((mng_datap)hHandle)->iJHDRalphabitdepth;
|
---|
1342 | else
|
---|
1343 | iRslt = 0;
|
---|
1344 |
|
---|
1345 | #ifdef MNG_SUPPORT_TRACE
|
---|
1346 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHABITDEPTH, MNG_LC_END)
|
---|
1347 | #endif
|
---|
1348 |
|
---|
1349 | return iRslt;
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | /* ************************************************************************** */
|
---|
1353 |
|
---|
1354 | mng_uint8 MNG_DECL mng_get_refreshpass (mng_handle hHandle)
|
---|
1355 | {
|
---|
1356 | mng_uint8 iRslt;
|
---|
1357 | mng_datap pData;
|
---|
1358 |
|
---|
1359 | #ifdef MNG_SUPPORT_TRACE
|
---|
1360 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_REFRESHPASS, MNG_LC_START)
|
---|
1361 | #endif
|
---|
1362 |
|
---|
1363 | MNG_VALIDHANDLEX (hHandle)
|
---|
1364 |
|
---|
1365 | pData = (mng_datap)hHandle;
|
---|
1366 | /* for PNG we know the exact pass */
|
---|
1367 | if ((pData->eImagetype == mng_it_png) && (pData->iPass >= 0))
|
---|
1368 | iRslt = pData->iPass;
|
---|
1369 | #ifdef MNG_INCLUDE_JNG
|
---|
1370 | else /* for JNG we'll fake it... */
|
---|
1371 | if ((pData->eImagetype == mng_it_jng) &&
|
---|
1372 | (pData->bJPEGhasheader) && (pData->bJPEGdecostarted) &&
|
---|
1373 | (pData->bJPEGprogressive))
|
---|
1374 | {
|
---|
1375 | if (pData->pJPEGdinfo->input_scan_number <= 1)
|
---|
1376 | iRslt = 0; /* first pass (I think...) */
|
---|
1377 | else
|
---|
1378 | if (jpeg_input_complete (pData->pJPEGdinfo))
|
---|
1379 | iRslt = 7; /* input complete; aka final pass */
|
---|
1380 | else
|
---|
1381 | iRslt = 3; /* anything between 0 and 7 will do */
|
---|
1382 |
|
---|
1383 | }
|
---|
1384 | #endif
|
---|
1385 | else
|
---|
1386 | iRslt = 0;
|
---|
1387 |
|
---|
1388 | #ifdef MNG_SUPPORT_TRACE
|
---|
1389 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_REFRESHPASS, MNG_LC_END)
|
---|
1390 | #endif
|
---|
1391 |
|
---|
1392 | return iRslt;
|
---|
1393 | }
|
---|
1394 |
|
---|
1395 | /* ************************************************************************** */
|
---|
1396 |
|
---|
1397 | mng_uint8 MNG_DECL mng_get_alphacompression (mng_handle hHandle)
|
---|
1398 | {
|
---|
1399 | mng_uint8 iRslt;
|
---|
1400 |
|
---|
1401 | #ifdef MNG_SUPPORT_TRACE
|
---|
1402 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHACOMPRESSION, MNG_LC_START)
|
---|
1403 | #endif
|
---|
1404 |
|
---|
1405 | MNG_VALIDHANDLEX (hHandle)
|
---|
1406 |
|
---|
1407 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1408 | iRslt = ((mng_datap)hHandle)->iJHDRalphacompression;
|
---|
1409 | else
|
---|
1410 | iRslt = 0;
|
---|
1411 |
|
---|
1412 | #ifdef MNG_SUPPORT_TRACE
|
---|
1413 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHACOMPRESSION, MNG_LC_END)
|
---|
1414 | #endif
|
---|
1415 |
|
---|
1416 | return iRslt;
|
---|
1417 | }
|
---|
1418 |
|
---|
1419 | /* ************************************************************************** */
|
---|
1420 |
|
---|
1421 | mng_uint8 MNG_DECL mng_get_alphafilter (mng_handle hHandle)
|
---|
1422 | {
|
---|
1423 | mng_uint8 iRslt;
|
---|
1424 |
|
---|
1425 | #ifdef MNG_SUPPORT_TRACE
|
---|
1426 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHAFILTER, MNG_LC_START)
|
---|
1427 | #endif
|
---|
1428 |
|
---|
1429 | MNG_VALIDHANDLEX (hHandle)
|
---|
1430 |
|
---|
1431 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1432 | iRslt = ((mng_datap)hHandle)->iJHDRalphafilter;
|
---|
1433 | else
|
---|
1434 | iRslt = 0;
|
---|
1435 |
|
---|
1436 | #ifdef MNG_SUPPORT_TRACE
|
---|
1437 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHAFILTER, MNG_LC_END)
|
---|
1438 | #endif
|
---|
1439 |
|
---|
1440 | return iRslt;
|
---|
1441 | }
|
---|
1442 |
|
---|
1443 | /* ************************************************************************** */
|
---|
1444 |
|
---|
1445 | mng_uint8 MNG_DECL mng_get_alphainterlace (mng_handle hHandle)
|
---|
1446 | {
|
---|
1447 | mng_uint8 iRslt;
|
---|
1448 |
|
---|
1449 | #ifdef MNG_SUPPORT_TRACE
|
---|
1450 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHAINTERLACE, MNG_LC_START)
|
---|
1451 | #endif
|
---|
1452 |
|
---|
1453 | MNG_VALIDHANDLEX (hHandle)
|
---|
1454 |
|
---|
1455 | if (((mng_datap)hHandle)->eImagetype == mng_it_jng)
|
---|
1456 | iRslt = ((mng_datap)hHandle)->iJHDRalphainterlace;
|
---|
1457 | else
|
---|
1458 | iRslt = 0;
|
---|
1459 |
|
---|
1460 | #ifdef MNG_SUPPORT_TRACE
|
---|
1461 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHAINTERLACE, MNG_LC_END)
|
---|
1462 | #endif
|
---|
1463 |
|
---|
1464 | return iRslt;
|
---|
1465 | }
|
---|
1466 |
|
---|
1467 | /* ************************************************************************** */
|
---|
1468 |
|
---|
1469 | mng_uint8 MNG_DECL mng_get_alphadepth (mng_handle hHandle)
|
---|
1470 | {
|
---|
1471 | #ifdef MNG_SUPPORT_TRACE
|
---|
1472 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHADEPTH, MNG_LC_START)
|
---|
1473 | #endif
|
---|
1474 |
|
---|
1475 | MNG_VALIDHANDLEX (hHandle)
|
---|
1476 |
|
---|
1477 | #ifdef MNG_SUPPORT_TRACE
|
---|
1478 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ALPHADEPTH, MNG_LC_END)
|
---|
1479 | #endif
|
---|
1480 |
|
---|
1481 | return ((mng_datap)hHandle)->iAlphadepth;
|
---|
1482 | }
|
---|
1483 |
|
---|
1484 | /* ************************************************************************** */
|
---|
1485 |
|
---|
1486 | mng_uint32 MNG_DECL mng_get_canvasstyle (mng_handle hHandle)
|
---|
1487 | {
|
---|
1488 | #ifdef MNG_SUPPORT_TRACE
|
---|
1489 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CANVASSTYLE, MNG_LC_START)
|
---|
1490 | #endif
|
---|
1491 |
|
---|
1492 | MNG_VALIDHANDLEX (hHandle)
|
---|
1493 |
|
---|
1494 | #ifdef MNG_SUPPORT_TRACE
|
---|
1495 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CANVASSTYLE, MNG_LC_END)
|
---|
1496 | #endif
|
---|
1497 |
|
---|
1498 | return ((mng_datap)hHandle)->iCanvasstyle;
|
---|
1499 | }
|
---|
1500 |
|
---|
1501 | /* ************************************************************************** */
|
---|
1502 |
|
---|
1503 | mng_uint32 MNG_DECL mng_get_bkgdstyle (mng_handle hHandle)
|
---|
1504 | {
|
---|
1505 | #ifdef MNG_SUPPORT_TRACE
|
---|
1506 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_BKGDSTYLE, MNG_LC_START)
|
---|
1507 | #endif
|
---|
1508 |
|
---|
1509 | MNG_VALIDHANDLEX (hHandle)
|
---|
1510 |
|
---|
1511 | #ifdef MNG_SUPPORT_TRACE
|
---|
1512 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_BKGDSTYLE, MNG_LC_END)
|
---|
1513 | #endif
|
---|
1514 |
|
---|
1515 | return ((mng_datap)hHandle)->iBkgdstyle;
|
---|
1516 | }
|
---|
1517 |
|
---|
1518 | /* ************************************************************************** */
|
---|
1519 |
|
---|
1520 | mng_retcode MNG_DECL mng_get_bgcolor (mng_handle hHandle,
|
---|
1521 | mng_uint16* iRed,
|
---|
1522 | mng_uint16* iGreen,
|
---|
1523 | mng_uint16* iBlue)
|
---|
1524 | {
|
---|
1525 | #ifdef MNG_SUPPORT_TRACE
|
---|
1526 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_GET_BGCOLOR, MNG_LC_START)
|
---|
1527 | #endif
|
---|
1528 |
|
---|
1529 | MNG_VALIDHANDLE (hHandle)
|
---|
1530 | *iRed = ((mng_datap)hHandle)->iBGred;
|
---|
1531 | *iGreen = ((mng_datap)hHandle)->iBGgreen;
|
---|
1532 | *iBlue = ((mng_datap)hHandle)->iBGblue;
|
---|
1533 |
|
---|
1534 | #ifdef MNG_SUPPORT_TRACE
|
---|
1535 | MNG_TRACE (((mng_datap)hHandle), MNG_FN_GET_BGCOLOR, MNG_LC_END)
|
---|
1536 | #endif
|
---|
1537 |
|
---|
1538 | return MNG_NOERROR;
|
---|
1539 | }
|
---|
1540 |
|
---|
1541 | /* ************************************************************************** */
|
---|
1542 |
|
---|
1543 | mng_bool MNG_DECL mng_get_usebkgd (mng_handle hHandle)
|
---|
1544 | {
|
---|
1545 | #ifdef MNG_SUPPORT_TRACE
|
---|
1546 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_USEBKGD, MNG_LC_START)
|
---|
1547 | #endif
|
---|
1548 |
|
---|
1549 | MNG_VALIDHANDLEX (hHandle)
|
---|
1550 |
|
---|
1551 | #ifdef MNG_SUPPORT_TRACE
|
---|
1552 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_USEBKGD, MNG_LC_END)
|
---|
1553 | #endif
|
---|
1554 |
|
---|
1555 | return ((mng_datap)hHandle)->bUseBKGD;
|
---|
1556 | }
|
---|
1557 |
|
---|
1558 | /* ************************************************************************** */
|
---|
1559 |
|
---|
1560 | mng_bool MNG_DECL mng_get_storechunks (mng_handle hHandle)
|
---|
1561 | {
|
---|
1562 | #ifdef MNG_SUPPORT_TRACE
|
---|
1563 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_STORECHUNKS, MNG_LC_START)
|
---|
1564 | #endif
|
---|
1565 |
|
---|
1566 | MNG_VALIDHANDLEX (hHandle)
|
---|
1567 |
|
---|
1568 | #ifdef MNG_SUPPORT_TRACE
|
---|
1569 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_STORECHUNKS, MNG_LC_END)
|
---|
1570 | #endif
|
---|
1571 |
|
---|
1572 | return ((mng_datap)hHandle)->bStorechunks;
|
---|
1573 | }
|
---|
1574 |
|
---|
1575 | /* ************************************************************************** */
|
---|
1576 |
|
---|
1577 | mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle)
|
---|
1578 | {
|
---|
1579 | #ifdef MNG_SUPPORT_TRACE
|
---|
1580 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_SECTIONBREAKS, MNG_LC_START)
|
---|
1581 | #endif
|
---|
1582 |
|
---|
1583 | MNG_VALIDHANDLEX (hHandle)
|
---|
1584 |
|
---|
1585 | #ifdef MNG_SUPPORT_TRACE
|
---|
1586 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_SECTIONBREAKS, MNG_LC_END)
|
---|
1587 | #endif
|
---|
1588 |
|
---|
1589 | return ((mng_datap)hHandle)->bSectionbreaks;
|
---|
1590 | }
|
---|
1591 |
|
---|
1592 | /* ************************************************************************** */
|
---|
1593 |
|
---|
1594 | mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle)
|
---|
1595 | {
|
---|
1596 | #ifdef MNG_SUPPORT_TRACE
|
---|
1597 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_CACHEPLAYBACK, MNG_LC_START)
|
---|
1598 | #endif
|
---|
1599 |
|
---|
1600 | MNG_VALIDHANDLEX (hHandle)
|
---|
1601 |
|
---|
1602 | #ifdef MNG_SUPPORT_TRACE
|
---|
1603 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_CACHEPLAYBACK, MNG_LC_END)
|
---|
1604 | #endif
|
---|
1605 |
|
---|
1606 | return ((mng_datap)hHandle)->bCacheplayback;
|
---|
1607 | }
|
---|
1608 |
|
---|
1609 | /* ************************************************************************** */
|
---|
1610 |
|
---|
1611 | mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle)
|
---|
1612 | {
|
---|
1613 | #ifdef MNG_SUPPORT_TRACE
|
---|
1614 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_DOPROGRESSIVE, MNG_LC_START)
|
---|
1615 | #endif
|
---|
1616 |
|
---|
1617 | MNG_VALIDHANDLEX (hHandle)
|
---|
1618 |
|
---|
1619 | #ifdef MNG_SUPPORT_TRACE
|
---|
1620 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_DOPROGRESSIVE, MNG_LC_END)
|
---|
1621 | #endif
|
---|
1622 |
|
---|
1623 | return ((mng_datap)hHandle)->bDoProgressive;
|
---|
1624 | }
|
---|
1625 |
|
---|
1626 | /* ************************************************************************** */
|
---|
1627 |
|
---|
1628 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
1629 | mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle)
|
---|
1630 | {
|
---|
1631 | #ifdef MNG_SUPPORT_TRACE
|
---|
1632 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_SRGB, MNG_LC_START)
|
---|
1633 | #endif
|
---|
1634 |
|
---|
1635 | MNG_VALIDHANDLEX (hHandle)
|
---|
1636 |
|
---|
1637 | #ifdef MNG_SUPPORT_TRACE
|
---|
1638 | MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_SRGB, MNG_LC_END)
|
---|
1639 | #endif
|
---|
1640 |
|
---|
1641 | return ((mng_datap)hHandle)->bIssRGB;
|
---|
1642 | }
|
---|
1643 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
1644 |
|
---|
1645 | /* ************************************************************************** */
|
---|
1646 |
|
---|
1647 | mng_float MNG_DECL mng_get_viewgamma (mng_handle hHandle)
|
---|
1648 | {
|
---|
1649 | #ifdef MNG_SUPPORT_TRACE
|
---|
1650 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_VIEWGAMMA, MNG_LC_START)
|
---|
1651 | #endif
|
---|
1652 |
|
---|
1653 | MNG_VALIDHANDLEX (hHandle)
|
---|
1654 |
|
---|
1655 | #ifdef MNG_SUPPORT_TRACE
|
---|
1656 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_VIEWGAMMA, MNG_LC_END)
|
---|
1657 | #endif
|
---|
1658 |
|
---|
1659 | return ((mng_datap)hHandle)->dViewgamma;
|
---|
1660 | }
|
---|
1661 |
|
---|
1662 | /* ************************************************************************** */
|
---|
1663 |
|
---|
1664 | mng_float MNG_DECL mng_get_displaygamma (mng_handle hHandle)
|
---|
1665 | {
|
---|
1666 | #ifdef MNG_SUPPORT_TRACE
|
---|
1667 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DISPLAYGAMMA, MNG_LC_START)
|
---|
1668 | #endif
|
---|
1669 |
|
---|
1670 | MNG_VALIDHANDLEX (hHandle)
|
---|
1671 |
|
---|
1672 | #ifdef MNG_SUPPORT_TRACE
|
---|
1673 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DISPLAYGAMMA, MNG_LC_END)
|
---|
1674 | #endif
|
---|
1675 |
|
---|
1676 | return ((mng_datap)hHandle)->dDisplaygamma;
|
---|
1677 | }
|
---|
1678 |
|
---|
1679 | /* ************************************************************************** */
|
---|
1680 |
|
---|
1681 | mng_float MNG_DECL mng_get_dfltimggamma (mng_handle hHandle)
|
---|
1682 | {
|
---|
1683 | #ifdef MNG_SUPPORT_TRACE
|
---|
1684 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DFLTIMGGAMMA, MNG_LC_START)
|
---|
1685 | #endif
|
---|
1686 |
|
---|
1687 | MNG_VALIDHANDLEX (hHandle)
|
---|
1688 |
|
---|
1689 | #ifdef MNG_SUPPORT_TRACE
|
---|
1690 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DFLTIMGGAMMA, MNG_LC_END)
|
---|
1691 | #endif
|
---|
1692 |
|
---|
1693 | return ((mng_datap)hHandle)->dDfltimggamma;
|
---|
1694 | }
|
---|
1695 |
|
---|
1696 | /* ************************************************************************** */
|
---|
1697 |
|
---|
1698 | mng_uint32 MNG_DECL mng_get_viewgammaint (mng_handle hHandle)
|
---|
1699 | {
|
---|
1700 | #ifdef MNG_SUPPORT_TRACE
|
---|
1701 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_VIEWGAMMA, MNG_LC_START)
|
---|
1702 | #endif
|
---|
1703 |
|
---|
1704 | MNG_VALIDHANDLEX (hHandle)
|
---|
1705 |
|
---|
1706 | #ifdef MNG_SUPPORT_TRACE
|
---|
1707 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_VIEWGAMMA, MNG_LC_END)
|
---|
1708 | #endif
|
---|
1709 |
|
---|
1710 | return (mng_uint32)(((mng_datap)hHandle)->dViewgamma * 100000);
|
---|
1711 | }
|
---|
1712 |
|
---|
1713 | /* ************************************************************************** */
|
---|
1714 |
|
---|
1715 | mng_uint32 MNG_DECL mng_get_displaygammaint (mng_handle hHandle)
|
---|
1716 | {
|
---|
1717 | #ifdef MNG_SUPPORT_TRACE
|
---|
1718 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DISPLAYGAMMA, MNG_LC_START)
|
---|
1719 | #endif
|
---|
1720 |
|
---|
1721 | MNG_VALIDHANDLEX (hHandle)
|
---|
1722 |
|
---|
1723 | #ifdef MNG_SUPPORT_TRACE
|
---|
1724 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DISPLAYGAMMA, MNG_LC_END)
|
---|
1725 | #endif
|
---|
1726 |
|
---|
1727 | return (mng_uint32)(((mng_datap)hHandle)->dDisplaygamma * 100000);
|
---|
1728 | }
|
---|
1729 |
|
---|
1730 | /* ************************************************************************** */
|
---|
1731 |
|
---|
1732 | mng_uint32 MNG_DECL mng_get_dfltimggammaint (mng_handle hHandle)
|
---|
1733 | {
|
---|
1734 | #ifdef MNG_SUPPORT_TRACE
|
---|
1735 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DFLTIMGGAMMA, MNG_LC_START)
|
---|
1736 | #endif
|
---|
1737 |
|
---|
1738 | MNG_VALIDHANDLEX (hHandle)
|
---|
1739 |
|
---|
1740 | #ifdef MNG_SUPPORT_TRACE
|
---|
1741 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_DFLTIMGGAMMA, MNG_LC_END)
|
---|
1742 | #endif
|
---|
1743 |
|
---|
1744 | return (mng_uint32)(((mng_datap)hHandle)->dDfltimggamma * 100000);
|
---|
1745 | }
|
---|
1746 |
|
---|
1747 | /* ************************************************************************** */
|
---|
1748 |
|
---|
1749 | mng_uint32 MNG_DECL mng_get_maxcanvaswidth (mng_handle hHandle)
|
---|
1750 | {
|
---|
1751 | #ifdef MNG_SUPPORT_TRACE
|
---|
1752 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_MAXCANVASWIDTH, MNG_LC_START)
|
---|
1753 | #endif
|
---|
1754 |
|
---|
1755 | MNG_VALIDHANDLEX (hHandle)
|
---|
1756 |
|
---|
1757 | #ifdef MNG_SUPPORT_TRACE
|
---|
1758 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_MAXCANVASWIDTH, MNG_LC_END)
|
---|
1759 | #endif
|
---|
1760 |
|
---|
1761 | return ((mng_datap)hHandle)->iMaxwidth;
|
---|
1762 | }
|
---|
1763 |
|
---|
1764 | /* ************************************************************************** */
|
---|
1765 |
|
---|
1766 | mng_uint32 MNG_DECL mng_get_maxcanvasheight (mng_handle hHandle)
|
---|
1767 | {
|
---|
1768 | #ifdef MNG_SUPPORT_TRACE
|
---|
1769 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_MAXCANVASHEIGHT, MNG_LC_START)
|
---|
1770 | #endif
|
---|
1771 |
|
---|
1772 | MNG_VALIDHANDLEX (hHandle)
|
---|
1773 |
|
---|
1774 | #ifdef MNG_SUPPORT_TRACE
|
---|
1775 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_MAXCANVASHEIGHT, MNG_LC_END)
|
---|
1776 | #endif
|
---|
1777 |
|
---|
1778 | return ((mng_datap)hHandle)->iMaxheight;
|
---|
1779 | }
|
---|
1780 |
|
---|
1781 | /* ************************************************************************** */
|
---|
1782 |
|
---|
1783 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1784 | mng_int32 MNG_DECL mng_get_zlib_level (mng_handle hHandle)
|
---|
1785 | {
|
---|
1786 | #ifdef MNG_SUPPORT_TRACE
|
---|
1787 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_LEVEL, MNG_LC_START)
|
---|
1788 | #endif
|
---|
1789 |
|
---|
1790 | MNG_VALIDHANDLEX (hHandle)
|
---|
1791 |
|
---|
1792 | #ifdef MNG_SUPPORT_TRACE
|
---|
1793 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_LEVEL, MNG_LC_END)
|
---|
1794 | #endif
|
---|
1795 |
|
---|
1796 | return ((mng_datap)hHandle)->iZlevel;
|
---|
1797 | }
|
---|
1798 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1799 |
|
---|
1800 | /* ************************************************************************** */
|
---|
1801 |
|
---|
1802 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1803 | mng_int32 MNG_DECL mng_get_zlib_method (mng_handle hHandle)
|
---|
1804 | {
|
---|
1805 | #ifdef MNG_SUPPORT_TRACE
|
---|
1806 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_METHOD, MNG_LC_START)
|
---|
1807 | #endif
|
---|
1808 |
|
---|
1809 | MNG_VALIDHANDLEX (hHandle)
|
---|
1810 |
|
---|
1811 | #ifdef MNG_SUPPORT_TRACE
|
---|
1812 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_METHOD, MNG_LC_END)
|
---|
1813 | #endif
|
---|
1814 |
|
---|
1815 | return ((mng_datap)hHandle)->iZmethod;
|
---|
1816 | }
|
---|
1817 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1818 |
|
---|
1819 | /* ************************************************************************** */
|
---|
1820 |
|
---|
1821 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1822 | mng_int32 MNG_DECL mng_get_zlib_windowbits (mng_handle hHandle)
|
---|
1823 | {
|
---|
1824 | #ifdef MNG_SUPPORT_TRACE
|
---|
1825 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_WINDOWBITS, MNG_LC_START)
|
---|
1826 | #endif
|
---|
1827 |
|
---|
1828 | MNG_VALIDHANDLEX (hHandle)
|
---|
1829 |
|
---|
1830 | #ifdef MNG_SUPPORT_TRACE
|
---|
1831 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_WINDOWBITS, MNG_LC_END)
|
---|
1832 | #endif
|
---|
1833 |
|
---|
1834 | return ((mng_datap)hHandle)->iZwindowbits;
|
---|
1835 | }
|
---|
1836 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1837 |
|
---|
1838 | /* ************************************************************************** */
|
---|
1839 |
|
---|
1840 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1841 | mng_int32 MNG_DECL mng_get_zlib_memlevel (mng_handle hHandle)
|
---|
1842 | {
|
---|
1843 | #ifdef MNG_SUPPORT_TRACE
|
---|
1844 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_MEMLEVEL, MNG_LC_START)
|
---|
1845 | #endif
|
---|
1846 |
|
---|
1847 | MNG_VALIDHANDLEX (hHandle)
|
---|
1848 |
|
---|
1849 | #ifdef MNG_SUPPORT_TRACE
|
---|
1850 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_MEMLEVEL, MNG_LC_END)
|
---|
1851 | #endif
|
---|
1852 |
|
---|
1853 | return ((mng_datap)hHandle)->iZmemlevel;
|
---|
1854 | }
|
---|
1855 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1856 |
|
---|
1857 | /* ************************************************************************** */
|
---|
1858 |
|
---|
1859 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1860 | mng_int32 MNG_DECL mng_get_zlib_strategy (mng_handle hHandle)
|
---|
1861 | {
|
---|
1862 | #ifdef MNG_SUPPORT_TRACE
|
---|
1863 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_STRATEGY, MNG_LC_START)
|
---|
1864 | #endif
|
---|
1865 |
|
---|
1866 | MNG_VALIDHANDLEX (hHandle)
|
---|
1867 |
|
---|
1868 | #ifdef MNG_SUPPORT_TRACE
|
---|
1869 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_STRATEGY, MNG_LC_END)
|
---|
1870 | #endif
|
---|
1871 |
|
---|
1872 | return ((mng_datap)hHandle)->iZstrategy;
|
---|
1873 | }
|
---|
1874 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1875 |
|
---|
1876 | /* ************************************************************************** */
|
---|
1877 |
|
---|
1878 | #ifdef MNG_INCLUDE_ZLIB
|
---|
1879 | mng_uint32 MNG_DECL mng_get_zlib_maxidat (mng_handle hHandle)
|
---|
1880 | {
|
---|
1881 | #ifdef MNG_SUPPORT_TRACE
|
---|
1882 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_MAXIDAT, MNG_LC_START)
|
---|
1883 | #endif
|
---|
1884 |
|
---|
1885 | MNG_VALIDHANDLEX (hHandle)
|
---|
1886 |
|
---|
1887 | #ifdef MNG_SUPPORT_TRACE
|
---|
1888 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_ZLIB_MAXIDAT, MNG_LC_END)
|
---|
1889 | #endif
|
---|
1890 |
|
---|
1891 | return ((mng_datap)hHandle)->iMaxIDAT;
|
---|
1892 | }
|
---|
1893 | #endif /* MNG_INCLUDE_ZLIB */
|
---|
1894 |
|
---|
1895 | /* ************************************************************************** */
|
---|
1896 |
|
---|
1897 | #ifdef MNG_INCLUDE_JNG
|
---|
1898 | mngjpeg_dctmethod MNG_DECL mng_get_jpeg_dctmethod (mng_handle hHandle)
|
---|
1899 | {
|
---|
1900 | #ifdef MNG_SUPPORT_TRACE
|
---|
1901 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_DCTMETHOD, MNG_LC_START)
|
---|
1902 | #endif
|
---|
1903 |
|
---|
1904 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
1905 | return JDCT_ISLOW;
|
---|
1906 |
|
---|
1907 | #ifdef MNG_SUPPORT_TRACE
|
---|
1908 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_DCTMETHOD, MNG_LC_END)
|
---|
1909 | #endif
|
---|
1910 |
|
---|
1911 | return ((mng_datap)hHandle)->eJPEGdctmethod;
|
---|
1912 | }
|
---|
1913 | #endif /* MNG_INCLUDE_JNG */
|
---|
1914 |
|
---|
1915 | /* ************************************************************************** */
|
---|
1916 |
|
---|
1917 | #ifdef MNG_INCLUDE_JNG
|
---|
1918 | mng_int32 MNG_DECL mng_get_jpeg_quality (mng_handle hHandle)
|
---|
1919 | {
|
---|
1920 | #ifdef MNG_SUPPORT_TRACE
|
---|
1921 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_QUALITY, MNG_LC_START)
|
---|
1922 | #endif
|
---|
1923 |
|
---|
1924 | MNG_VALIDHANDLEX (hHandle)
|
---|
1925 |
|
---|
1926 | #ifdef MNG_SUPPORT_TRACE
|
---|
1927 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_QUALITY, MNG_LC_END)
|
---|
1928 | #endif
|
---|
1929 |
|
---|
1930 | return ((mng_datap)hHandle)->iJPEGquality;
|
---|
1931 | }
|
---|
1932 | #endif /* MNG_INCLUDE_JNG */
|
---|
1933 |
|
---|
1934 | /* ************************************************************************** */
|
---|
1935 |
|
---|
1936 | #ifdef MNG_INCLUDE_JNG
|
---|
1937 | mng_int32 MNG_DECL mng_get_jpeg_smoothing (mng_handle hHandle)
|
---|
1938 | {
|
---|
1939 | #ifdef MNG_SUPPORT_TRACE
|
---|
1940 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_SMOOTHING, MNG_LC_START)
|
---|
1941 | #endif
|
---|
1942 |
|
---|
1943 | MNG_VALIDHANDLEX (hHandle)
|
---|
1944 |
|
---|
1945 | #ifdef MNG_SUPPORT_TRACE
|
---|
1946 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_SMOOTHING, MNG_LC_END)
|
---|
1947 | #endif
|
---|
1948 |
|
---|
1949 | return ((mng_datap)hHandle)->iJPEGsmoothing;
|
---|
1950 | }
|
---|
1951 | #endif /* MNG_INCLUDE_JNG */
|
---|
1952 |
|
---|
1953 | /* ************************************************************************** */
|
---|
1954 |
|
---|
1955 | #ifdef MNG_INCLUDE_JNG
|
---|
1956 | mng_bool MNG_DECL mng_get_jpeg_progressive (mng_handle hHandle)
|
---|
1957 | {
|
---|
1958 | #ifdef MNG_SUPPORT_TRACE
|
---|
1959 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_PROGRESSIVE, MNG_LC_START)
|
---|
1960 | #endif
|
---|
1961 |
|
---|
1962 | MNG_VALIDHANDLEX (hHandle)
|
---|
1963 |
|
---|
1964 | #ifdef MNG_SUPPORT_TRACE
|
---|
1965 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_PROGRESSIVE, MNG_LC_END)
|
---|
1966 | #endif
|
---|
1967 |
|
---|
1968 | return ((mng_datap)hHandle)->bJPEGcompressprogr;
|
---|
1969 | }
|
---|
1970 | #endif /* MNG_INCLUDE_JNG */
|
---|
1971 |
|
---|
1972 | /* ************************************************************************** */
|
---|
1973 |
|
---|
1974 | #ifdef MNG_INCLUDE_JNG
|
---|
1975 | mng_bool MNG_DECL mng_get_jpeg_optimized (mng_handle hHandle)
|
---|
1976 | {
|
---|
1977 | #ifdef MNG_SUPPORT_TRACE
|
---|
1978 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_OPTIMIZED, MNG_LC_START)
|
---|
1979 | #endif
|
---|
1980 |
|
---|
1981 | MNG_VALIDHANDLEX (hHandle)
|
---|
1982 |
|
---|
1983 | #ifdef MNG_SUPPORT_TRACE
|
---|
1984 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_OPTIMIZED, MNG_LC_END)
|
---|
1985 | #endif
|
---|
1986 |
|
---|
1987 | return ((mng_datap)hHandle)->bJPEGcompressopt;
|
---|
1988 | }
|
---|
1989 | #endif /* MNG_INCLUDE_JNG */
|
---|
1990 |
|
---|
1991 | /* ************************************************************************** */
|
---|
1992 |
|
---|
1993 | #ifdef MNG_INCLUDE_JNG
|
---|
1994 | mng_uint32 MNG_DECL mng_get_jpeg_maxjdat (mng_handle hHandle)
|
---|
1995 | {
|
---|
1996 | #ifdef MNG_SUPPORT_TRACE
|
---|
1997 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_MAXJDAT, MNG_LC_START)
|
---|
1998 | #endif
|
---|
1999 |
|
---|
2000 | MNG_VALIDHANDLEX (hHandle)
|
---|
2001 |
|
---|
2002 | #ifdef MNG_SUPPORT_TRACE
|
---|
2003 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_JPEG_MAXJDAT, MNG_LC_END)
|
---|
2004 | #endif
|
---|
2005 |
|
---|
2006 | return ((mng_datap)hHandle)->iMaxJDAT;
|
---|
2007 | }
|
---|
2008 | #endif /* MNG_INCLUDE_JNG */
|
---|
2009 |
|
---|
2010 | /* ************************************************************************** */
|
---|
2011 |
|
---|
2012 | #ifdef MNG_SUPPORT_READ
|
---|
2013 | mng_bool MNG_DECL mng_get_suspensionmode (mng_handle hHandle)
|
---|
2014 | {
|
---|
2015 | #ifdef MNG_SUPPORT_TRACE
|
---|
2016 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SUSPENSIONMODE, MNG_LC_START)
|
---|
2017 | #endif
|
---|
2018 |
|
---|
2019 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2020 | return MNG_FALSE;
|
---|
2021 |
|
---|
2022 | #ifdef MNG_SUPPORT_TRACE
|
---|
2023 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SUSPENSIONMODE, MNG_LC_END)
|
---|
2024 | #endif
|
---|
2025 |
|
---|
2026 | return ((mng_datap)hHandle)->bSuspensionmode;
|
---|
2027 | }
|
---|
2028 | #endif /* MNG_SUPPORT_READ */
|
---|
2029 |
|
---|
2030 | /* ************************************************************************** */
|
---|
2031 |
|
---|
2032 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2033 | mng_speedtype MNG_DECL mng_get_speed (mng_handle hHandle)
|
---|
2034 | {
|
---|
2035 | #ifdef MNG_SUPPORT_TRACE
|
---|
2036 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SPEED, MNG_LC_START)
|
---|
2037 | #endif
|
---|
2038 |
|
---|
2039 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2040 | return mng_st_normal;
|
---|
2041 |
|
---|
2042 | #ifdef MNG_SUPPORT_TRACE
|
---|
2043 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_SPEED, MNG_LC_END)
|
---|
2044 | #endif
|
---|
2045 |
|
---|
2046 | return ((mng_datap)hHandle)->iSpeed;
|
---|
2047 | }
|
---|
2048 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2049 |
|
---|
2050 | /* ************************************************************************** */
|
---|
2051 |
|
---|
2052 | mng_uint32 MNG_DECL mng_get_imagelevel (mng_handle hHandle)
|
---|
2053 | {
|
---|
2054 | #ifdef MNG_SUPPORT_TRACE
|
---|
2055 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGELEVEL, MNG_LC_START)
|
---|
2056 | #endif
|
---|
2057 |
|
---|
2058 | MNG_VALIDHANDLEX (hHandle)
|
---|
2059 |
|
---|
2060 | #ifdef MNG_SUPPORT_TRACE
|
---|
2061 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_IMAGELEVEL, MNG_LC_END)
|
---|
2062 | #endif
|
---|
2063 |
|
---|
2064 | return ((mng_datap)hHandle)->iImagelevel;
|
---|
2065 | }
|
---|
2066 |
|
---|
2067 | /* ************************************************************************** */
|
---|
2068 |
|
---|
2069 | mng_retcode MNG_DECL mng_get_lastbackchunk (mng_handle hHandle,
|
---|
2070 | mng_uint16* iRed,
|
---|
2071 | mng_uint16* iGreen,
|
---|
2072 | mng_uint16* iBlue,
|
---|
2073 | mng_uint8* iMandatory)
|
---|
2074 | {
|
---|
2075 | #ifdef MNG_SUPPORT_TRACE
|
---|
2076 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LASTBACKCHUNK, MNG_LC_START)
|
---|
2077 | #endif
|
---|
2078 |
|
---|
2079 | MNG_VALIDHANDLEX (hHandle)
|
---|
2080 |
|
---|
2081 | if (((mng_datap)hHandle)->eImagetype != mng_it_mng)
|
---|
2082 | MNG_ERROR (((mng_datap)hHandle), MNG_FUNCTIONINVALID)
|
---|
2083 |
|
---|
2084 | *iRed = ((mng_datap)hHandle)->iBACKred;
|
---|
2085 | *iGreen = ((mng_datap)hHandle)->iBACKgreen;
|
---|
2086 | *iBlue = ((mng_datap)hHandle)->iBACKblue;
|
---|
2087 | *iMandatory = ((mng_datap)hHandle)->iBACKmandatory;
|
---|
2088 |
|
---|
2089 | #ifdef MNG_SUPPORT_TRACE
|
---|
2090 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LASTBACKCHUNK, MNG_LC_END)
|
---|
2091 | #endif
|
---|
2092 |
|
---|
2093 | return MNG_NOERROR;
|
---|
2094 | }
|
---|
2095 |
|
---|
2096 | /* ************************************************************************** */
|
---|
2097 |
|
---|
2098 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2099 | mng_uint32 MNG_DECL mng_get_starttime (mng_handle hHandle)
|
---|
2100 | {
|
---|
2101 | #ifdef MNG_SUPPORT_TRACE
|
---|
2102 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_STARTTIME, MNG_LC_START)
|
---|
2103 | #endif
|
---|
2104 |
|
---|
2105 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2106 | return mng_st_normal;
|
---|
2107 |
|
---|
2108 | #ifdef MNG_SUPPORT_TRACE
|
---|
2109 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_STARTTIME, MNG_LC_END)
|
---|
2110 | #endif
|
---|
2111 |
|
---|
2112 | return ((mng_datap)hHandle)->iStarttime;
|
---|
2113 | }
|
---|
2114 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2115 |
|
---|
2116 | /* ************************************************************************** */
|
---|
2117 |
|
---|
2118 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2119 | mng_uint32 MNG_DECL mng_get_runtime (mng_handle hHandle)
|
---|
2120 | {
|
---|
2121 | #ifdef MNG_SUPPORT_TRACE
|
---|
2122 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_RUNTIME, MNG_LC_START)
|
---|
2123 | #endif
|
---|
2124 |
|
---|
2125 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2126 | return mng_st_normal;
|
---|
2127 |
|
---|
2128 | #ifdef MNG_SUPPORT_TRACE
|
---|
2129 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_RUNTIME, MNG_LC_END)
|
---|
2130 | #endif
|
---|
2131 |
|
---|
2132 | return ((mng_datap)hHandle)->iRuntime;
|
---|
2133 | }
|
---|
2134 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2135 |
|
---|
2136 | /* ************************************************************************** */
|
---|
2137 |
|
---|
2138 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2139 | mng_uint32 MNG_DECL mng_get_currentframe (mng_handle hHandle)
|
---|
2140 | {
|
---|
2141 | #ifdef MNG_SUPPORT_TRACE
|
---|
2142 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTFRAME, MNG_LC_START)
|
---|
2143 | #endif
|
---|
2144 |
|
---|
2145 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2146 | return mng_st_normal;
|
---|
2147 |
|
---|
2148 | #ifdef MNG_SUPPORT_TRACE
|
---|
2149 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTFRAME, MNG_LC_END)
|
---|
2150 | #endif
|
---|
2151 |
|
---|
2152 | return ((mng_datap)hHandle)->iFrameseq;
|
---|
2153 | }
|
---|
2154 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2155 |
|
---|
2156 | /* ************************************************************************** */
|
---|
2157 |
|
---|
2158 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2159 | mng_uint32 MNG_DECL mng_get_currentlayer (mng_handle hHandle)
|
---|
2160 | {
|
---|
2161 | #ifdef MNG_SUPPORT_TRACE
|
---|
2162 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTLAYER, MNG_LC_START)
|
---|
2163 | #endif
|
---|
2164 |
|
---|
2165 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2166 | return mng_st_normal;
|
---|
2167 |
|
---|
2168 | #ifdef MNG_SUPPORT_TRACE
|
---|
2169 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTLAYER, MNG_LC_END)
|
---|
2170 | #endif
|
---|
2171 |
|
---|
2172 | return ((mng_datap)hHandle)->iLayerseq;
|
---|
2173 | }
|
---|
2174 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2175 |
|
---|
2176 | /* ************************************************************************** */
|
---|
2177 |
|
---|
2178 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2179 | mng_uint32 MNG_DECL mng_get_currentplaytime (mng_handle hHandle)
|
---|
2180 | {
|
---|
2181 | #ifdef MNG_SUPPORT_TRACE
|
---|
2182 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTPLAYTIME, MNG_LC_START)
|
---|
2183 | #endif
|
---|
2184 |
|
---|
2185 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2186 | return mng_st_normal;
|
---|
2187 |
|
---|
2188 | #ifdef MNG_SUPPORT_TRACE
|
---|
2189 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_CURRENTPLAYTIME, MNG_LC_END)
|
---|
2190 | #endif
|
---|
2191 |
|
---|
2192 | return ((mng_datap)hHandle)->iFrametime;
|
---|
2193 | }
|
---|
2194 | #endif /* MNG_SUPPORT_DISPLAY */
|
---|
2195 |
|
---|
2196 | /* ************************************************************************** */
|
---|
2197 |
|
---|
2198 | mng_bool MNG_DECL mng_status_error (mng_handle hHandle)
|
---|
2199 | {
|
---|
2200 | #ifdef MNG_SUPPORT_TRACE
|
---|
2201 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_ERROR, MNG_LC_START)
|
---|
2202 | #endif
|
---|
2203 |
|
---|
2204 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2205 | return MNG_FALSE;
|
---|
2206 |
|
---|
2207 | #ifdef MNG_SUPPORT_TRACE
|
---|
2208 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_ERROR, MNG_LC_END)
|
---|
2209 | #endif
|
---|
2210 |
|
---|
2211 | return (mng_bool)((mng_datap)hHandle)->iErrorcode;
|
---|
2212 | }
|
---|
2213 |
|
---|
2214 | /* ************************************************************************** */
|
---|
2215 |
|
---|
2216 | #ifdef MNG_SUPPORT_READ
|
---|
2217 | mng_bool MNG_DECL mng_status_reading (mng_handle hHandle)
|
---|
2218 | {
|
---|
2219 | #ifdef MNG_SUPPORT_TRACE
|
---|
2220 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_READING, MNG_LC_START)
|
---|
2221 | #endif
|
---|
2222 |
|
---|
2223 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2224 | return MNG_FALSE;
|
---|
2225 |
|
---|
2226 | #ifdef MNG_SUPPORT_TRACE
|
---|
2227 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_READING, MNG_LC_END)
|
---|
2228 | #endif
|
---|
2229 |
|
---|
2230 | return ((mng_datap)hHandle)->bReading;
|
---|
2231 | }
|
---|
2232 | #endif
|
---|
2233 |
|
---|
2234 | /* ************************************************************************** */
|
---|
2235 |
|
---|
2236 | #ifdef MNG_SUPPORT_READ
|
---|
2237 | mng_bool MNG_DECL mng_status_suspendbreak (mng_handle hHandle)
|
---|
2238 | {
|
---|
2239 | #ifdef MNG_SUPPORT_TRACE
|
---|
2240 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_SUSPENDBREAK, MNG_LC_START)
|
---|
2241 | #endif
|
---|
2242 |
|
---|
2243 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2244 | return MNG_FALSE;
|
---|
2245 |
|
---|
2246 | #ifdef MNG_SUPPORT_TRACE
|
---|
2247 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_SUSPENDBREAK, MNG_LC_END)
|
---|
2248 | #endif
|
---|
2249 |
|
---|
2250 | return ((mng_datap)hHandle)->bSuspended;
|
---|
2251 | }
|
---|
2252 | #endif
|
---|
2253 |
|
---|
2254 | /* ************************************************************************** */
|
---|
2255 |
|
---|
2256 | #ifdef MNG_SUPPORT_WRITE
|
---|
2257 | mng_bool MNG_DECL mng_status_creating (mng_handle hHandle)
|
---|
2258 | {
|
---|
2259 | #ifdef MNG_SUPPORT_TRACE
|
---|
2260 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_CREATING, MNG_LC_START)
|
---|
2261 | #endif
|
---|
2262 |
|
---|
2263 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2264 | return MNG_FALSE;
|
---|
2265 |
|
---|
2266 | #ifdef MNG_SUPPORT_TRACE
|
---|
2267 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_CREATING, MNG_LC_END)
|
---|
2268 | #endif
|
---|
2269 |
|
---|
2270 | return ((mng_datap)hHandle)->bCreating;
|
---|
2271 | }
|
---|
2272 | #endif
|
---|
2273 |
|
---|
2274 | /* ************************************************************************** */
|
---|
2275 |
|
---|
2276 | #ifdef MNG_SUPPORT_WRITE
|
---|
2277 | mng_bool MNG_DECL mng_status_writing (mng_handle hHandle)
|
---|
2278 | {
|
---|
2279 | #ifdef MNG_SUPPORT_TRACE
|
---|
2280 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_WRITING, MNG_LC_START)
|
---|
2281 | #endif
|
---|
2282 |
|
---|
2283 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2284 | return MNG_FALSE;
|
---|
2285 |
|
---|
2286 | #ifdef MNG_SUPPORT_TRACE
|
---|
2287 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_WRITING, MNG_LC_END)
|
---|
2288 | #endif
|
---|
2289 |
|
---|
2290 | return ((mng_datap)hHandle)->bWriting;
|
---|
2291 | }
|
---|
2292 | #endif
|
---|
2293 |
|
---|
2294 | /* ************************************************************************** */
|
---|
2295 |
|
---|
2296 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2297 | mng_bool MNG_DECL mng_status_displaying (mng_handle hHandle)
|
---|
2298 | {
|
---|
2299 | #ifdef MNG_SUPPORT_TRACE
|
---|
2300 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_DISPLAYING, MNG_LC_START)
|
---|
2301 | #endif
|
---|
2302 |
|
---|
2303 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2304 | return MNG_FALSE;
|
---|
2305 |
|
---|
2306 | #ifdef MNG_SUPPORT_TRACE
|
---|
2307 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_DISPLAYING, MNG_LC_END)
|
---|
2308 | #endif
|
---|
2309 |
|
---|
2310 | return ((mng_datap)hHandle)->bDisplaying;
|
---|
2311 | }
|
---|
2312 | #endif
|
---|
2313 |
|
---|
2314 | /* ************************************************************************** */
|
---|
2315 |
|
---|
2316 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2317 | mng_bool MNG_DECL mng_status_running (mng_handle hHandle)
|
---|
2318 | {
|
---|
2319 | #ifdef MNG_SUPPORT_TRACE
|
---|
2320 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_RUNNING, MNG_LC_START)
|
---|
2321 | #endif
|
---|
2322 |
|
---|
2323 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2324 | return MNG_FALSE;
|
---|
2325 |
|
---|
2326 | #ifdef MNG_SUPPORT_TRACE
|
---|
2327 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_RUNNING, MNG_LC_END)
|
---|
2328 | #endif
|
---|
2329 |
|
---|
2330 | return ((mng_datap)hHandle)->bRunning;
|
---|
2331 | }
|
---|
2332 | #endif
|
---|
2333 |
|
---|
2334 | /* ************************************************************************** */
|
---|
2335 |
|
---|
2336 | #ifdef MNG_SUPPORT_DISPLAY
|
---|
2337 | mng_bool MNG_DECL mng_status_timerbreak (mng_handle hHandle)
|
---|
2338 | {
|
---|
2339 | #ifdef MNG_SUPPORT_TRACE
|
---|
2340 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_TIMERBREAK, MNG_LC_START)
|
---|
2341 | #endif
|
---|
2342 |
|
---|
2343 | if ((hHandle == 0) || (((mng_datap)hHandle)->iMagic != MNG_MAGIC))
|
---|
2344 | return MNG_FALSE;
|
---|
2345 |
|
---|
2346 | #ifdef MNG_SUPPORT_TRACE
|
---|
2347 | MNG_TRACEX (((mng_datap)hHandle), MNG_FN_STATUS_TIMERBREAK, MNG_LC_END)
|
---|
2348 | #endif
|
---|
2349 |
|
---|
2350 | return ((mng_datap)hHandle)->bTimerset;
|
---|
2351 | }
|
---|
2352 | #endif
|
---|
2353 |
|
---|
2354 | /* ************************************************************************** */
|
---|
2355 | /* * end of file * */
|
---|
2356 | /* ************************************************************************** */
|
---|
2357 |
|
---|