本文整理汇总了C++中IsoString::Begin方法的典型用法代码示例。如果您正苦于以下问题:C++ IsoString::Begin方法的具体用法?C++ IsoString::Begin怎么用?C++ IsoString::Begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IsoString
的用法示例。
在下文中一共展示了IsoString::Begin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
bool FileFormatInstance::Open( ImageDescriptionArray& images,
const String& filePath, const IsoString& hints )
{
images.Clear();
if ( (*API->FileFormat->OpenImageFileEx)( handle, filePath.c_str(), hints.c_str(), 0/*flags*/ ) == api_false )
return false;
for ( uint32 i = 0, n = (*API->FileFormat->GetImageCount)( handle ); i < n; ++i )
{
IsoString id;
size_type len = 0;
(*API->FileFormat->GetImageId)( handle, 0, &len, i );
if ( len > 0 )
{
id.SetLength( len );
if ( (*API->FileFormat->GetImageId)( handle, id.Begin(), &len, i ) == api_false )
throw APIFunctionError( "GetImageId" );
id.ResizeToNullTerminated();
}
api_image_info info;
api_image_options options;
if ( (*API->FileFormat->GetImageDescription)( handle, &info, &options, i ) == api_false )
throw APIFunctionError( "GetImageDescription" );
ImageDescription d;
d.id = id;
APIImageInfoToPCL( d.info, info );
APIImageOptionsToPCL( d.options, options );
images.Add( d );
}
return true;
}
示例2: RGBAColor
RGBA RGBAColor( const IsoString& colorName )
{
if ( colorName.StartsWith( '#' ) )
{
size_type n = colorName.Length();
int r, g, b, a;
if ( n == 9 ) // "#RRGGBBAA" format
{
r = HexNibbleValue( colorName.Begin()+1 );
g = HexNibbleValue( colorName.Begin()+3 );
b = HexNibbleValue( colorName.Begin()+5 );
a = HexNibbleValue( colorName.Begin()+7 );
}
else if ( n == 7 ) // "#RRGGBB" format
{
r = HexNibbleValue( colorName.Begin()+1 );
g = HexNibbleValue( colorName.Begin()+3 );
b = HexNibbleValue( colorName.Begin()+5 );
a = 0xFF;
}
else
return 0;
if ( r < 0 || g < 0 || b < 0 || a < 0 )
return 0;
return RGBAColor( r, g, b, a );
}
if ( cssColors.IsEmpty() )
InitCSSColors();
css_color_collection::const_iterator i = cssColors.Search( CSSColor( colorName.c_str(), 0 ) );
return (i != cssColors.End()) ? (*i).value : 0;
}
示例3: Name
IsoString FileFormat::Name() const
{
size_type len = 0;
(*API->FileFormat->GetFileFormatName)( m_data->handle, 0, &len );
IsoString name;
if ( len > 0 )
{
name.SetLength( len );
if ( (*API->FileFormat->GetFileFormatName)( m_data->handle, name.Begin(), &len ) == api_false )
throw APIFunctionError( "GetFileFormatName" );
name.ResizeToNullTerminated();
}
return name;
}
示例4: Id
IsoString ProcessParameter::Id() const
{
size_type len = 0;
(*API->Process->GetParameterIdentifier)( m_data->handle, 0, &len );
IsoString id;
if ( len > 0 )
{
id.SetLength( len );
if ( (*API->Process->GetParameterIdentifier)( m_data->handle, id.Begin(), &len ) == api_false )
throw APIFunctionError( "GetParameterIdentifier" );
id.ResizeToNullTerminated();
}
return id;
}
示例5: Properties
ImagePropertyDescriptionArray FileFormatInstance::Properties()
{
ImagePropertyDescriptionArray properties;
IsoString id;
size_type len = 0;
(*API->FileFormat->EnumerateImageProperties)( handle, 0, 0, &len, 0 ); // 1st call to get max identifier length
if ( len > 0 )
{
id.Reserve( len );
if ( (*API->FileFormat->EnumerateImageProperties)( handle, APIPropertyEnumerationCallback,
id.Begin(), &len, &properties ) == api_false )
throw APIFunctionError( "EnumerateImageProperties" );
}
return properties;
}
示例6: Aliases
IsoStringList ProcessParameter::Aliases() const
{
size_type len = 0;
(*API->Process->GetParameterAliasIdentifiers)( m_data->handle, 0, &len );
IsoStringList aliases;
if ( len > 0 )
{
IsoString csAliases;
csAliases.SetLength( len );
if ( (*API->Process->GetParameterAliasIdentifiers)( m_data->handle, csAliases.Begin(), &len ) == api_false )
throw APIFunctionError( "GetParameterAliasIdentifiers" );
csAliases.ResizeToNullTerminated();
csAliases.Break( aliases, ',' );
}
return aliases;
}
示例7: ReadColorFilterArray
bool FileFormatInstance::ReadColorFilterArray( ColorFilterArray& cfa )
{
try
{
cfa = ColorFilterArray();
if ( (*API->FileFormat->BeginColorFilterArrayExtraction)( handle ) == api_false )
return false;
size_type patternLen = 0, nameLen = 0;
(*API->FileFormat->GetImageColorFilterArray)( handle, 0, &patternLen, 0, 0, 0, &nameLen );
bool ok = true;
if ( patternLen > 0 )
{
IsoString pattern;
pattern.SetLength( patternLen );
String name;
if ( nameLen > 0 )
name.SetLength( nameLen );
int32 width, height;
ok = (*API->FileFormat->GetImageColorFilterArray)( handle,
pattern.Begin(), &patternLen, &width, &height, name.Begin(), &nameLen ) != api_false;
if ( ok )
{
pattern.ResizeToNullTerminated();
name.ResizeToNullTerminated();
cfa = ColorFilterArray( pattern, width, height, name );
}
}
(*API->FileFormat->EndColorFilterArrayExtraction)( handle );
return ok;
}
catch ( ... )
{
(*API->FileFormat->EndColorFilterArrayExtraction)( handle );
throw;
}
}
示例8: EnumerationElements
ProcessParameter::enumeration_element_list ProcessParameter::EnumerationElements() const
{
if ( !IsEnumeration() )
return enumeration_element_list();
size_type count = (*API->Process->GetParameterElementCount)( m_data->handle );
if ( count == 0 )
throw APIFunctionError( "GetParameterElementCount" );
enumeration_element_list elements( count );
for ( size_type i = 0; i < count; ++i )
{
size_type len = 0;
(*API->Process->GetParameterElementIdentifier)( m_data->handle, i, 0, &len );
if ( len == 0 )
throw APIFunctionError( "GetParameterElementIdentifier" );
elements[i].id.SetLength( len );
if ( (*API->Process->GetParameterElementIdentifier)( m_data->handle, i, elements[i].id.Begin(), &len ) == api_false )
throw APIFunctionError( "GetParameterElementIdentifier" );
elements[i].id.ResizeToNullTerminated();
len = 0;
(*API->Process->GetParameterElementAliasIdentifiers)( m_data->handle, i, 0, &len );
if ( len > 0 )
{
IsoString aliases;
aliases.SetLength( len );
if ( (*API->Process->GetParameterElementAliasIdentifiers)( m_data->handle, i, aliases.Begin(), &len ) == api_false )
throw APIFunctionError( "GetParameterElementAliasIdentifiers" );
aliases.ResizeToNullTerminated();
aliases.Break( elements[i].aliases, ',' );
}
elements[i].value = (*API->Process->GetParameterElementValue)( m_data->handle, i );
}
return elements;
}