Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9db71b35
Commit
9db71b35
authored
Nov 21, 2004
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement and test GetColorProfileElementTag,
GetCountColorProfileElements and IsColorProfileTagPresent. Stub GetStandardColorSpaceProfile{A,W}.
parent
c590a66f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
232 additions
and
9 deletions
+232
-9
lcms_api.h
dlls/mscms/lcms_api.h
+2
-0
mscms.spec
dlls/mscms/mscms.spec
+5
-5
mscms_main.c
dlls/mscms/mscms_main.c
+1
-0
profile.c
dlls/mscms/profile.c
+135
-3
profile.c
dlls/mscms/tests/profile.c
+82
-1
icm.h
include/icm.h
+7
-0
No files found.
dlls/mscms/lcms_api.h
View file @
9db71b35
...
...
@@ -27,11 +27,13 @@
#ifdef HAVE_LCMS_H
LCMS_API_FUNCTION
(
cmsCloseProfile
)
LCMS_API_FUNCTION
(
cmsIsTag
)
LCMS_API_FUNCTION
(
cmsOpenProfileFromFile
)
LCMS_API_FUNCTION
(
cmsOpenProfileFromMem
)
#ifndef LCMS_API_NO_REDEFINE
#define cmsCloseProfile pcmsCloseProfile
#define cmsIsTag pcmsIsTag
#define cmsOpenProfileFromFile pcmsOpenProfileFromFile
#define cmsOpenProfileFromMem pcmsOpenProfileFromMem
#endif
/* LCMS_API_NO_REDEFINE */
...
...
dlls/mscms/mscms.spec
View file @
9db71b35
...
...
@@ -21,16 +21,16 @@
@ stdcall GetColorDirectoryA(ptr ptr long)
@ stdcall GetColorDirectoryW(ptr ptr long)
@ stub GetColorProfileElement
@ st
ub GetColorProfileElementTag
@ st
dcall GetColorProfileElementTag(ptr long ptr)
@ stub GetColorProfileFromHandle
@ stub GetColorProfileHeader
@ st
ub GetCountColorProfileElements
@ st
dcall GetCountColorProfileElements(ptr long)
@ stub GetNamedProfileInfo
@ stub GetPS2ColorRenderingDictionary
@ stub GetPS2ColorRenderingIntent
@ stub GetPS2ColorSpaceArray
@ st
ub GetStandardColorSpaceProfileA
@ st
ub GetStandardColorSpaceProfileW
@ st
dcall GetStandardColorSpaceProfileA(ptr long ptr ptr)
@ st
dcall GetStandardColorSpaceProfileW(ptr long ptr ptr)
@ stdcall InstallColorProfileA(ptr ptr)
@ stdcall InstallColorProfileW(ptr ptr)
@ stub InternalGetDeviceConfig
...
...
@@ -39,7 +39,7 @@
@ stub InternalGetPS2ColorSpaceArray
@ stub InternalGetPS2PreviewCRD
@ stub InternalSetDeviceConfig
@ st
ub IsColorProfileTagPresent
@ st
dcall IsColorProfileTagPresent(ptr long ptr)
@ stdcall IsColorProfileValid(ptr long)
@ stdcall OpenColorProfileA(ptr long long long)
@ stdcall OpenColorProfileW(ptr long long long)
...
...
dlls/mscms/mscms_main.c
View file @
9db71b35
...
...
@@ -73,6 +73,7 @@ static BOOL MSCMS_init_lcms()
goto sym_not_found;
LOAD_FUNCPTR
(
cmsCloseProfile
);
LOAD_FUNCPTR
(
cmsIsTag
);
LOAD_FUNCPTR
(
cmsOpenProfileFromFile
);
LOAD_FUNCPTR
(
cmsOpenProfileFromMem
);
#undef LOAD_FUNCPTR
...
...
dlls/mscms/profile.c
View file @
9db71b35
...
...
@@ -67,7 +67,7 @@ BOOL WINAPI GetColorDirectoryA( PCSTR machine, PSTR buffer, PDWORD size )
if
(
bufferW
)
{
ret
=
GetColorDirectoryW
(
NULL
,
bufferW
,
&
sizeW
);
*
size
=
sizeW
/
sizeof
(
WCHAR
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
ret
)
{
...
...
@@ -118,6 +118,110 @@ BOOL WINAPI GetColorDirectoryW( PCWSTR machine, PWSTR buffer, PDWORD size )
}
/******************************************************************************
* GetColorProfileElementTag [MSCMS.@]
*
* Get a tag name from a color profile by index.
*
* PARAMS
* profile [I] Handle to a color profile.
* index [I] Index into the tag table of the color profile.
* tag [O] Pointer to a TAGTYPE variable.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* The tag table index starts at 1.
* Use GetCountColorProfileElements to retrieve a count of tagged elements.
*/
BOOL
WINAPI
GetColorProfileElementTag
(
HPROFILE
profile
,
DWORD
index
,
PTAGTYPE
tag
)
{
BOOL
ret
=
FALSE
;
#ifdef HAVE_LCMS_H
LCMSICCPROFILE
*
cmsprofile
=
(
LCMSICCPROFILE
*
)
MSCMS_hprofile2cmsprofile
(
profile
);
TRACE
(
"( %p, %ld, %p )
\n
"
,
profile
,
index
,
tag
);
if
(
cmsprofile
)
{
*
tag
=
cmsprofile
->
TagNames
[
index
-
1
];
ret
=
TRUE
;
}
#endif
/* HAVE_LCMS_H */
return
ret
;
}
/******************************************************************************
* GetCountColorProfileElements [MSCMS.@]
*
* Retrieve the number of elements in a color profile.
*
* PARAMS
* profile [I] Handle to a color profile.
* count [O] Pointer to a variable which is set to the number of elements
* in the color profile.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
WINAPI
GetCountColorProfileElements
(
HPROFILE
profile
,
PDWORD
count
)
{
BOOL
ret
=
FALSE
;
#ifdef HAVE_LCMS_H
LCMSICCPROFILE
*
cmsprofile
=
(
LCMSICCPROFILE
*
)
MSCMS_hprofile2cmsprofile
(
profile
);
TRACE
(
"( %p, %p )
\n
"
,
profile
,
count
);
if
(
cmsprofile
)
{
*
count
=
cmsprofile
->
TagCount
;
ret
=
TRUE
;
}
#endif
/* HAVE_LCMS_H */
return
ret
;
}
BOOL
WINAPI
GetStandardColorSpaceProfileA
(
PCSTR
machine
,
DWORD
id
,
PSTR
profile
,
PDWORD
size
)
{
INT
len
;
LPWSTR
profileW
;
BOOL
ret
=
FALSE
;
DWORD
sizeW
=
*
size
*
sizeof
(
WCHAR
);
TRACE
(
"( 0x%08lx, %p, %ld )
\n
"
,
id
,
profile
,
*
size
);
if
(
machine
||
!
profile
)
return
FALSE
;
profileW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeW
);
if
(
profileW
)
{
ret
=
GetStandardColorSpaceProfileW
(
NULL
,
id
,
profileW
,
&
sizeW
);
*
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
ret
)
{
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
profileW
,
*
size
,
profile
,
*
size
,
NULL
,
NULL
);
if
(
!
len
)
ret
=
FALSE
;
}
HeapFree
(
GetProcessHeap
(),
0
,
profileW
);
}
return
ret
;
}
BOOL
WINAPI
GetStandardColorSpaceProfileW
(
PCWSTR
machine
,
DWORD
id
,
PWSTR
profile
,
PDWORD
size
)
{
FIXME
(
"( %lx, %p, %ld ) stub
\n
"
,
id
,
profile
,
*
size
);
return
FALSE
;
}
/******************************************************************************
* InstallColorProfileA [MSCMS.@]
*
* See InstallColorProfileW.
...
...
@@ -183,6 +287,34 @@ BOOL WINAPI InstallColorProfileW( PCWSTR machine, PCWSTR profile )
}
/******************************************************************************
* IsColorProfileTagPresent [MSCMS.@]
*
* Determine if a given ICC tag is present in a color profile.
*
* PARAMS
* profile [I] Color profile handle.
* tag [I] ICC tag.
* present [O] Pointer to a BOOL variable. Set to TRUE if tag is present,
* FALSE otherwise.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL
WINAPI
IsColorProfileTagPresent
(
HPROFILE
profile
,
TAGTYPE
tag
,
PBOOL
present
)
{
BOOL
ret
=
FALSE
;
TRACE
(
"( %p, 0x%08lx, %p )
\n
"
,
profile
,
tag
,
present
);
#ifdef HAVE_LCMS_H
ret
=
cmsIsTag
(
MSCMS_hprofile2cmsprofile
(
profile
),
tag
);
#endif
/* HAVE_LCMS_H */
return
*
present
=
ret
;
}
/******************************************************************************
* IsColorProfileValid [MSCMS.@]
*
* Determine if a given color profile is valid.
...
...
@@ -268,7 +400,7 @@ HPROFILE WINAPI OpenColorProfileA( PPROFILE profile, DWORD access, DWORD sharing
{
HPROFILE
handle
=
NULL
;
TRACE
(
"( %p,
%lx, %lx, %
lx )
\n
"
,
profile
,
access
,
sharing
,
creation
);
TRACE
(
"( %p,
0x%08lx, 0x%08lx, 0x%08
lx )
\n
"
,
profile
,
access
,
sharing
,
creation
);
if
(
!
profile
||
!
profile
->
pProfileData
)
return
NULL
;
...
...
@@ -325,7 +457,7 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
cmsHPROFILE
cmsprofile
=
NULL
;
HANDLE
handle
=
NULL
;
TRACE
(
"( %p,
%lx, %lx, %
lx )
\n
"
,
profile
,
access
,
sharing
,
creation
);
TRACE
(
"( %p,
0x%08lx, 0x%08lx, 0x%08
lx )
\n
"
,
profile
,
access
,
sharing
,
creation
);
if
(
!
profile
||
!
profile
->
pProfileData
)
return
NULL
;
...
...
dlls/mscms/tests/profile.c
View file @
9db71b35
...
...
@@ -144,6 +144,53 @@ static void test_GetColorDirectoryW()
ok
(
ret
,
"GetColorDirectoryW() failed (%ld)
\n
"
,
GetLastError
()
);
}
static
void
test_GetColorProfileElementTag
()
{
if
(
standardprofile
)
{
PROFILE
profile
;
HPROFILE
handle
;
BOOL
ret
;
DWORD
index
=
1
;
TAGTYPE
tag
,
expect
=
0x63707274
;
/* 'cprt' */
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
standardprofile
;
profile
.
cbDataSize
=
strlen
(
standardprofile
);
handle
=
OpenColorProfileA
(
&
profile
,
PROFILE_READ
,
0
,
OPEN_EXISTING
);
ok
(
handle
!=
NULL
,
"OpenColorProfileA() failed (%ld)
\n
"
,
GetLastError
()
);
ret
=
GetColorProfileElementTag
(
handle
,
index
,
&
tag
);
ok
(
ret
&&
tag
==
expect
,
"GetColorProfileElementTag() failed (%ld)
\n
"
,
GetLastError
()
);
CloseColorProfile
(
handle
);
}
}
static
void
test_GetCountColorProfileElements
()
{
if
(
standardprofile
)
{
PROFILE
profile
;
HPROFILE
handle
;
BOOL
ret
;
DWORD
count
,
expect
=
17
;
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
standardprofile
;
profile
.
cbDataSize
=
strlen
(
standardprofile
);
handle
=
OpenColorProfileA
(
&
profile
,
PROFILE_READ
,
0
,
OPEN_EXISTING
);
ok
(
handle
!=
NULL
,
"OpenColorProfileA() failed (%ld)
\n
"
,
GetLastError
()
);
ret
=
GetCountColorProfileElements
(
handle
,
&
count
);
ok
(
ret
&&
count
==
expect
,
"GetCountColorProfileElements() failed (%ld)
\n
"
,
GetLastError
()
);
CloseColorProfile
(
handle
);
}
}
static
void
test_InstallColorProfileA
()
{
BOOL
ret
;
...
...
@@ -246,6 +293,36 @@ static void test_InstallColorProfileW()
}
}
static
void
test_IsColorProfileTagPresent
()
{
if
(
standardprofile
)
{
PROFILE
profile
;
HPROFILE
handle
;
BOOL
ret
,
present
;
TAGTYPE
tag
;
profile
.
dwType
=
PROFILE_FILENAME
;
profile
.
pProfileData
=
standardprofile
;
profile
.
cbDataSize
=
strlen
(
standardprofile
);
handle
=
OpenColorProfileA
(
&
profile
,
PROFILE_READ
,
0
,
OPEN_EXISTING
);
ok
(
handle
!=
NULL
,
"OpenColorProfileA() failed (%ld)
\n
"
,
GetLastError
()
);
tag
=
0
;
ret
=
IsColorProfileTagPresent
(
handle
,
tag
,
&
present
);
ok
(
!
(
ret
&&
present
),
"IsColorProfileTagPresent() succeeded (%ld)
\n
"
,
GetLastError
()
);
tag
=
0x63707274
;
/* 'cprt' */
ret
=
IsColorProfileTagPresent
(
handle
,
tag
,
&
present
);
ok
(
ret
&&
present
,
"IsColorProfileTagPresent() failed (%ld)
\n
"
,
GetLastError
()
);
CloseColorProfile
(
handle
);
}
}
static
void
test_OpenColorProfileA
()
{
PROFILE
profile
;
...
...
@@ -459,7 +536,6 @@ START_TEST(profile)
{
if
(
CopyFileA
(
standardprofile
,
file
,
FALSE
))
{
testprofile
=
(
LPSTR
)
&
file
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
testprofile
,
-
1
,
NULL
,
0
);
...
...
@@ -473,9 +549,14 @@ START_TEST(profile)
test_GetColorDirectoryA
();
test_GetColorDirectoryW
();
test_GetColorProfileElementTag
();
test_GetCountColorProfileElements
();
test_InstallColorProfileA
();
test_InstallColorProfileW
();
test_IsColorProfileTagPresent
();
test_OpenColorProfileA
();
test_OpenColorProfileW
();
...
...
include/icm.h
View file @
9db71b35
...
...
@@ -158,9 +158,16 @@ BOOL WINAPI CloseColorProfile(HPROFILE);
BOOL
WINAPI
GetColorDirectoryA
(
PCSTR
,
PSTR
,
PDWORD
);
BOOL
WINAPI
GetColorDirectoryW
(
PCWSTR
,
PWSTR
,
PDWORD
);
#define GetColorDirectory WINELIB_NAME_AW(GetColorDirectory)
BOOL
WINAPI
GetColorProfileElement
(
HPROFILE
,
TAGTYPE
,
DWORD
,
PDWORD
,
PVOID
,
PBOOL
);
BOOL
WINAPI
GetColorProfileElementTag
(
HPROFILE
,
DWORD
,
PTAGTYPE
);
BOOL
WINAPI
GetCountColorProfileElements
(
HPROFILE
,
PDWORD
);
BOOL
WINAPI
GetStandardColorSpaceProfileA
(
PCSTR
,
DWORD
,
PSTR
,
PDWORD
);
BOOL
WINAPI
GetStandardColorSpaceProfileW
(
PCWSTR
,
DWORD
,
PWSTR
,
PDWORD
);
#define GetStandardColorSpaceProfile WINELIB_NAME_AW(GetStandardColorSpaceProfile)
BOOL
WINAPI
InstallColorProfileA
(
PCSTR
,
PCSTR
);
BOOL
WINAPI
InstallColorProfileW
(
PCWSTR
,
PCWSTR
);
#define InstallColorProfile WINELIB_NAME_AW(InstallColorProfile)
BOOL
WINAPI
IsColorProfileTagPresent
(
HPROFILE
,
TAGTYPE
,
PBOOL
);
BOOL
WINAPI
IsColorProfileValid
(
HPROFILE
,
PBOOL
);
HPROFILE
WINAPI
OpenColorProfileA
(
PPROFILE
,
DWORD
,
DWORD
,
DWORD
);
HPROFILE
WINAPI
OpenColorProfileW
(
PPROFILE
,
DWORD
,
DWORD
,
DWORD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment