言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

WebCamTexture.GetPixels

public function GetPixels(): Color[];

Description

ピクセルカラーの配列を取得します

この関数はテクスチャのミップレベル全体のピクセルカラーの 配列を返します。 返される配列は平らな2次元配列で、ピクセルは上から下(列の後に列)、左から右に並びます。 配列のサイズが使用されるミップレベルの高さと幅になります。 デフォルトのミップレベルが今のテクスチャのサイズのみである場合は0(ベーステクスチャ)です。 一般的な場合、未ップレベルは mipWidth=max(1,width>>miplevel) と高さも同様です。 Using GetPixels can be faster than calling GetPixel repeatedly, especially for large textures. In addition, GetPixels can access individual mipmap levels.

public function GetPixels(x: int, y: int, blockWidth: int, blockHeight: int): Color[];

Description

ピクセルカラーの配列を取得します

This function is an extended version of GetPixels above; it does not return the whole mip level but only blockWidth by blockHeight region starting at x,y. The block must fit into the used mip level. The returned array is blockWidth*blockHeight size.