Lines Matching refs:layer_info
362 static MagickBooleanType CorrectPSDOpacity(LayerInfo *layer_info,
371 if (layer_info->opacity == OpaqueAlpha)
374 layer_info->image->alpha_trait=BlendPixelTrait;
378 magick_threads(layer_info->image,layer_info->image,layer_info->image->rows,1)
380 for (y=0; y < (ssize_t) layer_info->image->rows; y++)
390 q=GetAuthenticPixels(layer_info->image,0,y,layer_info->image->columns,1,
397 for (x=0; x < (ssize_t) layer_info->image->columns; x++)
399 SetPixelAlpha(layer_info->image,(Quantum) (QuantumScale*(GetPixelAlpha(
400 layer_info->image,q))*layer_info->opacity),q);
401 q+=GetPixelChannels(layer_info->image);
403 if (SyncAuthenticPixels(layer_info->image,exception) == MagickFalse)
540 static inline LayerInfo *DestroyLayerInfo(LayerInfo *layer_info,
548 if (layer_info[i].image != (Image *) NULL)
549 layer_info[i].image=DestroyImage(layer_info[i].image);
550 if (layer_info[i].mask.image != (Image *) NULL)
551 layer_info[i].mask.image=DestroyImage(layer_info[i].mask.image);
554 return (LayerInfo *) RelinquishMagickMemory(layer_info);
1161 LayerInfo* layer_info,const size_t channel,
1176 if (layer_info->channel_info[channel].type < -1)
1182 if (layer_info->channel_info[channel].type != -2 ||
1183 (layer_infolayer_info->mask.flags & 0x02))
1185 SeekBlob(image,layer_info->channel_info[channel].size-2,SEEK_CUR);
1188 mask=CloneImage(image,layer_info->mask.page.width,
1189 layer_info->mask.page.height,MagickFalse,exception);
1200 layer_info->channel_info[channel].type,exception);
1212 layer_info->channel_info[channel].type,offsets,exception);
1219 status=ReadPSDChannelZip(channel_image,layer_info->channels,
1220 layer_info->channel_info[channel].type,compression,
1221 layer_info->channel_info[channel].size-2,exception);
1234 SeekBlob(image,offset+layer_info->channel_info[channel].size-2,SEEK_SET);
1249 layer_info->mask.image=CloneImage(image,image->columns,image->rows,
1251 layer_info->mask.image->alpha_trait=UndefinedPixelTrait;
1252 GetPixelInfo(layer_info->mask.image,&color);
1253 color.red=layer_info->mask.background == 0 ? 0 : QuantumRange;
1254 SetImageColor(layer_info->mask.image,&color,exception);
1255 (void) CompositeImage(layer_info->mask.image,mask,OverCompositeOp,
1256 MagickTrue,layer_info->mask.page.x,layer_info->mask.page.y,
1266 LayerInfo* layer_info,ExceptionInfo *exception)
1283 (void) SetImageBackgroundColor(layer_info->image,exception);
1284 layer_info->image->compose=PSDBlendModeToCompositeOperator(
1285 layer_info->blendkey);
1286 if (layer_info->visible == MagickFalse)
1287 layer_info->image->compose=NoCompositeOp;
1289 SetImageColorspace(layer_info->image,CMYKColorspace,exception);
1292 SetImageColorspace(layer_info->image,GRAYColorspace,exception);
1297 (double) layer_info->page.x);
1298 (void) SetImageArtifact(layer_info->image,"psd:layer.x",message);
1300 (double) layer_info->page.y);
1301 (void) SetImageArtifact(layer_info->image,"psd:layer.y",message);
1303 layer_info->opacity);
1304 (void) SetImageArtifact(layer_info->image,"psd:layer.opacity",message);
1305 (void) SetImageProperty(layer_info->image,"label",(char *) layer_info->name,
1309 for (j=0; j < (ssize_t) layer_info->channels; j++)
1315 compression=(PSDCompressionType) ReadBlobShort(layer_info->image);
1316 layer_info->image->compression=ConvertPSDCompression(compression);
1317 if (layer_info->channel_info[j].type == -1)
1318 layer_info->image->alpha_trait=BlendPixelTrait;
1320 status=ReadPSDChannel(layer_info->image,psd_info,layer_info,j,
1328 status=CorrectPSDOpacity(layer_info,exception);
1331 (layer_info->image->colorspace == CMYKColorspace))
1332 status=NegateCMYK(layer_info->image,exception);
1334 if ((status != MagickFalse) && (layer_info->mask.image != (Image *) NULL))
1336 status=CompositeImage(layer_info->image,layer_info->mask.image,
1338 layer_info->mask.image=DestroyImage(layer_info->mask.image);
1352 *layer_info;
1393 layer_info=(LayerInfo *) NULL;
1423 layer_info=(LayerInfo *) AcquireQuantumMemory((size_t) number_layers,
1424 sizeof(*layer_info));
1425 if (layer_info == (LayerInfo *) NULL)
1433 (void) ResetMagickMemory(layer_info,0,(size_t) number_layers*
1434 sizeof(*layer_info));
1445 layer_info[i].page.y=ReadBlobSignedLong(image);
1446 layer_info[i].page.x=ReadBlobSignedLong(image);
1449 layer_info[i].page.width=(size_t) (x-layer_info[i].page.x);
1450 layer_info[i].page.height=(size_t) (y-layer_info[i].page.y);
1451 layer_info[i].channels=ReadBlobShort(image);
1452 if (layer_info[i].channels > MaxPSDChannels)
1454 layer_info=DestroyLayerInfo(layer_info,number_layers);
1461 (double) layer_info[i].page.x,(double) layer_info[i].page.y,
1462 (double) layer_info[i].page.height,(double)
1463 layer_info[i].page.width,(double) layer_info[i].channels);
1464 for (j=0; j < (ssize_t) layer_info[i].channels; j++)
1466 layer_info[i].channel_info[j].type=(short) ReadBlobShort(image);
1467 layer_info[i].channel_info[j].size=(size_t) GetPSDSize(psd_info,
1472 (double) layer_info[i].channel_info[j].type,
1473 (double) layer_info[i].channel_info[j].size);
1482 layer_info=DestroyLayerInfo(layer_info,number_layers);
1486 count=ReadBlob(image,4,(unsigned char *) layer_info[i].blendkey);
1487 ReversePSDString(image,layer_info[i].blendkey,4);
1488 layer_info[i].opacity=(Quantum) ScaleCharToQuantum((unsigned char)
1490 layer_info[i].clipping=(unsigned char) ReadBlobByte(image);
1491 layer_info[i].flags=(unsigned char) ReadBlobByte(image);
1492 layer_info[i].visible=!(layer_info[i].flags & 0x02);
1496 layer_info[i].blendkey,(double) layer_info[i].opacity,
1497 layer_info[i].clipping ? "true" : "false",layer_info[i].flags,
1498 layer_info[i].visible ? "true" : "false");
1518 layer_info[i].mask.page.y=ReadBlobSignedLong(image);
1519 layer_info[i].mask.page.x=ReadBlobSignedLong(image);
1520 layer_info[i].mask.page.height=(size_t) (ReadBlobLong(image)-
1521 layer_info[i].mask.page.y);
1522 layer_info[i].mask.page.width=(size_t) (ReadBlobLong(image)-
1523 layer_info[i].mask.page.x);
1524 layer_info[i].mask.background=(unsigned char) ReadBlobByte(
1526 layer_info[i].mask.flags=(unsigned char) ReadBlobByte(image);
1527 if (!(layer_info[i].mask.flags & 0x01))
1529 layer_info[i].mask.page.y=layer_info[i].mask.page.y-
1530 layer_info[i].page.y;
1531 layer_info[i].mask.page.x=layer_info[i].mask.page.x-
1532 layer_info[i].page.x;
1537 (double) layer_info[i].mask.page.x,(double)
1538 layer_info[i].mask.page.y,(double) layer_info[i].mask.page.width,
1539 (double) layer_info[i].mask.page.height,(double)
1546 layer_info=DestroyLayerInfo(layer_info,number_layers);
1581 (void) ReadBlob(image,(size_t) length++,layer_info[i].name);
1582 layer_info[i].name[length]='\0';
1585 " layer name: %s",layer_info[i].name);
1595 layer_info=DestroyLayerInfo(layer_info,number_layers);
1604 if ((layer_info[i].page.width == 0) ||
1605 (layer_info[i].page.height == 0))
1616 layer_info[i].image=CloneImage(image,layer_info[i].page.width,
1617 layer_info[i].page.height,MagickFalse,exception);
1618 if (layer_info[i].image == (Image *) NULL)
1620 layer_info=DestroyLayerInfo(layer_info
1633 if (layer_info[i].image == (Image *) NULL)
1635 for (j=0; j < layer_info[i].channels; j++)
1638 layer_info[i].channel_info[j].size) == MagickFalse)
1640 layer_info=DestroyLayerInfo(layer_info,number_layers);
1652 status=ReadPSDLayer(image,psd_info,&layer_info[i],exception);
1667 if (layer_info[i].image == (Image *) NULL)
1670 layer_info[j] = layer_info[j+1];
1681 layer_info[i].image->previous=layer_info[i-1].image;
1683 layer_info[i].image->next=layer_info[i+1].image;
1684 layer_info[i].image->page=layer_info[i].page;
1686 image->next=layer_info[0].image;
1687 layer_info[0].image->previous=image;
1689 layer_info=(LayerInfo *) RelinquishMagickMemory(layer_info);
1692 layer_info=DestroyLayerInfo(layer_info,number_layers);