?? libmng_prop_xs.c
字號:
#ifdef MNG_SUPPORT_DISPLAY
mng_retcode MNG_DECL mng_set_srgb (mng_handle hHandle,
mng_bool bIssRGB)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGB, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->bIssRGB = bIssRGB;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGB, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif /* MNG_SUPPORT_DISPLAY */
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
#ifndef MNG_SKIPCHUNK_iCCP
mng_retcode MNG_DECL mng_set_outputprofile (mng_handle hHandle,
mng_pchar zFilename)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf2) /* previously defined ? */
mnglcms_freeprofile (pData->hProf2);
/* allocate new CMS profile handle */
pData->hProf2 = mnglcms_createfileprofile (zFilename);
if (!pData->hProf2) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
#endif /* MNG_SUPPORT_DISPLAY */
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
#ifndef MNG_SKIPCHUNK_iCCP
mng_retcode MNG_DECL mng_set_outputprofile2 (mng_handle hHandle,
mng_uint32 iProfilesize,
mng_ptr pProfile)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE2, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf2) /* previously defined ? */
mnglcms_freeprofile (pData->hProf2);
/* allocate new CMS profile handle */
pData->hProf2 = mnglcms_creatememprofile (iProfilesize, pProfile);
if (!pData->hProf2) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTPROFILE2, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
#endif /* MNG_SUPPORT_DISPLAY */
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_outputsrgb (mng_handle hHandle)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTSRGB, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf2) /* previously defined ? */
mnglcms_freeprofile (pData->hProf2);
/* allocate new CMS profile handle */
pData->hProf2 = mnglcms_createsrgbprofile ();
if (!pData->hProf2) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_OUTPUTSRGB, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_retcode MNG_DECL mng_set_srgbprofile (mng_handle hHandle,
mng_pchar zFilename)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE2, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf3) /* previously defined ? */
mnglcms_freeprofile (pData->hProf3);
/* allocate new CMS profile handle */
pData->hProf3 = mnglcms_createfileprofile (zFilename);
if (!pData->hProf3) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE2, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif /* MNG_SUPPORT_DISPLAY */
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_retcode MNG_DECL mng_set_srgbprofile2 (mng_handle hHandle,
mng_uint32 iProfilesize,
mng_ptr pProfile)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf3) /* previously defined ? */
mnglcms_freeprofile (pData->hProf3);
/* allocate new CMS profile handle */
pData->hProf3 = mnglcms_creatememprofile (iProfilesize, pProfile);
if (!pData->hProf3) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBPROFILE, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif /* MNG_SUPPORT_DISPLAY */
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_srgbimplicit (mng_handle hHandle)
{
#ifdef MNG_INCLUDE_LCMS
mng_datap pData;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBIMPLICIT, MNG_LC_START)
#endif
#ifdef MNG_INCLUDE_LCMS
MNG_VALIDHANDLE (hHandle)
pData = (mng_datap)hHandle; /* address the structure */
if (pData->hProf3) /* previously defined ? */
mnglcms_freeprofile (pData->hProf3);
/* allocate new CMS profile handle */
pData->hProf3 = mnglcms_createsrgbprofile ();
if (!pData->hProf3) /* handle error ? */
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE)
#endif /* MNG_INCLUDE_LCMS */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_SRGBIMPLICIT, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY) || defined(MNG_APP_CMS)
mng_retcode MNG_DECL mng_set_viewgamma (mng_handle hHandle,
mng_float dGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dViewgamma = dGamma;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_displaygamma (mng_handle hHandle,
mng_float dGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dDisplaygamma = dGamma;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_dfltimggamma (mng_handle hHandle,
mng_float dGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dDfltimggamma = dGamma;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY) || defined(MNG_APP_CMS)
mng_retcode MNG_DECL mng_set_viewgammaint (mng_handle hHandle,
mng_uint32 iGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dViewgamma = (mng_float)iGamma / 100000;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_VIEWGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_displaygammaint (mng_handle hHandle,
mng_uint32 iGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dDisplaygamma = (mng_float)iGamma / 100000;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DISPLAYGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#ifndef MNG_NO_DFLT_INFO
mng_retcode MNG_DECL mng_set_dfltimggammaint (mng_handle hHandle,
mng_uint32 iGamma)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->dDfltimggamma = (mng_float)iGamma / 100000;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DFLTIMGGAMMA, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIP_MAXCANVAS
mng_retcode MNG_DECL mng_set_maxcanvaswidth (mng_handle hHandle,
mng_uint32 iMaxwidth)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASWIDTH, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->iMaxwidth = iMaxwidth;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASWIDTH, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_maxcanvasheight (mng_handle hHandle,
mng_uint32 iMaxheight)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASHEIGHT, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->iMaxheight = iMaxheight;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASHEIGHT, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_maxcanvassize (mng_handle hHandle,
mng_uint32 iMaxwidth,
mng_uint32 iMaxheight)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASSIZE, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->iMaxwidth = iMaxwidth;
((mng_datap)hHandle)->iMaxheight = iMaxheight;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_MAXCANVASSIZE, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
#ifdef MNG_INCLUDE_ZLIB
#ifdef MNG_ACCESS_ZLIB
mng_retcode MNG_DECL mng_set_zlib_level (mng_handle hHandle,
mng_int32 iZlevel)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_ZLIB_LEVEL, MNG_LC_START)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -