b311480e |
1 | // Copyright (c) 1995-1999 Matra Datavision |
2 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
3 | // |
4 | // The content of this file is subject to the Open CASCADE Technology Public |
5 | // License Version 6.5 (the "License"). You may not use the content of this file |
6 | // except in compliance with the License. Please obtain a copy of the License |
7 | // at http://www.opencascade.org and read it completely before using this file. |
8 | // |
9 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
10 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
11 | // |
12 | // The Original Code and all software distributed under the License is |
13 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
14 | // Initial Developer hereby disclaims all such warranties, including without |
15 | // limitation, any warranties of merchantability, fitness for a particular |
16 | // purpose or non-infringement. Please see the License for the specific terms |
17 | // and conditions governing the rights and limitations under the License. |
18 | |
7fd59977 |
19 | //============================================================================ |
20 | //==== Titre: AlienImage_SUNRFFileHeader.hxx |
21 | //==== Role : The header file of primitve type "SUNRFFileHeader" |
22 | //==== Implementation: This is a primitive type implemented with typedef |
23 | //==== typedef SUNRFSUNRFFileHeader AlienImage_SUNRFFileHeader; |
24 | //============================================================================ |
25 | |
26 | #ifndef _AlienImage_SUNRFFileHeader_HeaderFile |
27 | #define _AlienImage_SUNRFFileHeader_HeaderFile |
28 | |
29 | //==== Definition de Type ==================================================== |
30 | #include <Standard_Type.hxx> |
31 | const Handle(Standard_Type)& STANDARD_TYPE(AlienImage_SUNRFFileHeader); |
32 | //============================================================================ |
33 | |
34 | #define RAS_MAGIC 0x59a66a95 |
35 | |
36 | /* Sun supported ras_type's */ |
37 | #define RT_OLD 0 /* Raw pixrect image in 68000 byte order */ |
38 | #define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */ |
39 | #define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */ |
40 | #define RT_FORMAT_RGB 3 /* XRGB or RGB instead of XBGR or BGR */ |
41 | #define RT_FORMAT_TIFF 4 /* tiff <-> standard rasterfile */ |
42 | #define RT_FORMAT_IFF 5 /* iff (TAAC format) <-> standard rasterfile */ |
43 | #define RT_EXPERIMENTAL 0xffff /* Reserved for testing */ |
44 | |
45 | /* Sun registered ras_maptype's */ |
46 | #define RMT_RAW 2 |
47 | /* Sun supported ras_maptype's */ |
48 | #define RMT_NONE 0 /* ras_maplength is expected to be 0 */ |
49 | #define RMT_EQUAL_RGB 1 /* red[ras_maplength/3],green[],blue[] */ |
50 | |
51 | /* |
52 | * NOTES: |
53 | * Each line of the image is rounded out to a multiple of 16 bits. |
54 | * This corresponds to the rounding convention used by the memory pixrect |
55 | * package (/usr/include/pixrect/memvar.h) of the SunWindows system. |
56 | * The ras_encoding field (always set to 0 by Sun's supported software) |
57 | * was renamed to ras_length in release 2.0. As a result, rasterfiles |
58 | * of type 0 generated by the old software claim to have 0 length; for |
59 | * compatibility, code reading rasterfiles must be prepared to compute the |
60 | * true length from the width, height, and depth fields. |
61 | */ |
62 | |
63 | |
64 | typedef struct { |
65 | int ras_magic; /* magic number */ |
66 | int ras_width; /* width (pixels) of image */ |
67 | int ras_height; /* height (pixels) of image */ |
68 | int ras_depth; /* depth (1, 8, or 24 bits) of pixel */ |
69 | int ras_length; /* length (bytes) of image */ |
70 | int ras_type; /* type of file; see RT_* below */ |
71 | int ras_maptype; /* type of colormap; see RMT_* below */ |
72 | int ras_maplength; /* length (bytes) of following map */ |
73 | /* color map follows for ras_maplength bytes, followed by image */ |
74 | } AlienImage_SUNRFFileHeader; |
75 | |
76 | ostream& operator << ( ostream& s, const AlienImage_SUNRFFileHeader& h ); |
77 | |
78 | Standard_Boolean operator==(const AlienImage_SUNRFFileHeader& Obj1, |
79 | const AlienImage_SUNRFFileHeader& Obj2) ; |
80 | void ShallowDump (const AlienImage_SUNRFFileHeader& AnObject,Standard_OStream& S) ; |
81 | |
82 | #endif |
83 | |