About this Blog

This Blog has English posts and Japanese posts. About Mac, iOS, Objective-C, and so on.

2012年12月8日土曜日

xcf.txtの日本語訳 4. THE LAYER STRUCTURE

This post is a personal translation of Henning Makholm's xcf.txt to Japanese. : Index here
アプリを作る際に作成した、xcf.txtの日本語訳です。目次及び使用上の注意はこちら

4. THE LAYER STRUCTURE
======================
Layer structures are pointed to from a list of layer pointers in the
master image structure.
layer structureは、[3章で述べた]master image structureのlayer pointers listによって指し示されます。
  uint32  width  The width of the layer
  uint32  height The height of the layer
  uint32  type   Color mode of the layer: one of
                   0: RGB color without alpha; 3 bytes per pixel
                   1: RGB color with alpha;    4 bytes per pixel
                   2: Grayscale without alpha; 1 byte per pixel
                   3: Grayscale with alpha;    2 bytes per pixel
                   4: Indexed without alpha;   1 byte per pixel
                   5: Indexed with alpha;      2 bytes per pixel
                 (enum GimpImageType in libgimpbase/gimpbseenums.h)
  string  name   The name of the layer
  property-list  Layer properties (details below)
  uint32  hptr   Pointer to the hierarchy structure containing the pixels
  uint32  mptr   Pointer to the layer mask (a channel structure), or 0

[未訳:原文を見てください]

The color mode of a layer must match that of the entire image.  All
layers except the bottommost one _must_ have an alpha channel.

layerのカラーモードは、画像のカラーモードと一致していなければなりません。最下層のlayer以外は、必ずアルファ値を持ちます。

Exception: If the layer is a floating selection (see
PROP_FLOATING_SELECTION) and is attached to a channel or layer mask,
its color mode must be 3 (grayscale with alpha).

layerがfloating selectionで、(PROP_FLOATING_SELECTIONを見てください)channel又はlayer maskに付属している場合、カラーモードは3である必要があります。

Layer properties
----------------
The following properties are found only in the property list of layer
structures. In addition to these, the list can also contain the
properties PROP_OPACITY, PROP_VISIBLE, PROP_LINKED, PROP_TATTOO,
PROP_PARASITES, and PROP_END, defined in section 8 below.

以下に述べるpropertyはlayer structureにだけ現れます。加えて、PROP_OPACITY, PROP_VISIBLE, PROP_LINKED, PROP_TATTOO,>PROP_PARASITES, PROP_ENDをリストに含むことができます。これらのpropertyについてはsection 8で解説しています。

PROP_ACTIVE_LAYER (editing state)
  uint32  2    The type number for PROP_ACTIVE_LAYER is 2
  uint32  0    PROP_ACTIVE_LAYER has no payload
  Appears in the property list for the currently active layer. Only
  one layer must have this property.

>現在アクティブな[編集中の]layerだけがこのpropertyを持ちます。このpropertyを持つのは1つの画像につき1つだけです。

PROP_FLOATING_SELECTION (essential)
  uint32  5    The type number for PROP_FLOATING_SELECTION is 5
  uint32  4    Four bytes of payload
  uint32  ptr  Pointer to the layer or channel that the floating
               selection is attached to.
  Appears in the property list for the layer that is the floating
  selection. If a floating selection exists, it must always be the
  first layer in the layer list, but it is not rendered at that
  position in the layer stack. Instead it is logically attached to
  another layer, or a channel or layer mask, and the contents of the
  floating selection is combined with ("anchored to") that drawable
  before it is used to render the visible image.

floating selectionであるlayerのprope listに登場します。もしもfloating selectionが存在するなら、layer listの先頭になければいけません。が、描画の順番も最初というわけではありません。他のlayer、channelまたはlayer maskに付随するものとして、適当なタイミングで結合・描画されます。

  The floating selection must not have a layer mask of its own, but if
  an ordinary (not floating) selection also exists, it will be used as
  a layer mask for the floating selection.

floating selectionは自身のlayer maskを持つことはありませんが、通常の(フローティングでない)選択領域が存在する場合、floating selectionのlayer maskとして使われます。

  If a floating selection exists, it must also be the active layer.

floating selectionが存在するときは、かならずアクティブレイヤーです。

  Because floating selections are modal and ephemeral, users rarely
  save XCF files containing a floating selection. It may be acceptable
  for third-party XCF consumers to ignore floating selections or
  explicitly refuse to process them.

floating selectionはモーダルであり一時的なものなので、GIMPユーザーがfloating selectionをXCFファイルに保存することはほとんどありません。サードパーティ製のXCFを扱うソフトウエアがfloating selectionsを無視したり、対応しないことにしても許容されるでしょう。

PROP_MODE (essential)
  uint32  7   The type number for PROP_MODE is 7
  uint32  4   Four bytes of payload
  unit32  m   The layer mode; one of
                 0: Normal
                 1: Dissolve (random dithering to discrete alpha)
                 2: (Behind: not selectable in the GIMP UI)
                 3: Multiply
                 4: Screen
                 5: Overlay
                 6: Difference
                 7: Addition
                 8: Subtract
                 9: Darken Only
                 10: Lighten Only
                 11: Hue (H of HSV)
                 12: Saturation (S of HSV)
                 13: Color (H and S of HSL)
                 14: Value (V of HSV)
                 15: Divide
                 16: Dodge
                 17: Burn
                 18: Hard Light
                 19: Soft Light (XCF version >= 2 only)
                 20: Grain Extract (XCF version >= 2 only)
                 21: Grain Merge (XCF version >= 2 only)
  When reading old XCF files that lack this property, assume m=0.
  The effects of the various layer modes is defined in Section 8, below.

このpropertyを持たない古いXCFファイルにおいては、m=0として扱います。各レイヤーモードにおける効果については、以下のsection 8で説明しています。

  Beware that GIMP ignores all other layer modes than Normal and
  Dissolve for the bottommost visible layer of the image; if m>=3 has
  been specified for this layer it will interpreted as m==0 for
  display and flattening purposes. This effect happens for one layer
  only: even if the bottommost visible layer covers only some (or
  none) of the canvas, it will be the only layer to have its mode
  forced to Normal.

GIMPは、最下層のlayerについては、Normal,Dissolve以外のlayer modeを無視することに留意してください。最下層layerでm>=3の場合、画像表示およびlayer結合の時にはm=0であるとされます。この扱いは、画像中1つのlayerにのみ適用されます。もしも最下層の表示されているlayerがcanvasの一部しか覆っていなくても(あるいは全く覆っていなくても)、そのレイヤーがNomarl modeを強制される唯一のlayerです。

PROP_PRESERVE_TRANSPARENCY (editing state)
(called PROP_LOCK_ALPHA in Gimp 3.3+)
  uint32  10  The type number for PROP_PRESERVE_TRANSPARENCY is 10
  uint32  4   Four bytes of payload
  uint32  b   1 if the Preserve Transparency flag is set; 0 if not
  The Preserve Transparency flag prevents all drawing tools in the
  Gimp from increasing the alpha of any pixel in the layer.

このプロパティは、編集によってレイヤー上の全ピクセルのアルファ値が増えないように保護します。[透過度の上限値の設定]

PROP_APPLY_MASK (essential)
  uint32  11  The type number for PROP_APPLY_MASK is 11
  uint32  4   Four bytes of payload
  uint32  b   1 if the layer mask should be applied, 0 if not
  If the property does not appear for a layer which has a layer mask,
  it defaults to true.

layer maskがあるlayerで、このpropertyがない場合、デフォルトとしてtrueが設定されます。

  Robust readers should force this to false if the layer has no layer
  mask. Writers should never save this as true unless the layer has a
  layer mask.

堅牢なXCFリーダーを作りたいなら、layer maskを持たないlayerについてはこの値をfalseに強制的に設定するべきです。同様に、XCFを生成する時は、layer maskのないlayerにPROP_APPLY_MASK=trueを設定してはいけません。

PROP_EDIT_MASK (editing state)
  uint32  12  The type number for PROP_EDIT_MASK is 12
  uint32  4   Four bytes of payload
  uint32  b   1 if the layer mask is currently being edited, 0 if not
  If the property does not appear for a layer which has a layer mask,
  it defaults to false.

layer maskを持つlayerで、このpropertyがない場合、デフォルトでfalseが設定されます。

  Robust readers should force this to false if the layer has no layer
  mask. Writers should never save this as true unless the layer has a
  layer mask.

[同上]

PROP_SHOW_MASK (editing state)
  uint32  13  The type number for PROP_APPLY_MASK is 13
  uint32  4   Four bytes of payload
  uint32  b   1 if the layer mask is visible, 0 if not
  If the property does not appear for a layer which has a layer mask,
  it defaults to false.

layer maskを持つlayerで、このpropertyがない場合、デフォルトでfalseが設定されます。

  Robust readers should force this to false if the layer has no layer
  mask. Writers should never save this as true unless the layer has a
  layer mask.

[同上]

PROP_OFFSETS (essential)

PROP_OFFSETS (必須)

  uint32  15  The type number for PROP_OFFSETS is 15
  uint32  8   Eight bytes of payload
  int32   dx  Horizontal offset
  int32   dy  Vertical offset
  Gives the coordinates of the topmost leftmost corner of the layer
  relative to the topmost leftmost corner of the canvas. The
  coordinates can be negative; this corresponds to a layer that
  extends to the left of or above the canvas boundary.

canvasとの位置関係。layerの左上が、canvasの左上を原点とする座標上のどこにあるか、で表します。座標は負の値を持つことができ、これによって、canvas外にはみ出たlayerにも対応できます。

  When reading old XCF files that lack this property, assume (0,0).

古いXCFファイルでこのpropertyがない場合、(dx,dy)=(0,0)として扱います

PROP_TEXT_LAYER_FLAGS
  uint32  26  The type number for PROP_TEXT_LAYER_FLAGS is 26
  uint32  4   Four bytes of payload
  uint32  f   Flags, or'ed together from the following set:
               0x00000001  Do _not_ change the layer name if the text
                           contents is changed
               0x00000002  The pixel data has been painted to or
                           otherwise modified since the text was rendered
  Appears in property lists for text layers. The actual text (and
  other parameters such as font and color) appears as a parasite
  rather than a property.

text layerのproperty listに現れます。実際の文字列や、フォント、色といった情報は、propertyではなくparasiteとして格納します。

0 件のコメント:

コメントを投稿