다음을 통해 공유


IWICDevelopRaw 구현

IWICDevelopRaw

IWICDevelopRaw 인터페이스는 원시 이미지 처리와 관련된 처리 옵션을 노출합니다. 모든 원시 코덱은 IWICDevelopRaw 인터페이스를 지원해야 합니다. 일부 원시 코덱은 이 인터페이스에서 노출되는 모든 설정을 지원하지 못할 수 있지만 코덱이 수행할 수 있는 모든 설정을 지원해야 합니다. 최소한, 모든 원시 코덱은 SetRotationSetRenderMode 메서드를 반드시 구현해야 합니다.

또한 다른 코덱에 대한 선택 사항인 일부 메서드 및 인터페이스는 원시 코덱에 대해 강력하게 권장됩니다. 여기에는 컨테이너 수준 디코더 클래스의 GetPreviewGetThumbnail 메서드, 프레임 수준 디코딩 클래스의 IWICBitmapSourceTransform 인터페이스가 포함됩니다.

IWICDevelopRaw 메서드를 사용하여 설정한 설정은 다른 메타데이터가 유지되는 방식과 일치하는 방식으로 코덱에 의해 유지되어야 하지만 원래 "As Shot" 설정을 덮어쓰지 않아야 합니다. 메타데이터를 지속하고 LoadParameterSet구현하고 GetCurrentParameterSet원시 처리 애플리케이션이 세션 간에 처리 설정을 검색하고 적용할 수 있도록 합니다.

IWICDevelopRaw 인터페이스의 주요 목적은 애플리케이션 개발자가 여러 코덱에서 가능한 한 일관되게 작동하는 원시 매개 변수를 조정하기 위한 사용자 인터페이스를 빌드할 수 있도록 하는 것입니다. 최종 사용자가 매개 변수의 최소 및 최대 범위에 매핑된 최소값과 최대값을 사용하여 슬라이더 컨트롤을 사용하여 매개 변수를 조정한다고 가정합니다. 이를 지원하려면 모든 매개 변수 범위를 선형으로 처리하기 위해 모든 노력을 기울여야 합니다. 슬라이더 컨트롤이 지나치게 민감하지 않도록 하려면 가능한 최대 범위의 50% 이상을 포함하는 각 매개 변수에 대해 가능한 한 광범위한 범위를 지원해야 합니다. 예를 들어 가능한 최대 대비 범위가 순수 회색에서 순수 흑백으로, 기본값이 0.0으로 매핑되는 경우 코덱에서 지원하는 최소 범위는 기본값과 로우 엔드(–1.0)의 순수 회색 사이의 중간 이상에서 하이 엔드(+1.0)의 기본값과 순수 흑백 사이의 절반 이상입니다.

interface IWICDevelopRaw : IWICBitmapFrameDecode
{
   HRESULT QueryRawCapabilitiesInfo ( WICRawCapabilitiesInfo *pInfo );
   HRESULT LoadParameterSet ( WICRawParameterSet ParameterSet );
   HRESULT GetCurrentParameterSet ( IPropertyBag2 **ppCurrentParameterSet );
   HRESULT SetExposureCompensation ( double ev );
   HRESULT GetExposureCompensation ( double *pEV );
   HRESULT SetWhitePointRGB ( UINT Red, UINT Green, UINT Blue );
   HRESULT GetWhitePointRGB ( UINT *pRed, UINT *pGreen, UINT *pBlue );
   HRESULT SetNamedWhitePoint ( WICNamedWhitePoint WhitePoint );
   HRESULT GetNamedWhitePoint ( WICNamedWhitePoint *pWhitePoint );
   HRESULT SetWhitePointKelvin ( UINT WhitePointKelvin );
   HRESULT GetWhitePointKelvin ( UINT *pWhitePointKelvin );
   HRESULT GetKelvinRangeInfo ( UINT *pMinKelvinTemp,
               UINT *pMaxKelvinTemp,
               UINT *pKelvinTempStepValue );
   HRESULT SetContrast ( double Contrast );
   HRESULT GetContrast ( double *pContrast );
   HRESULT SetGamma ( double Gamma );
   HRESULT GetGamma ( double *pGamma );
   HRESULT SetSharpness ( double Sharpness );
   HRESULT GetSharpness ( double *pSharpness );
   HRESULT SetSaturation ( double Saturation );
   HRESULT GetSaturation ( double *pSaturation );
   HRESULT SetTint ( double Tint );
   HRESULT GetTint ( double *pTint );
   HRESULT SetNoiseReduction ( double NoiseReduction );
   HRESULT GetNoiseReduction ( double *pNoiseReduction );
   HRESULT SetDestinationColorContext (const IWICColorContext *pColorContext );
   HRESULT SetToneCurve ( UINT cbToneCurveSize,
               const WICRawToneCurve *pToneCurve );
   HRESULT GetToneCurve ( UINT cbToneCurveBufferSize,
               WICRawToneCurve *pToneCurve,
               UINT *pcbActualToneCurveBufferSize );
   HRESULT SetRotation ( double Rotation );
   HRESULT GetRotation ( double *pRotation );
   HRESULT SetRenderMode ( WICRawRenderMode RenderMode );
   HRESULT GetRenderMode ( WICRawRenderMode *pRenderMode ); 
   HRESULT SetNotificationCallback ( IWICDevelopRawNotificationCallback 
               *pCallback );
}

기본 기능 정보 조회 (QueryRawCapabilitiesInfo)

QueryRawCapabilitiesInfo 이 원시 파일에 대해 지원되는 기능 집합을 반환합니다. WICRawCapabilitiesInfo 구조체는 다음과 같이 정의됩니다.

struct WICRawCapabilitiesInfo
{
   UINT cbSize;
   UINT CodecMajorVersion;
   UINT CodecMinorVersion;
   WICRawCapabilities ExposureCompensationSupport;
   WICRawCapabilities ContrastSupport;
   WICRawCapabilities RGBWhitePointSupport;
   WICRawCapabilities NamedWhitePointSupport;
   UINT NamedWhitePointSupportMask;
   WICRawCapabilities KelvinWhitePointSupport;
   WICRawCapabilities GammaSupport;
   WICRawCapabilities TintSupport;
   WICRawCapabilities SaturationSupport;
   WICRawCapabilities SharpnessSupport;
   WICRawCapabilities NoiseReductionSupport;
   WICRawCapabilities DestinationColorProfileSupport;
   WICRawCapabilities ToneCurveSupport;
   WICRawRotationCapabilities RotationSupport;              
}

이 구조에 사용되는 WICRawCapabilities 열거형은 다음과 같이 정의됩니다.

enum WICRawCapabilities 
{   
   WICRawCapabilityNotSupported,
   WICRawCapabilityGetSupported,
   WICRawCapabilityFullySupported
}

마지막 필드는 다음과 같이 정의된 WICRawRotationCapabilities 열거형입니다.

enum WICRawRotationCapabilities                    
{
   WICRawRotationCapabilityNotSupported,
   WICRawRotationCapabilityGetSupported,
   WICRawRotationCapabilityNinetyDegreesSupported
   WICRawRotationCapabilityFullySupported
}

매개변수 셋 불러오기

LoadParameterSet 사용하면 사용자가 As Shot 설정을 사용할지, 사용자 조정 설정을 사용할지 또는 디코더에 이미지 자동 수정을 요청할지 여부를 지정할 수 있습니다.

enum WICRawParameterSet
{
   WICAsShotParameterSet,
   WICUserAdjustedParameterSet,
   WICAutoAdjustedParameterSet
}

현재매개변수집합가져오기

GetCurrentParameterSet 현재 매개 변수 집합이 있는 IPropertyBag2 반환합니다. 그런 다음 호출자는 인코더 옵션으로 사용할 인코더에 이 매개 변수 집합을 전달할 수 있습니다.

노출 보정 설정/가져오기

GetExposureCompensationSetExposureCompensation 최종 출력에 적용할 노출 보정을 나타냅니다. EV의 유효한 범위는 –5.0~+5.0 스톱입니다.

Set/GetCurrentParameterRGB, Set/GetNamedWhitePoint, Set/GetwhitePointKelvin

이러한 함수는 모두 RGB 값, 미리 설정된 명명된 값 또는 Kelvin 값으로 흰색 점을 가져와서 설정하는 방법을 제공합니다. 켈빈의 허용 범위는 1,500 ~ 30,000입니다.

대비 설정/가져오기

GetContrastSetContrast 은 출력에 적용할 대비의 양을 나타냅니다. 대비를 지정하는 유효한 범위는 –1.0에서 +1.0이며 기본 대비는 0.0입니다.

Set/GetGamma

GetGammaSetGamma는 적용할 감마를 나타냅니다. 감마의 유효한 범위는 0.2에서 5.0이고 1.0은 기본값입니다. 감마는 일반적으로 기존의 감마 전원 함수(Unity 게인을 사용하는 선형 전원 함수)를 사용하여 구현됩니다. 감마가 증가하면 밝기도 증가하고, 감마가 0에 가까워지면 밝기가 감소합니다. (최소값은 0이 아님을 유의하십시오. 왜냐하면 0은 기존 감마 계산에서 0으로 나누기 오류를 발생시키기 때문입니다. 논리적인 최소 한도는 1/최대값이므로, 최소값은 0.2입니다.)

설정/가져오기Sharpness

GetSharpnessSetSharpness 적용할 선명도의 양을 나타냅니다. 유효한 범위는 -1.0 ~+1.0이며, 0.0은 기본 선명도 크기이고 –1.0은 선명하지 않음을 나타냅니다.

설정/채도 가져오기

GetSaturationSetSaturation은 적용할 채도의 양을 나타냅니다. 채도를 지정하는 유효한 범위는 –1.0에서 +1.0이며, 0.0은 일반 채도이고, –1.0은 완전한 소멸을 나타내고, +1.0은 전체 채도를 나타냅니다.

색상 설정/가져오기

GetTintSetTint 녹색/마젠타 바이어스로 적용할 색조를 나타냅니다. 유효한 범위는 –1.0에서 +1.0까지이며, 녹색은 척도의 음수 측에 있고, 마젠타는 양수 측에 있습니다. 색조 눈금은 색 온도에 대해 직각을 이루며 정의됩니다.

설정/가져오기 노이즈 감소

GetNoiseReductionSetNoiseReduction 적용할 노이즈 감소의 양을 나타냅니다. 유효한 범위는 –1.0에서 +1.0으로, 기본 노이즈 감소량을 나타내는 0.0, 노이즈 감소 없음을 나타내는 –1.0, 최대 노이즈 감소를 나타내는 +1.0입니다.

목적지색상컨텍스트설정

SetDestinationColorContext 이미지에 적용할 색 프로필을 지정합니다. GetColorContexts 호출하여 현재 색 프로필을 검색할 수 있습니다.

톤 곡선 설정/가져오기

GetToneCurveSetToneCurve 적용할 톤 곡선을 지정합니다. 점 간의 선형 보간을 가정합니다. pToneCurveWICRawToneCurve 구조체로, WICRawToneCurvePoint 구조의 배열과 배열의 점 수를 포함합니다.

struct WICRawToneCurve 
{
   UINT cPoints;
   WICRawToneCurvePoint aPoints[];
}

WICRawToneCurvePoint 입력 값과 출력 값을 포함합니다.

struct WICRawToneCurvePoint 
{
   double Input;
   double Output;
}

호출자가 NULLpToneCurve 매개 변수로 전달하면, WICRawToneCurve의 필요한 크기를 pcbActualToneCurveBufferSize 매개 변수로 다시 전달해야 합니다.

설정/회전 가져오기

GetRotationSetRotation은 적용할 회전 수준을 나타냅니다. 90.0의 회전은 시계 방향으로 90도 회전을 지정합니다. (SetRotation 사용하고 CopyPixels 메서드를 사용하여 회전을 설정하는 것의 차이점은 SetRotation 사용하는 회전 각도 집합을 코덱에 의해 유지되어야 하며 CopyPixels를 통한 회전을 설정하면 메모리에서만 이미지를 회전할 있다는 것입니다.

Set/GetRenderMode

GetRenderModeSetRenderMode 는 호출자가 요구하는 출력 품질 수준을 나타냅니다. 사용자가 매개 변수를 조정할 때 애플리케이션은 변경 내용이 적용되는 경우 실제 이미지의 모양을 매우 빠르게 표시해야 합니다. 이를 위해 이미지는 일반적으로 실제 이미지 해상도가 아닌 화면 해상도 이하로 표시되어 사용자에게 즉각적인 피드백을 제공합니다. 애플리케이션이 초안 모드 품질을 요청하는 경우이므로 매우 빠릅니다. 사용자가 모든 변경 내용을 적용하고 초안 모드에서 미리 보기한 후 현재 설정으로 전체 이미지를 디코딩하기로 결정하면 애플리케이션은 최고 품질 디코딩을 요청합니다. 일반적으로 인쇄를 위해 요청됩니다. 속도 간의 적절한 절충이 필요한 경우 애플리케이션은 정상 품질을 요청합니다.

enum WICRawRenderMode
{
   WICRawRenderModeDraftMode,
   WICRawRenderModeNormalQuality ,
   WICRawRenderModeBestQuality
}

알림 콜백 설정

SetNotificationCallback 원시 처리 매개 변수가 변경될 때 호출할 디코더에 대한 콜백 함수를 등록합니다. IWICDevelopRawNotificationCallback 서명의 메서드는 Notify하나만 있습니다. Notify 변경된 원시 처리 매개 변수를 나타내는 마스크인 단일 매개 변수가 있습니다.

HRESULT Notify ( UINT NotificationMask );

NotificationMask에 대한 다음 값에 대해 OR 작업이 수행됩니다.

WICRawChangeNotification_ExposureCompensation
WICRawChangeNotification_NamedWhitePoint
WICRawChangeNotification_KelvinWhitePoint
WICRawChangeNotification_RGBWhitePoint
WICRawChangeNotification_Contrast
WICRawChangeNotification_Gamma
WICRawChangeNotification_Sharpness
WICRawChangeNotification_Saturation
WICRawChangeNotification_Tint
WICRawChangeNotification_NoiseReduction
WICRawChangeNotification_DestinationColorContext
WICRawChangeNotification_ToneCurve
WICRawChangeNotification_Rotation
WICRawChangeNotification_RenderMode

참조

IWICDevelopRaw

개념

IWICBitmapSourceTransform 구현

WIC-Enabled 인코더 구현

WIC-Enabled CODEC 작성하는 방법

Windows 이미징 구성 요소 개요