次の方法で共有


texture_view クラス

テクスチャへの読み取りアクセスおよび書き込みアクセスを提供します。 texture_view は、既定の 32 ビット bpse である intunsigned int、または float の値型のテクスチャを読み取るためにのみ使用できます。 他のテクスチャ形式を読み取るには、texture_view<const value_type, _Rank> を使用します。

構文

template<typename value_type,int _Rank>
class texture_view;

template<typename value_type, int _Rank>
class texture_view
   : public details::_Texture_base<value_type, _Rank>;

template<typename value_type, int _Rank>
class texture_view<const value_type, _Rank>
   : public details::_Texture_base<value_type, _Rank>;

パラメーター

value_type
テクスチャ集合体の要素型です。

_Rank
texture_view のランクです。

メンバー

パブリック typedef

名前 説明
value_type テクスチャ集合体の要素型です。
coordinates_type texture_view のテクセルを指定するために使用する座標の型。つまり、値型が short_vector である関連するテクスチャと同じランクの float です。
gather_return_type 操作を収集するために使用される戻り値の型。つまり、サンプリングされた 4 つのテクセル値から収集された 4 つの同種の色要素を保持するランク 4 の short_vector です。

パブリック コンストラクター

名前 説明
texture_view コンストラクター 過負荷です。 texture_view インスタンスを構築します。
~texture_view デストラクター texture_view インスタンスを破棄します。

パブリック メソッド

名前 説明
gather_alpha 過負荷です。 指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルのアルファ (w) 要素を返します。
gather_blue 過負荷です。 指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの青 (z) 要素を返します。
gather_green 過負荷です。 指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの緑 (y) 要素を返します。
gather_red 過負荷です。 指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの赤 (x) 要素を返します。
get 過負荷です。 インデックスで要素の値を取得します。
sample 過負荷です。 指定されたサンプリング構成を使用して詳細な指定された座標およびレベルでテクスチャをサンプリングします。
set インデックスで要素の値を設定します。

パブリック演算子

名前 説明
Operator() 過負荷です。 インデックスで要素の値を取得します。
operator[] 過負荷です。 インデックスで要素の値を取得します。
operator= 過負荷です。 代入演算子。

パブリック データ メンバー

名前 説明
value_type texture_view の要素の値型です。

継承階層

_Texture_base

texture_view

必要条件

ヘッダー: amp_graphics.h

名前空間: concurrency::graphics

~texture_view

texture_view インスタンスを破棄します。

~texture_view() restrict(amp, cpu);

texture_view

texture_view インスタンスを構築します。

texture_view(// [1] constructor
    texture<value_type, _Rank>& _Src) restrict(amp);

texture_view(// [2] constructor
    texture<value_type, _Rank>& _Src,
    unsigned int _Mipmap_level = 0) restrict(cpu);

texture_view(// [3] constructor
    const texture<value_type, _Rank>& _Src) restrict(amp);

texture_view(// [4] constructor
    const texture<value_type, _Rank>& _Src,
    unsigned int _Most_detailed_mip,
    unsigned int _Mip_levels) restrict(cpu);

texture_view(// [5] copy constructor
    const texture_view<value_type, _Rank>& _Other) restrict(amp, cpu);

texture_view(// [6] copy constructor
    const texture_view<const value_type, _Rank>& _Other) restrict(amp, cpu);

texture_view(// [7] copy constructor
    const texture_view<const value_type, _Rank>& _Other,
    unsigned int _Most_detailed_mip,
    unsigned int _Mip_levels) restrict(cpu);

パラメーター

_Src
[1, 2] コンストラクター 書き込み可能な texture_view が作成される texture

[3, 4] コンストラクター 書き込みできない texture_view が作成される texture

_Other
[5] コピー コンストラクター ソース書き込み可能な texture_view

[6, 7] コピー コンストラクター ソース書き込みできない texture_view

_Mipmap_level
この書き込み可能な texture がバインドするソース texture_view の特定の MIPMAP レベル。 既定値は 0 で、トップ レベル (最も詳細な) MIPMAP レベルを表します。

_Most_detailed_mip
指定された texture_view オブジェクトに関連する、ビューのトップ レベルの (最も詳細な) MIPMAP レベル。

_Mip_levels
texture_view を使用してアクセスできる MIPMAP レベルの数。

gather_red

指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの赤 (x) 要素を返します。

const gather_return_type gather_red(
    const sampler& _Sampler,
    const coordinates_type& _Coord) const restrict(amp);

template<
    address_mode _Address_mode = address_clamp
>
const gather_return_type gather_red(
    const coordinates_type& _Coord) const restrict(amp);

パラメーター

_Address_mode
texture_view をサンプリングするために使用するアドレス モード。 アドレス モードはすべての次元に対して同じです。

_Sampler
texture_view をサンプリングするために使用するサンプラー構成。

_Coord
サンプルが取得される座標です。 サンプルのテクセルを補間するには、小数の座標値が使用されます。

戻り値

4 つのサンプリングされたテクセル値の赤 (x) 要素を含むランク 4 の短いベクター。

gather_green

指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの緑 (y) 要素を返します。

const gather_return_type gather_green(
    const sampler& _Sampler,
    const coordinates_type& _Coord) const restrict(amp);

template<
    address_mode _Address_mode = address_clamp
>
const gather_return_type gather_green(
    const coordinates_type& _Coord) const restrict(amp);

パラメーター

_Address_mode
texture_view をサンプリングするために使用するアドレス モード。 アドレス モードはすべての次元に対して同じです。

_Sampler
texture_view をサンプリングするために使用するサンプラー構成。

_Coord
サンプルが取得される座標です。 サンプルのテクセルを補間するには、小数の座標値が使用されます。

戻り値

4 つのサンプリングされたテクセル値の緑 (y) 要素を含むランク 4 の短いベクター。

gather_blue

指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルの青 (z) 要素を返します。

const gather_return_type gather_blue(
    const sampler& _Sampler,
    const coordinates_type& _Coord) const restrict(amp);

template<
    address_mode _Address_mode = address_clamp
>
const gather_return_type gather_blue(
    const coordinates_type& _Coord) const restrict(amp);

パラメーター

_Address_mode
texture_view をサンプリングするために使用するアドレス モード。 アドレス モードはすべての次元に対して同じです。

_Sampler
texture_view をサンプリングするために使用するサンプラー構成。

_Coord
サンプルが取得される座標です。 サンプルのテクセルを補間するには、小数の座標値が使用されます。

戻り値

4 つのサンプリングされたテクセル値の赤 (x) 要素を含むランク 4 の短いベクター。

gather_alpha

指定されたサンプリング構成を使用して指定された座標でテクスチャをサンプリングし、4 つのサンプリングされたテクセルのアルファ (w) 要素を返します。

const gather_return_type gather_alpha(
    const sampler& _Sampler,
    const coordinates_type& _Coord) const restrict(amp);

template<
    address_mode _Address_mode = address_clamp
>
const gather_return_type gather_alpha(
    const coordinates_type& _Coord) const restrict(amp);

パラメーター

_Address_mode
texture_view をサンプリングするために使用するアドレス モード。 アドレス モードはすべての次元に対して同じです。

_Sampler
texture_view をサンプリングするために使用するサンプラー構成。

_Coord
サンプルが取得される座標です。 サンプルのテクセルを補間するには、小数の座標値が使用されます。

戻り値

4 つのサンプリングされたテクセル値のアルファ (w) 要素を含むランク 4 の短いベクター。

get

指定したインデックス位置にある要素の値を取得します。

const value_type get(
    const index<_Rank>& _Index) const restrict(amp);

value_type get(
    const index<_Rank>& _Index,
    unsigned int _Mip_level = 0) const restrict(amp);

パラメーター

_Index
場合によっては多次元配列である、取得する要素のインデックス。

_Mip_level
値を取得する必要のある MIPMAP レベル。 既定値 0 は最も詳細な MIPMAP レベルを表します。

戻り値

要素の値。

operator=

指定された texture_view と同じテクスチャのビューをこの texture_view インスタンスに割り当てます。

texture_view<value_type, _Rank>& operator= (// [1] copy constructor
    const texture_view<value_type, _Rank>& _Other) restrict(amp, cpu);

texture_view<const value_type, _Rank>& operator= (// [2] copy constructor
    const texture_view<value_type, _Rank>& _Other) restrict(cpu);

texture_view<const value_type, _Rank>& operator= (// [3] copy constructor
    const texture_view<const value_type, _Rank>& _Other) restrict(amp, cpu);

パラメーター

_Other
[1, 2] コピー コンストラクター 書き込み可能な texture_view オブジェクト。

[3] コピー コンストラクター 書き込みできない texture_view オブジェクト。

戻り値

この texture_view インスタンスへの参照。

operator[]

インデックスごとの要素の値を返します。

const value_type operator[] (const index<_Rank>& _Index) const restrict(amp);

const value_type operator[] (int _I0) const restrict(amp);

value_type operator[] (const index<_Rank>& _Index) const restrict(amp);

value_type operator[] (int _I0) const restrict(amp);

パラメーター

_Index
場合によっては多次元の、インデックス。

_I0
1 次元インデックス。

戻り値

_Index でインデックス付けされている要素の値。

Operator()

インデックスごとの要素の値を返します。

const value_type operator() (
    const index<_Rank>& _Index) const restrict(amp);

const value_type operator() (
    int _I0) const restrict(amp);

const value_type operator() (
    int _I0,   int _I1) const restrict(amp);

const value_type operator() (
    int _I0,
    int _I1,
    int _I2) const restrict(amp);

value_type operator() (
    const index<_Rank>& _Index) const restrict(amp);

value_type operator() (
    int _I0) const restrict(amp);

value_type operator() (
    int _I0,
    int _I1) const restrict(amp);

value_type operator() (
    int _I0,
    int _I1,
    int _I2) const restrict(amp);

パラメーター

_Index
場合によっては多次元の、インデックス。

_I0
インデックスの最上位のコンポーネント。

_I1
インデックスの最上位の次のコンポーネント。

_I2
インデックスの最下位のコンポーネント。

戻り値

_Index でインデックス付けされている要素の値。

sample

指定されたサンプリング構成を使用して詳細な指定された座標およびレベルでテクスチャをサンプリングします。

value_type sample(
    const sampler& _Sampler,
    const coordinates_type& _Coord,
    float _Level_of_detail = 0.0f) const restrict(amp);

template<
    filter_mode _Filter_mode = filter_linear,
    address_mode _Address_mode = address_clamp
>
value_type sample(
    const coordinates_type& _Coord,
    float _Level_of_detail = 0.0f) const restrict(amp);

パラメーター

_Filter_mode
texture_view をサンプリングするために使用するフィルター モード。 フィルター モードは最小化、最大化、および MIPMAP フィルターで同じです。

_Address_mode
texture_view をサンプリングするために使用するアドレス モード。 アドレス モードはすべての次元に対して同じです。

_Sampler
texture_view をサンプリングするために使用するサンプラー構成。

_Coord
サンプルが取得される座標です。 テクセル値の補間には小数の座標値が使用されます。

_Level_of_detail
値は、サンプリング元の MIPMAP レベルを指定します。 2 つの MIPMAP レベル間の補間には、小数の値が使用されます。 詳細の既定のレベルは 0 で、これは最も詳細な MIPMAP レベルを表します。

戻り値

補間されたサンプル値。

set

指定したインデックス位置にある要素の値を指定した値に設定します。

void set(
    const index<_Rank>& _Index,
    const value_type& value) const restrict(amp);

パラメーター

_Index
場合によっては多次元配列である、設定する要素のインデックス。

value
要素を設定する値。

value_type

texture_view の要素の値型です。

typedef typename const value_type value_type;

関連項目

Concurrency::graphics 名前空間