画像データのメモリ上のフォーマットを特定するために使われます。
Cairo::Format.stride_for_width(format, width)
Since 1.6: cairo中の高速化したイメージ描画処理の すべての整列要求を考慮したストライド値を返します。以下 のように使います。
stride = ((<Cairo::Format.stride_for_width|cairo-format.rd/Cairo::Format.stride_for_width>))(format, width) data = "\0" * stride * height surface = ((<Cairo::ImageSurface.create|cairo-image-surface.rd/Cairo::ImageSurface.create>))(data, format, width, height, stride)
format: Cairo::Format::*のどれか。 width: Cairo::ImageSurfaceの作成に使いたい幅。 Returns: 与えられたformatとwidthに適切なストライド値。 不正なformatや大きすぎるwidthを与えた場合は-1。
A1
A8
ARGB32
RGB24