[3] 
[DFN[[CODE[Image::XFace]]]]
は、
[CODE[X-Face]]
を扱う
[[Perlモジュール]]です。


*Image::XFace 0.1 (README)
This is a very simple interface to the libcompface library used for encoding
and decoding `X-Face' images used in email headers.

これはとっても単純な [[libcompface]] library の界面です。
[[電子メイル]]の頭の [[X-Face]] 画像の符号化と復号に使います。

Many versions of libcompface are broken and don't contain the compface
function. This is fine if you don't want to create X-Face data, less so
otherwise. I fixed this in faces-1.6.1 with the following patch:

多くの版の libcompface は壊れてて compface 関数を含みません。
これは X-Face データをつくりたいと思ってない時はいいですが、
そうじゃないときはね。てことで次のパッチを faces-1.6.1
に当てるとなおります。
[INS[
訳注: faces の(翻訳時点での)最新版では 1.7.7 ですが、
こいつにはこのパッチは当たりません。
]INS]

 diff -urN faces-orig/compface/Makefile faces/compface/Makefile
 (略)
 --- patch ends

The interface code was written by SWIG, because I am too lazy to write XS
code myself. However, I have modified the results of the SWIG stuff, so you
can't simply re-run it from the interface definition in swig/. In particular,
the version of SWIG I used didn't like to make modules in subdirectories and
I couldn't see a nice way to combine perl and C code in the generated pm file.
So I just cobbled it together manually. 

界面の code は [[SWIG]] で書きました。わたしゃなまくらなもんで
[[XS]] code を自分で書くのはアレゲで。でも、 SWIG の結果を
修正しているから、 swig/ にある界面定義で再実行するだけじゃ
駄目です。とりわけ、私が使った版の SWIG じゃ下位ディレクトリ中に
モジュールをつくれないっぽいし [[perl]] と [[C]] の code
を生成された pm file 中でくっつけるいい方法が見つかんなくて。
だからこいつらを手作業でやりました。

*Image::XFace 0.1 (pod)
**NAME

Image::XFace - encode and decode `X-Face' 48x48x1 face bitmaps
[[X-Face]] 48×48×1 顔点描図の符号化と復号

**SYNOPSIS

    use Image::XFace;

    # obtain $xface data... $xface データを得る
    @bits = Image::XFace::uncompface($xface);
    if (@bits != 48) {
        # data were invalid
    }

    # create xface data  xface データをつくる
    $xface = Image::XFace::compface(@bits);

    # get xface data as an image  xface データを画像として取得
    use GD;
    $img = Image::XFace::uncompface_gd($xface);
    # do with img as you will....  img を煮るなり焼くなり

**DESCRIPTION

Simple interface to compressing and uncompressing X-Face header data. For
instance, a small bitmap of me is represented by

[[X-Face]] 頭データを圧縮・展開する単純な界面です。
例えば、私の小さな点描画はこう表現されます。

 "kUA_=&I|(by86eXgYc|U}5`O%<xlo,~+JN9uk"Z`A.UCf2\1KKZ
 {FY-IIOqH/IS"=5=cb`U,mDyyf8a6BzVgYT~pRtqze]%s#\(J{/u
 m"(r,Ol^4J*Y%aWe-9`ZKGEYjG}d?#u2jzP,x37.%A~Qa;Yy6Fz`
 i/vu{}?y8%cI)RJpLnW=$yTs=TDM'MGjX`/LDw%p;EK;[ww;9_;U
 nRa+JZYO}[-j]O08X\Nm/K>M(P#,)y`g7N}Boz4b^JTFYHPz:s%i
 dl@t$\Vv$3OL6:>GEGwFHrV$/bfnL=6uO/ggqZfet:&D3Q=9c

**PUBLIC INTERFACE 公開界面

-uncompface XFACE

Decode XFACE data. Returns in list context 48 bit-strings of image data as
generated by vec.

XFACE データを復号します。リスト文脈で [[vec]] により生成された
48ビット文字列の画像データを返します。

-compface IMAGE

Encodes binary image data encoded in bit-strings as XFACE data, returning it
in scalar context.

ビット文字列で符号化されたバイナリ画像データを XFACE データとして
符号化して、[[スカラー]]文脈でこれを返します。

-uncompface_gd XFACE

Decode XFACE data into a GD image object.

XFACE データを [[GD]] 画像物体に復号します。

**AUTHOR

Chris Lightfoot <chris@ex-parrot.com>, though all the real work is done by
the compface library of James Ashton.

**COPYING

Copyright (c) 2002 Chris Lightfoot.

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

**VERSION

Id: XFace.pm,v 1.1.1.1 2002/02/17 23:09:57 chris Exp 

**SEE ALSO

[[compface]](3)

* License

[CODE[Image::XFace]] 付属のドキュメントとその和訳の部分に関しては、
[[Perlと同じライセンス]]。

*メモ
- 2002-10-16 (Wed) 21:06:34 ''[[名無しさん]]'' : I::XF は [[xs]] を使うので要コンパイルです。
- [1] 2002-10-27 (日) 14:30 ''[[名無しさん]]'': [[WindozeMe]] (+ [[Cygwin]] + [[perl]] 5.8.0) でコンパイルしようとしたけどできませんですた。 Quick hack ではどーにもなりませんですた。
- [2] 2002-10-27 (日) 14:30 ''[[名無しさん]]'': それから、 [[GNU/Linux]] + perl 5.6.0 でも駄目ですた。困りますた。
