Share via


texture_view 類別

提供紋理的讀取存取和寫入權限。 texture_view 只能用來讀取其實數值型別為 intunsigned intfloat 預設為 32 位 bpse 的紋理。 若要讀取其他紋理格式,請使用 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
紋理匯總中的專案類型。

_排名
的排名 texture_view

成員

公用 Typedefs

名稱 描述
value_type 紋理匯總中的專案類型。
coordinates_type 用來在 中 texture_view 指定紋素的座標型別, short_vector 也就是與具有實值型別相關聯紋理相同排名的 float
gather_return_type 用於收集作業的傳回型別,也就是排名 4 short_vector ,保存從取樣的四個紋素值收集的四個同質色彩元件。

公用建構函式

名稱 描述
texture_view建構函式 已多載。 texture_view建構 實例。
~texture_view解構函式 texture_view終結 實例。

公用方法

名稱 描述
gather_Alpha 已多載。 使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的 Alpha (w) 元件。
gather_blue 已多載。 使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的藍色 (z) 元件。
gather_green 已多載。 使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的綠色 (y) 元件。
gather_red 已多載。 使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的紅色 (x) 元件。
get 已多載。 依索引取得專案值。
樣品 已多載。 使用指定的取樣組態,在指定的座標和詳細資料層級取樣紋理。
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 建構函式 建立可 texture_view 寫入的 。

[3, 4] texture 建構函式 建立不可 texture_view 寫入的 。

_其他
[5] 複製建構函式 來源可 texture_view 寫入 。

[6, 7]複製建構函式 來源不可寫入 texture_view

_Mipmap_level
此可 texture_view 寫入所系結來源 texture 的特定 Mipmap 層級。 預設值為 0,代表最上層(最詳細)mip 層級。

_Most_detailed_mip
相對於指定的 texture_view 物件,檢視的最上層 (最詳細) mip 層級。

_Mip_levels
可透過 texture_view 存取的 Mipmap 層級數目。

gather_red

使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的紅色 (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 位址模式。 所有維度的位址模式都相同。

_採樣
用來取樣 的 texture_view 取樣器組態。

_Coord
要從中取得樣本的座標。 小數座標值可用來插補樣本紋素。

傳回值

排名 4 短向量,其中包含 4 個取樣紋素值的紅色 (x) 元件。

gather_green

使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的綠色 (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 位址模式。 所有維度的位址模式都相同。

_採樣
用來取樣 的 texture_view 取樣器組態。

_Coord
要從中取得樣本的座標。 小數座標值可用來插補樣本紋素。

傳回值

排名 4 短向量,其中包含 4 個取樣紋素值的綠色 (y) 元件。

gather_blue

使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的藍色 (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 位址模式。 所有維度的位址模式都相同。

_採樣
用來取樣 的 texture_view 取樣器組態。

_Coord
要從中取得樣本的座標。 小數座標值可用來插補樣本紋素。

傳回值

排名 4 短向量,其中包含 4 個取樣紋素值的紅色 (x) 元件。

gather_Alpha

使用指定的取樣組態來取樣指定座標上的紋理,並傳回四個取樣紋素的 Alpha (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 位址模式。 所有維度的位址模式都相同。

_採樣
用來取樣 的 texture_view 取樣器組態。

_Coord
要從中取得樣本的座標。 小數座標值可用來插補樣本紋素。

傳回值

排名 4 短向量,其中包含 4 個取樣紋素值的 Alpha (w) 元件。

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);

參數

_指數
要取得之專案的索引,可能是多維度。

_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);

參數

_其他
[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);

參數

_指數
索引,可能是多維度。

_I0
一維索引。

傳回值

_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);

參數

_指數
索引,可能是多維度。

_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的位址模式。 所有維度的位址模式都相同。

_採樣
用來取樣texture_view的取樣器組態。

_Coord
要從中取得樣本的座標。 小數座標值可用來插補紋素值。

_Level_of_detail
值會指定要從中取樣的 Mipmap 層級。 小數值可用來插補兩個 Mipmap 層級。 詳細資料的預設層級為 0,代表最詳細的 Mip 層級。

傳回值

插入的範例值。

set

將位於指定索引處的專案值設定為指定的值。

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

參數

_指數
要設定之專案的索引,可能是多維度。

value
要設定元素的值。

value_type

texture_view專案的實值型別。

typedef typename const value_type value_type;

另請參閱

Concurrency::graphics 命名空間