다음을 통해 공유


IWICDevelopRaw 구현

IWICDevelopRaw

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

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

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

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

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

enum WICRawParameterSet
{
   WICAsShotParameterSet,
   WICUserAdjustedParameterSet,
   WICAutoAdjustedParameterSet
}

GetCurrentParameterSet

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

Set/GetExposureCompensation

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

Set/GetCurrentParameterRGB, Set/GetNamedWhitePoint, Set/GetwhitePointKelvin

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

Set/GetContrast

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

Set/GetGamma

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

Set/GetSharpness

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

Set/GetSaturation

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

Set/GetTint

GetTintSetTint 는 녹색/마젠타 바이어스에 적용할 색조를 나타냅니다. 유효한 범위는 –1.0에서 +1.0으로, 녹색은 눈금의 음수 면에, 양수는 마젠타입니다. 색조 눈금은 색 온도에 대한 직교로 정의됩니다.

Set/GetNoiseReduction

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

SetDestinationColorContext

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

Set/GetToneCurve

GetToneCurveSetToneCurve 는 적용할 톤 곡선을 지정합니다. 점 간의 선형 보간을 가정합니다. pToneCurveWICRawToneCurvePoint 구조체의 배열과 배열의 점 수를 포함하는 WICRawToneCurve 구조체입니다.

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

WICRawToneCurvePoint에는 입력 값과 출력 값이 포함됩니다.

struct WICRawToneCurvePoint 
{
   double Input;
   double Output;
}

호출자가 pToneCurve 매개 변수에서 NULL을 전달하면 pcbActualToneCurveBufferSize 매개 변수에서 WICRawToneCurve에 필요한 크기를 다시 전달해야 합니다.

Set/GetRotation

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

Set/GetRenderMode

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

enum WICRawRenderMode
{
   WICRawRenderModeDraftMode,
   WICRawRenderModeNormalQuality ,
   WICRawRenderModeBestQuality
}

SetNotificationCallback

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 이미징 구성 요소 개요