Open3
PsdParser

PsdParser と PSD形式のメモ

レイヤー構造について
-
LayerRecordAndImage
- PsdFile.LayerAndMaskInformationSection.LayerInfo.Items から取れる
- RecordとImageの2つプロパティ
- Record:いろんなレイヤー情報
- Image: 画像情報
- レイヤー種類
- FolderやDividerと呼ばれる特殊なやつがある
- Record.AdditionalLayerInformationsに含まれるデータのKeyで判定できる
- めんどくさいので
is SectionDividerSetting
で判定するとラク
- めんどくさいので
-
SectionDividerSetting
-
SectionDividerSetting.Type
をLsctType
の種類で更に種類を判定できる- OpenedFolder / ClosedFolder / BoundingSectionDivider / AnyOtherTypeOfLayer
- BoundingSectionDivider
- このレイヤー以降のレイヤーは子レイヤーになる
- OpenedFolder or ClosedFolder までが子レイヤー
- フォルダー構造やフォルダ入れ子は自分で解析する必要がある
-
- レイヤーフラグ
-
Record.LayerFlags
- レイヤーの非表示などの状態フラグ
Layer.Record.LayerFlags & LayerFlags.Visible) != LayerFlags.Visible //visible
-
公式Testだとこのあたりを参考に。

注意点
-
Record.LayerName
はUnicode非対応、文字化けすることがある-
Record.AdditionalLayerInformations
のUnicodeLayerName
型にしないといけない
-