b311480e |
1 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
2 | // |
3 | // The content of this file is subject to the Open CASCADE Technology Public |
4 | // License Version 6.5 (the "License"). You may not use the content of this file |
5 | // except in compliance with the License. Please obtain a copy of the License |
6 | // at http://www.opencascade.org and read it completely before using this file. |
7 | // |
8 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
9 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
10 | // |
11 | // The Original Code and all software distributed under the License is |
12 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
13 | // Initial Developer hereby disclaims all such warranties, including without |
14 | // limitation, any warranties of merchantability, fitness for a particular |
15 | // purpose or non-infringement. Please see the License for the specific terms |
16 | // and conditions governing the rights and limitations under the License. |
17 | |
18 | |
7fd59977 |
19 | #include <Xw_Extension.h> |
20 | |
b311480e |
21 | /* ifdef then trace on */ |
7fd59977 |
22 | #ifdef TRACE |
23 | #define TRACE_GET_IMAGE_INFO |
24 | #endif |
25 | |
26 | /* |
27 | XW_STATUS Xw_get_image_info (aimage,zoom,width,height,depth): |
28 | XW_EXT_IMAGEDATA *aimage Image |
29 | float *zoom returned Zoom factor |
30 | int *width,*height returned Image pixel size |
31 | int *depth returned Image planes depth. |
32 | |
33 | Get image size and zoom factor. |
34 | |
35 | returns ERROR if bad image extended address |
36 | returns SUCCESS if successfull |
37 | |
38 | * |
39 | |
40 | */ |
41 | |
42 | #ifdef XW_PROTOTYPE |
43 | XW_STATUS Xw_get_image_info (void* aimage,float *zoom,int* width,int* height,int *depth) |
44 | #else |
45 | XW_STATUS Xw_get_image_info (aimage,zoom,width,height,depth) |
46 | void *aimage; |
47 | float *zoom; |
48 | int *width; |
49 | int *height; |
50 | int *depth; |
51 | #endif /*XW_PROTOTYPE*/ |
52 | { |
53 | XW_EXT_IMAGEDATA *pimage = (XW_EXT_IMAGEDATA*)aimage; |
54 | |
55 | if( !Xw_isdefine_image(pimage) ) { |
56 | /*ERROR*Bad EXT_IMAGE Address*/ |
57 | Xw_set_error(25,"Xw_get_image_info",pimage) ; |
58 | return (XW_ERROR) ; |
59 | } |
60 | |
61 | *zoom = pimage->zoom; |
62 | *width = _IIMAGE->width; |
63 | *height = _IIMAGE->height; |
64 | *depth = _IIMAGE->depth; |
65 | |
66 | #ifdef TRACE_GET_IMAGE_INFO |
67 | if( Xw_get_trace() ) { |
68 | printf (" Xw_get_image_info('%lx',%f,%d,%d,%d)\n",(long ) aimage, |
69 | *zoom,*width,*height,*depth); |
70 | } |
71 | #endif |
72 | |
73 | return (XW_SUCCESS); |
74 | } |