⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wcsapiconv.cpp

📁 WDK 自带的xpsdrv filter之 color
💻 CPP
📖 第 1 页 / 共 2 页
字号:
    CWCSApiConv::WcsSetDefaultRenderingIntent

Routine Description:


Arguments:

    scope - management scope for this operation, which could be system wide or for current user.

    dwRenderingIntent - The rendering intent to set.

Return Value:

    BOOL
    If this function succeeds, the return value is TRUE.

--*/
BOOL
CWCSApiConv::WcsSetDefaultRenderingIntent(
    __in WCS_PROFILE_MANAGEMENT_SCOPE scope,
    __in DWORD dwRenderingIntent
    )
{
    BOOL bResult = FALSE;

    if (m_WcsSetDefaultRenderingIntent != NULL)
    {
        bResult = m_WcsSetDefaultRenderingIntent.GetFunc()(scope, dwRenderingIntent);
    }

    return bResult;
}

/*++

Routine Name:

    CWCSApiConv::WcsGetUsePerUserProfiles

Routine Description:


Arguments:

    pDeviceName - The friendly name of the device.

    dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device,
                    CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer.

    pUsePerUserProfiles - Pointer to a location to receive the result.
                          This location receives TRUE if the user has chosen to use a
                          per-user profile association list for the specified device; otherwise FALSE.

Return Value:

    BOOL
    If this function succeeds, the return value is TRUE.

--*/
BOOL
CWCSApiConv::WcsGetUsePerUserProfiles(
    __in LPCWSTR pDeviceName,
    __in DWORD dwDeviceClass,
    __out PBOOL pUsePerUserProfiles
    )
{
    BOOL bResult = FALSE;

    if (m_WcsGetUsePerUserProfiles != NULL)
    {
        bResult = m_WcsGetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, pUsePerUserProfiles);
    }

    return bResult;
}

/*++

Routine Name:

    CWCSApiConv::WcsSetUsePerUserProfiles

Routine Description:


Arguments:

    pDeviceName - The friendly name of the device.

    dwDeviceClass - The class of the device: CLASS_SCANNER for a capture device,
                    CLASS_MONITOR for a display device, or CLASS_PRINTER for a printer.

    usePerUserProfiles - TRUE is the user wishes to use a per-user profile association
                         list for the specified device; otherwise FALSE.

Return Value:

    BOOL
    If this function succeeds, the return value is TRUE.

--*/
BOOL
CWCSApiConv::WcsSetUsePerUserProfiles(
    __in LPCWSTR pDeviceName,
    __in DWORD dwDeviceClass,
    __in BOOL usePerUserProfiles
    )
{
    BOOL bResult = FALSE;

    if (m_WcsSetUsePerUserProfiles != NULL)
    {
        bResult = m_WcsSetUsePerUserProfiles.GetFunc()(pDeviceName, dwDeviceClass, usePerUserProfiles);
    }

    return bResult;
}

/*++

Routine Name:

    CWCSApiConv::WcsTranslateColors

Routine Description:


Arguments:

    hColorTransform - Identifies the WCS color transform to use.

    nColors - Contains the number of elements in the arrays pointed to by pInputData and pOutputData.

    nInputChannels - Contains the number of channels per element in the array pointed to by pInputData

    cdtInput - Specifies the input COLORDATATYPTE.

    cbInput - Contains buffer size of pInputData.

    pInputData - Pointer to array of input colors.

    nOutputChannels - Contains the number of channels per element in the array pointed to by pOutputData.

    cdtOutput - Specifies the output COLORDATATYPTE.

    cbOutput - Contains buffer size of pOutputData.

    pOutputData - Pointer to array of output colors.

Return Value:

    BOOL
    If this function succeeds, the return value is TRUE.

--*/
BOOL
CWCSApiConv::WcsTranslateColors(
    __in HTRANSFORM hColorTransform,
    __in DWORD nColors,
    __in DWORD nInputChannels,
    __in COLORDATATYPE cdtInput,
    __in DWORD cbInput,
    __in_bcount(cbInput) PVOID pInputData,
    __in DWORD nOutputChannels,
    __in COLORDATATYPE cdtOutput,
    __in DWORD cbOutput,
    __out_bcount(cbOutput) PVOID pOutputData
    )
{
    BOOL bResult = FALSE;

    if (m_WcsTranslateColors != NULL)
    {
        bResult = m_WcsTranslateColors.GetFunc()(hColorTransform,
                                                 nColors,
                                                 nInputChannels,
                                                 cdtInput,
                                                 cbInput,
                                                 pInputData,
                                                 nOutputChannels,
                                                 cdtOutput,
                                                 cbOutput,
                                                 pOutputData);
    }

    return bResult;
}

/*++

Routine Name:

    CWCSApiConv::WCSCheckColors

Routine Description:


Arguments:

    hColorTransform - Identifies the WCS color transform to use.

    nColors - Contains the number of elements in the arrays pointed to by pInputData and pResult.

    nInputChannels - Contains the number of channels per element in the array pointed to by pInputData

    cdtInput - Specifies the input COLORDATATYPTE.

    cbInput - Contains buffer size of pInputData.

    pInputData - Pointer to array of input colors.

    pResult - Pointer to array of nColor results of the test.

Return Value:

    BOOL
    If this function succeeds, the return value is TRUE.

--*/
BOOL
CWCSApiConv::WCSCheckColors(
    __in HTRANSFORM hColorTransform,
    __in DWORD nColors,
    __in DWORD nInputChannels,
    __in COLORDATATYPE cdtInput,
    __in DWORD cbInput,
    __in_bcount(cbInput) PVOID pInputData,
    __out_bcount(nColors)PBYTE pResult
)
{
    BOOL bResult = FALSE;

    if (m_WcsCheckColors != NULL)
    {
        bResult = m_WcsCheckColors.GetFunc()(hColorTransform,
                                             nColors,
                                             nInputChannels,
                                             cdtInput,
                                             cbInput,
                                             pInputData,
                                             pResult);
    }

    return bResult;
}

/*++

Routine Name:

    CWCSApiConv::WcsOpenColorProfileA

Routine Description:


Arguments:

    pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile.

    pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile.
                   If this parameter is NULL, then the standard default CAMP is used.

    pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile.
                   If this parameter is NULL, then the standard default GMMP is used.

    dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values.

    dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file.
                  A value of zero prevents the profile from being shared at all.

    dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file.


Return Value:

    HPROFILE - Handle to the opened color profile

--*/
HPROFILE
CWCSApiConv::WcsOpenColorProfileA(
    __in        PPROFILE pCDMPProfile,
    __in_opt    PPROFILE pCAMPProfile,
    __in_opt    PPROFILE pGMMPProfile,
    __in        DWORD    dwDesireAccess,
    __in        DWORD    dwShareMode,
    __in        DWORD    dwCreationMode,
    __in        DWORD    dwFlags
    )
{
    HPROFILE hProfile = NULL;

    if (m_WcsOpenColorProfileA != NULL)
    {
        hProfile = m_WcsOpenColorProfileA.GetFunc()(pCDMPProfile,
                                                    pCAMPProfile,
                                                    pGMMPProfile,
                                                    dwDesireAccess,
                                                    dwShareMode,
                                                    dwCreationMode,
                                                    dwFlags);
    }

    return hProfile;
}

/*++

Routine Name:

    CWCSApiConv::WcsOpenColorProfileW

Routine Description:


Arguments:

    pCDMPProfile - Pointer to a WCS DMP or an ICC color profile structure specifying the profile.

    pCAMPProfile - Pointer to a WCS CAMP color profile structure specifying the profile.
                   If this parameter is NULL, then the standard default CAMP is used.

    pGMMPProfile - Pointer to a WCS GMMP color profile structure specifying the profile.
                   If this parameter is NULL, then the standard default GMMP is used.

    dwDesireAccess - Specifies how to access the given profile. This parameter must take one the following constant values.

    dwShareMode - Specifies how the profile should be shared, if the profile is contained in a file.
                  A value of zero prevents the profile from being shared at all.

    dwCreationMode - Specifies which actions to take on the profile while opening it, if it is contained in a file.


Return Value:

    HPROFILE - Handle to the opened color profile

--*/
HPROFILE
CWCSApiConv::WcsOpenColorProfileW(
    __in        PPROFILE pCDMPProfile,
    __in_opt    PPROFILE pCAMPProfile,
    __in_opt    PPROFILE pGMMPProfile,
    __in        DWORD    dwDesireAccess,
    __in        DWORD    dwShareMode,
    __in        DWORD    dwCreationMode,
    __in        DWORD    dwFlags
    )
{
    HPROFILE hProfile = NULL;

    if (m_WcsOpenColorProfileW != NULL)
    {
        hProfile = m_WcsOpenColorProfileW.GetFunc()(pCDMPProfile,
                                                    pCAMPProfile,
                                                    pGMMPProfile,
                                                    dwDesireAccess,
                                                    dwShareMode,
                                                    dwCreationMode,
                                                    dwFlags);
    }

    return hProfile;
}

/*++

Routine Name:

    CWCSApiConv::WcsCreateIccProfile

Routine Description:


Arguments:

    hWcsProfile - handle to a  WCS profile which contains a combination
                  of a WCS DMP, and optionally a CAMP and/or GMMP.

    dwOptions   - Options flag values from WCS_DEFAULT and WCS_ICCONLY

Return Value:

    HPROFILE - Handle to the newly created color profile

--*/
HPROFILE
CWCSApiConv::WcsCreateIccProfile(
    __in HPROFILE hWcsProfile,
    __in DWORD dwOptions
    )
{
    HPROFILE hProfile = NULL;

    if (m_WcsCreateIccProfile != NULL)
    {
        hProfile = m_WcsCreateIccProfile.GetFunc()(hWcsProfile, dwOptions);
    }

    return hProfile;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -