本文整理汇总了C++中View::IsPreview方法的典型用法代码示例。如果您正苦于以下问题:C++ View::IsPreview方法的具体用法?C++ View::IsPreview怎么用?C++ View::IsPreview使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::IsPreview方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CanExecuteOn
bool RGBWorkingSpaceInstance::CanExecuteOn( const View& v, String& whyNot ) const
{
if ( v.IsPreview() )
{
whyNot = "RGBWorkingSpace cannot be executed on previews.";
return false;
}
whyNot.Clear();
return true;
}
示例2: ExecuteOn
bool ChannelCombinationInstance::ExecuteOn( View& view )
{
ImageWindow sourceWindow[ 3 ];
ImageVariant sourceImage[ 3 ];
AutoViewLock lock( view );
ImageVariant image = view.Image();
if ( image.IsComplexSample() )
throw Error( "ChannelCombination cannot be executed on complex images." );
if ( image->ColorSpace() != ColorSpace::RGB )
throw Error( "ChannelCombination requires a RGB color image." );
Console().EnableAbort();
StandardStatus status;
image->SetStatusCallback( &status );
String baseId;
Rect r;
int w0, h0;
if ( view.IsPreview() )
{
ImageWindow w = view.Window();
View mainView = w.MainView();
baseId = mainView.Id();
r = w.PreviewRect( view.Id() );
mainView.GetSize( w0, h0 );
}
else
{
baseId = view.Id();
r = image->Bounds();
w0 = r.Width();
h0 = r.Height();
}
int numberOfSources = 0;
for ( int i = 0; i < 3; ++i )
if ( channelEnabled[i] )
{
String id = channelId[i];
if ( id.IsEmpty() )
id = baseId + '_' + ColorSpaceId::ChannelId( colorSpace, i );
sourceWindow[i] = ImageWindow::WindowById( id );
if ( sourceWindow[i].IsNull() )
throw Error( "ChannelCombination: Source image not found: " + id );
sourceImage[i] = sourceWindow[i].MainView().Image();
if ( !sourceImage[i] )
throw Error( "ChannelCombination: Invalid source image: " + id );
if ( sourceImage[i]->IsColor() )
throw Error( "ChannelCombination: Invalid source color space: " + id );
if ( sourceImage[i]->Width() != w0 || sourceImage[i]->Height() != h0 )
throw Error( "ChannelCombination: Incompatible source image dimensions: " + id );
++numberOfSources;
}
if ( numberOfSources == 0 )
return false;
const char* what = "";
switch ( colorSpace )
{
case ColorSpaceId::RGB:
what = "RGB channels";
break;
case ColorSpaceId::CIEXYZ:
what = "normalized CIE XYZ components";
break;
case ColorSpaceId::CIELab:
what = "normalized CIE L*a*b* components";
break;
case ColorSpaceId::CIELch:
what = "normalized CIE L*c*h* components";
break;
case ColorSpaceId::HSV:
what = "normalized HSV components";
break;
case ColorSpaceId::HSI:
what = "normalized HSI components";
break;
}
image->Status().Initialize( String( "Combining " ) + what, image->NumberOfPixels() );
if ( image.IsFloatSample() )
switch ( image.BitsPerSample() )
{
case 32:
//.........这里部分代码省略.........