On Jun 25, 2010, at 12:16:25, [email protected] wrote:
>> What's the new way of doing this:
>>
>> DWORD syz;
>> LPVOID mem = cmsGetMemBasedPointerAndSize(m_lcmsProf, &syz);
>
> ?? I think this function didn't exist on any lcms1 release.
Now I feel really dumb! This is a function I added to the lcms1 source. It
returns the FILEMEM's stream->Block and Size. I'll explain why we need this and
see if there might be some other way to do this. We have c++ class that
contains a cmsHPROFILE. Its copy ctor needs to open a copy of the profile
contained in the "from" instance. In order to do this, we need to know if the
profile is file-based or mem-based. This is how I'm doing this now:
if(((_cmsICCPROFILE*)from.m_lcmsProf)->IOhandler->PhysicalFile[0])
m_lcmsProf =
cmsOpenProfileFromFile(((_cmsICCPROFILE*)from.m_lcmsProf)->IOhandler->PhysicalFile,
"r");
else {
/*DWORD syz;
LPVOID mem = cmsGetMemBasedPointerAndSize(m_lcmsProf,
&syz);*/
FILEMEM* fm =
(FILEMEM*)((_cmsICCPROFILE*)from.m_lcmsProf)->IOhandler->stream;
DWORD syz = fm->Size;
LPVOID mem = fm->Block;
m_lcmsProf = cmsOpenProfileFromMem(mem, syz); // Copies mem to new ptr.
}
Although I can't do this, of course, because FILEMEM is not exposed to the
outside world. Is there some way to open a profile given an existing profile?
Something like:
m_lcmsProf = cmsOpenProfileFromProfile(cmsHPROFILE);
It would inspect its private fields to see if it's file-based, mem-based,
whatever, and open it accordingly.
_________________________________________________________
Steve Mills Me: 952-401-6255
Senior Software Architect MultiAd
[email protected] www.multiad.com
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user