2 //---------------------------------------------------------------------------------
4 // Little Color Management System
5 // Copyright (c) 1998-2010 Marti Maria Saguer
7 // Permission is hereby granted, free of charge, to any person obtaining
8 // a copy of this software and associated documentation files (the "Software"),
9 // to deal in the Software without restriction, including without limitation
10 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 // and/or sell copies of the Software, and to permit persons to whom the Software
12 // is furnished to do so, subject to the following conditions:
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
19 // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //---------------------------------------------------------------------------------
29 // Deal with Microsoft's attempt at deprecating C standard runtime functions
31 # if (_MSC_VER >= 1400)
32 # ifndef _CRT_SECURE_NO_DEPRECATE
33 # define _CRT_SECURE_NO_DEPRECATE
35 # ifndef _CRT_SECURE_NO_WARNINGS
36 # define _CRT_SECURE_NO_WARNINGS
54 #define UTILS_UNUSED_PARAMETER(x) ((void)x)
56 // Init the utility functions
58 void InitUtils(const char* PName
);
60 // Fatal Error (print the message and exit(1))---------------------------------------------
64 void FatalError(const char *frm
, ...);
66 // xgetopt() interface -------------------------------------------------------------
73 int xgetopt(int argc
, char *argv
[], char *optionS
);
75 // The stock profile utility -------------------------------------------------------
77 cmsHPROFILE
OpenStockProfile(cmsContext ContextID
, const char* File
);
79 // The print info utility ----------------------------------------------------------
81 void PrintProfileInformation(cmsHPROFILE h
);
83 // ---------------------------------------------------------------------------------
85 void PrintRenderingIntents(void);
86 void PrintBuiltins(void);
88 // ---------------------------------------------------------------------------------
90 cmsBool
SaveMemoryBlock(const cmsUInt8Number
* Buffer
, cmsUInt32Number dwLen
, const char* Filename
);
92 // ---------------------------------------------------------------------------------
94 // Return a pixel type on depending on the number of channels
95 int PixelTypeFromChanCount(int ColorChannels
);
97 // ------------------------------------------------------------------------------
99 // Return number of channels of pixel type
100 int ChanCountFromPixelType(int ColorChannels
);
102 #define _lcms_utils_h