About this Blog

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

2012年12月7日金曜日

xcf.txtの日本語訳-1. BASIC DATA MODEL

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

1. BASIC DATA MODEL
===================

It is recommended that a software developer who wants to take full
advantage of the XCF format be deeply familiar with GIMP at least
as a user. The following high-level overview is meant to help those
non-users who just need to extract pixel data from an XCF file get up
to speed.

XCF形式の利点をフルに引き出したいというソフトウエア開発者は、XCF形式に深く精通しているべきです。(少なくとも、GIMPのヘビーユーザーであるべきです)
以下に述べたXCFファイルに関するおおまかな概観は、XCFファイルからピクセルデータを取り出したい、非GIMPユーザーにとって大きな助けとなるでしょう。

In general an XCF file describes a stack of _layers_ and _channels_ on
a _canvas_, which is just an abstract rectangular viewport for the
layers and channels.

ざっくり言うと、XCFファイルは_canvas_上の、_layers_と_channels_の集まりについて記述しています。 _canvas_は、layerとchannelのための、仮想的な四角形の表示領域に過ぎません。

Layers
------

A layer is a named rectangular area of pixels which has a definite
position with respect to the canvas. A layer may extend beyond the
canvas or (more commonly) only cover some of it. Each pixel of the
layer has a color which is specified in one of three ways:

Layerは、ピクセルの集合であり、canvasとの位置関係のデータと名前を持つ長方形のエリアです。
layerはcanvasからはみ出ることもあれば、canvasの一部を覆うだけのこともあります。
layer上の各ピクセルは、以下に示す3つの方法のいずれかで表される色を持ちます。

  RGB: Three intensity values for red, green, and blue additive color
     components, each on a scale from 0 to 255. The exact color space
     is not specified. GIMP displays image data directly on PC
     display hardware without any software correction, so in most
     cases the intensity values should be considered nonlinear samples
     that map to physical light intensities using a power function
     with an exponent ("gamma") of about 2.5. (This is how PC hardware
     commonly treat bit values in the video buffer, which incidentally
     also has the property of making each 1/255th step about equally
     perceptible to the human eye when the monitor is correctly
     adjusted).
     Beware, however, that GIMP's compositing algorithms (as
     described in Section 8 below) implicitly treat the intensities
     as _linear_ samples. The XCF file format currently has no support
     for storing the intended gamma of the samples.

RGB形式:[未訳]

  Grayscale: One intensity value on a scale from 0 (black) to 255
     (white). Gamma considerations as for RIB.

グレースケール:[未訳]

  Indexed: An 8-bit index into a colormap that is shared between all
     layers. The colormap maps each index to an RGB triple which is
     interpreted as in the RGB model.

インデックスカラー:[未訳]

All layers in an image must use the same color model. Exception: if
the "floating selection" belongs to a channel or layer mask, it will
be represented as grayscale pixels independently of the image's
overall color model.

1つの画像に含まれるレイヤーは、同じカラーモデルを使用しなければいけません。
例外)channelやlayer maskに含まれる「フローティング選択」だけは、他のレイヤーのカラーモデルと関係なく、グレースケールを使用することができます。

Each pixel of a layer also has an alpha component which specifies the
opacity of the pixel on a linear scale from 0 (denoting an alpha of
0.0, or completely transparent) to 255 (denoting an alpha of 1.0, or
completely opaque). The color values do not use "premultiplied alpha"
storage. The color information for pixels with alpha 0 _may_ be
meaningful; GIMP preserves it when parts of a layer are erased and
provides (obscure) ways of recovering it in its user interface.

また、それぞれのピクセルはアルファ値を持っています。 これは、透過度を示すもので、最小値は0(不透明度=0.0:完全に透明)、最大値は255(不透明度=1.0:完全に不透過) この値は、"premultiplied alpha"[?]を使いません。 alpha値0はひょっとしたら意味があるかも知れません。 GIMPはレイヤーの一部が消された時や

The bottommost layer _only_ in an image may not contain alpha
information; in this case all pixels in the layer have an alpha value
of 255. (Even if the bottommost layer does not cover the entire
canvas, it is the only layer that can be without an explicit alpha
channel).

画像の中で唯一、最下層のレイヤーだけは、アルファ値を持たないことが許容されています。この場合、そのレイヤーの全てのピクセルは、255のアルファ値を持ちます。

In images that use the indexed color model, GIMP does not support
partial transparency and interprets alpha values from 0 to 127 as
fully transparent and values from 128 to 255 as fully opaque. This
behavior _may_ change in future versions of GIMP.

インデックスカラーの画像においては、GIMPは段階的な透過をサポートしていません。アルファ値の0-127は完全な透明、128-255は完全な不透明として扱います。この仕様は将来のバージョンのGIMPにおいて変更されるかも知れません。

Layers have certain other properties such as a visibility flag, a
global opacity (which is multiplied with individual pixel alphas) and
various editing state flags.

layerは他にも、表示ON/OFFフラグ、layer全体の透明度(個々のピクセルの透明度と積算されます)、その他の編集フラグを持ちます。

Channels
--------

A channel is a named object that contains a single byte of information
for each pixel in the canvas area. Channels have a variety of use as
intermediate objects during editing; they are not meant to be rendered
directly when the final image is displayed or exported to layer-less
formats.

channelは、canvas上にある、ピクセルごとに1バイトの情報を保持している名前の付いたオブジェクトです。 channelは、画像編集中の媒介形式(中間形式)として、様々な使い方があます。、 このことは、channelは、最終的な表示やレイヤー構造を持たない画像形式への変換の際に描画されないことを意味しています。

A channel can be edited as if it was a grayscale layer with the same
dimensions as the canvas. When it is shown in the GIMP editor UI
together with other layers, it is used as if it was the _inverse_
alpha channel of a layer with the same color information in all
pixels; this color can be stored in the XCF file as a property of the
channel. This "mask" representation is generally thought of as an UI
feature rather than an intrinsic semantics of a channel.

channelは、canvasと同じ寸法の、グレースケールのlayerと同じように扱うことができます。

The current _selection_ in the editor is stored as a channel in the
XCF file if it is nonempty. Pixels with a value of 255 belong to the
selection; pixels with a value of 0 don't, an pixels with intermediate
values are partially selected. A major use of channels is as a store
for saved selections.

現在の「選択範囲」はchannelとしてXCFに保存されます。(空領域でない場合) 選択範囲のピクセルには255段階の値が保存されます 値が0のピクセルはありませんが、中間値を保存することができます。 channelの主な目的として、選択領域の保存があります。

Though the channel data structure in the XCF file contains a height
and width field, these must always be the same as the canvas width and
height.

XCFファイル中のchannelのデータ構造は高さと幅を保持していますが、これらの値は常にcanvasの高さと幅と同じです。

Related to channels is the _layer mask_ that can be attached to a
layer. The layer mask is in fact represented as a channel structure in
the XCF file, but it is not listed in the master list of channels.
Its dimensions and placement coincide with those of its parent layer.
Unless disabled by the PROP_APPLY_MASK property, the layer mask
functions as an extra alpha channel for the layer, in that for each
pixel the layer's alpha byte and the layer mask byte are multiplied to
find the extent to which the layer obscures the background. Thus a
layer mask can make parts of the layer more transparent, but never
more opaque.

layerに追加できる「layer mask」も、channelと関連しています。layer maskは、XCFファイル内では、channel構造体として表現されています。が、channelのマスターリストには含まれていません。 layer maskの大きさと位置は、親となるレイヤーと同じです。 PROP_APPLY_MASKプロパティによって 無効にされない限り、layer maskはそのlayerの追加の透明度として機能します。そのlayerの各ピクセルのアルファ値と積算され、背景をどの程度透過するかを決定します。 したがって、layer maskは、透明度を高めるだけで、低くするということはありません。

0 件のコメント:

コメントを投稿