本文整理汇总了C++中ImgFile_Ptr::GetRootLayerGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ ImgFile_Ptr::GetRootLayerGroup方法的具体用法?C++ ImgFile_Ptr::GetRootLayerGroup怎么用?C++ ImgFile_Ptr::GetRootLayerGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImgFile_Ptr
的用法示例。
在下文中一共展示了ImgFile_Ptr::GetRootLayerGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_psd_layer_and_mask
static bool read_psd_layer_and_mask(
FILE* fp,
ImgFile_Ptr pFile,
const PsdHeader* pHeader)
{
uint32_t block_length = read_4byte_BE(fp);
if(block_length > 0){
uint32_t block_start = ftell(fp);
uint32_t block_end = block_start + block_length;
read_4byte_BE(fp);
int16_t layer_num = read_2byte_BE(fp);
if(layer_num <0){
layer_num = -layer_num;
}
if(layer_num > 0){
int i;
//read layer data
PsdLayerData* psd_layers = (PsdLayerData*) malloc(sizeof(PsdLayerData)*layer_num);
memset(psd_layers, 0, sizeof(PsdLayerData)*layer_num);
for(i=0; i<layer_num; i++){
psd_layers[i].depth = pHeader->depth;
if(!read_layer(fp, &psd_layers[i])){
return false;
}
}
//read layer pixel data
ImgLayerGroup_Ptr pRootLayerGroup = pFile->GetRootLayerGroup();
int start_index = 0;
read_psd_layer_group(fp, layer_num, psd_layers, &start_index, pFile, pRootLayerGroup);
free_psd_layer_data(layer_num, psd_layers);
}
long now = ftell(fp);
if(now != block_end){
if(fseek(fp, block_end, SEEK_SET)){
return false;
}
}
}
return true;
}