1 // ----------------------------------------------------------------------------
2 // MODULE : Compressor
3 // LANGUAGE : C++
4 // AUTHOR : Adolfo VIDE
5 // DATE : Tuesday, September 15th 1992
6 // DESCRIPTION :
7 // COMMENT :
8 // SCCSID : @(#)compress.h 1.1 11:46:37 18 Dec 1996
9 // ----------------------------------------------------------------------------
10 // Copyright (c) 1999 Digital Imaging Group, Inc.
11 // For conditions of distribution and use, see copyright notice
12 // in Flashpix.h
13 // ----------------------------------------------------------------------------
14 #ifndef Compresseur_h
15 #define Compresseur_h
16 #ifndef Commun_h
17 #include "common.h"
18 #endif
19 // ----------------------------------------------------------------------------
20
21 // Includes
22 // --------
23
24 #ifndef IVue_h
25 #include "ri_sys.h"
26 #endif
27
28 // Classes declarations
29 // --------------------
30
31 class obj_Compresseur;
32 typedef obj_Compresseur* ptr_Compresseur;
33 typedef obj_Compresseur& ref_Compresseur;
34
35 class obj_TousLesCodecs;
36 typedef obj_TousLesCodecs* ptr_TousLesCodecs;
37 typedef obj_TousLesCodecs& ref_TousLesCodecs;
38
39 class obj_ServerParam;
40 typedef obj_ServerParam* ptr_ServerParam;
41 typedef obj_ServerParam& ref_ServerParam;
42
43 // Classes definitions
44 // -------------------
45
46 class obj_Compresseur : public PToolkitObject
47 {
48 public:
49
obj_Compresseur()50 obj_Compresseur() { compresseurPresent = decompresseurPresent = TRUE; compresseurLocked = FALSE; }
51 virtual ~obj_Compresseur();
52
53 // Compress an image. Return false on error.
54 virtual Boolean Compresse(Ptr uncompressedData, short width, short height,
55 Ptr* pcompressedData, long* sizeCompressed);
56
57 // Uncompress an image. Return false on error.
58 virtual Boolean Decompresse(Ptr uncompressedData, short width, short height,
59 Ptr compressedData, long sizeCompressed);
60
61 void Lock(); // Flag compressor as in use
62 void UnLock(); // Flag compressor as free
63
64 // Purge data used by the compressor
65 virtual Boolean Purge();
66
CompresseurPresent()67 short CompresseurPresent() { return compresseurPresent; }
DecompresseurPresent()68 short DecompresseurPresent() { return decompresseurPresent; }
69
70 protected:
71 short compresseurPresent, decompresseurPresent;
72 Boolean compresseurLocked;
73 long compressionSubtype;
74
75 };
76
77
78 // One object of this class knows all the compressors/decompressors installed on this machine
79 class obj_TousLesCodecs : public PToolkitObject
80 {
81 public:
82
83 // Initialize the array of compressors lesCodecs[] for this machine
84 obj_TousLesCodecs();
85 virtual ~obj_TousLesCodecs();
86
87 // To consult the array of compressors
88 ptr_Compresseur operator [](TLC_IdCodec numero) { return lesCodecs[numero]; }
89
90 // Purge data used by the compressors
91 Boolean Purge();
92
93 private:
94 // Array of compressors installed on this machine
95 obj_Compresseur **lesCodecs;
96 };
97
98 // Global variables
99 // ----------------
100
101 extern ptr_TousLesCodecs tousLesCodecs;
102 #define allCodecs (*tousLesCodecs)
103
104 // Functions 'inline'
105 // ------------------
106
Lock()107 inline void obj_Compresseur::Lock() { compresseurLocked = TRUE; }
108
UnLock()109 inline void obj_Compresseur::UnLock() { compresseurLocked = FALSE; }
110
111 // Functions 'extern'
112 // ------------------
113
114 // ----------------------------------------------------------------------------
115 #endif // Compresseur_h
116 // ----------------------------------------------------------------------------
117