紋理是範圍定義域中 的數據匯總 accelerator_view 。 它是由變數組成的集合,其中每個變數對應於一個擴展領域中的元素。 每個變數都會保留與 C++ 原始類型(unsigned int, int, float, double)、純量類型(norm, 或 unorm),或短向量類型相對應的值。
語法
template <typename value_type, int _Rank>
class texture;
參數
value_type
紋理中元素的型別。
_排行
紋理的排名。
成員
公共型別定義
| 名稱 | 描述 |
|---|---|
scalar_type |
標量類型。 |
value_type |
實值型別。 |
公開建構函式
| 名稱 | 描述 |
|---|---|
| 紋理建構函式 | 初始化 texture 類別的新執行個體。 |
| ~texture 解構子 | 銷毀texture物件。 |
公用方法
| 名稱 | 描述 |
|---|---|
| copy_to | 執行深層複製,將 texture 物件複製到目的地。 |
| 數據 | 傳回指向此材質原始數據的 CPU 指標。 |
| 獲取 | 傳回位於指定索引處的元素值。 |
| get_associated_accelerator_view | 回傳此紋理要複製到的慣用目標的 accelerator_view 。 |
| get_depth_pitch | 傳回在 CPU 上 3D 暫存紋理的每個深度切片之間的位元組數。 |
| get_row_pitch | 傳回 CPU 上 2D 或 3D 暫存紋理中每一行之間的字節數目。 |
| 設定 | 設定指定索引處元素的值。 |
公用運算子
| 名稱 | 描述 |
|---|---|
| operator() | 傳回參數所指定的項目值。 |
| operator[] | 返回位於指定索引處的元素。 |
| 運算子= | 將指定的 紋理 物件複製到這個物件。 |
公用常數
| 名稱 | 描述 |
|---|---|
| rank 常數 | 取得 texture 物件的位階。 |
公用資料成員
| 名稱 | 描述 |
|---|---|
| associated_accelerator_view | 取得此紋理要複製到之慣用目標的 accelerator_view。 |
| 深度間距 | 取得 CPU 上 3D 定序緩衝紋理中每個深度切片之間的位元組的數量。 |
| row_pitch | 取得 CPU 上 2D 或 3D 暫存紋理中每列之間的位元組數目。 |
繼承階層架構
_Texture_base
texture
需求
標頭: amp_graphics.h
命名空間: Concurrency::graphics
~紋理
銷毀texture物件。
~texture() restrict(cpu);
關聯加速器視圖
取得要複製此紋理慣用目標的accelerator_view。
__declspec(property(get= get_associated_accelerator_view)) Concurrency::accelerator_view associated_accelerator_view;
複製到
執行深層複製,將 texture 物件複製到目的地。
void copy_to(texture& _Dest) const;
void copy_to(writeonly_texture_view<value_type, _Rank>& _Dest) const;
參數
_Dest
要複製到的物件。
_排行
紋理的排名。
value_type
紋理中元素的型別。
資料
傳回指向此材質原始數據的 CPU 指標。
void* data() restrict(cpu);
const void* data() const restrict(cpu);
傳回值
紋理原始數據的指標。
深度角 (depth_pitch)
取得 CPU 上 3D 暫存材質中每個深度切片之間的位元組數。
__declspec(property(get= get_depth_pitch)) unsigned int depth_pitch;
get
傳回位於指定索引處的元素值。
const value_type get(const index<_Rank>& _Index) const restrict(amp);
參數
_指數
元素的索引。
傳回值
位於指定索引處的項目值。
get_associated_accelerator_view(獲取相關加速器檢視)
傳回要複製此紋理慣用目標的accelerator_view。
Concurrency::accelerator_view get_associated_accelerator_view() const restrict(cpu);
傳回值
這個紋理的複製慣用目標是accelerator_view。
get_depth_pitch
傳回在 CPU 上 3D 暫存紋理的每個深度切片之間的位元組數。
unsigned int get_depth_pitch() const restrict(cpu);
傳回值
CPU 上 3D 臨時紋理中每個深度切片之間的位元組數。
get_row_pitch
傳回 2 維暫存紋理中每行之間的位元組數,或 3 維暫存紋理中深度切片的每行之間的位元組數。
unsigned int get_row_pitch() const restrict(cpu);
傳回值
2 維暫存紋理中每個數據行之間的位元組數,或3 維暫存紋理中深度切片的每個數據行之間的位元組數。
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);
參數
_指數
索引。
_I0
索引最重要的元件。
_I1
索引的下一個至最重要元件。
_I2
索引最不重要的元件。
_排行
索引的排名。
傳回值
參數所指定的元素值。
運算子[] (operator[])
返回位於指定索引處的元素。
const value_type operator[] (const index<_Rank>& _Index) const restrict(amp);
const value_type operator[] (int _I0) const restrict(amp);
參數
_指數
索引。
_I0
索引。
傳回值
位於指定索引處的元素。
運算子=
將指定的 紋理 物件複製到這個物件。
texture& operator= (
const texture& _Other);
texture& operator= (
texture<value_type, _Rank>&& _Other);
參數
_其他
要從texture複製的物件。
傳回值
這個 texture 對象的參考。
順位
取得 texture 物件的位階。
static const int rank = _Rank;
行距
取得 CPU 上 2D 或 3D 暫存紋理中每列之間的位元組數目。
__declspec(property(get= get_row_pitch)) unsigned int row_pitch;
設定
設定指定索引處元素的值。
void set(
const index<_Rank>& _Index,
const value_type& value) restrict(amp);
參數
_指數
元素的索引。
_排行
索引的排名。
價值
元素的新值。
質地
初始化 texture 類別的新執行個體。
texture(const Concurrency::extent<_Rank>& _Ext) restrict(cpu);
texture(int _E0) restrict(cpu);
texture(int _E0, int _E1) restrict(cpu);
texture(int _E0, int _E1, int _E2) restrict(cpu);
texture(
const Concurrency::extent<_Rank>& _Ext,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
int _E1,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
int _E1,
int _E2,
const Concurrency::accelerator_view& _Av) restrict(cpu);
template<typename _Input_iterator>
texture(
const Concurrency::extent<_Rank>& _Ext,
_Input_iterator _Src_first,
_Input_iterator _Src_last) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0, _Input_iterator _Src_first, _Input_iterator _Src_last) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0,
int _E1,
_Input_iterator _Src_first,
_Input_iterator _Src_last) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0,
int _E1,
int _E2,
_Input_iterator _Src_first,
_Input_iterator _Src_last) restrict(cpu);
template<typename _Input_iterator>
texture(
const Concurrency::extent<_Rank>& _Ext,
_Input_iterator _Src_first,
_Input_iterator _Src_last,
const Concurrency::accelerator_view& _Av) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0,
_Input_iterator _Src_first,
_Input_iterator _Src_last,
const Concurrency::accelerator_view& _Av) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0,
int _E1,
_Input_iterator _Src_first,
_Input_iterator _Src_last,
const Concurrency::accelerator_view& _Av) restrict(cpu);
template<typename _Input_iterator>
texture(
int _E0,
int _E1,
int _E2,
_Input_iterator _Src_first,
_Input_iterator _Src_last,
const Concurrency::accelerator_view& _Av) restrict(cpu)) ;
texture(
int _E0,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
int _E0,
int _E1,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
int _E0,
int _E1,
int _E2,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
const Concurrency::extent<_Rank>& _Ext,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) ;
texture(
int _E0,
int _E1,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
int _E1,
int _E2,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
const Concurrency::extent<_Rank>& _Ext,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
int _E0,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
int _E0,
int _E1,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
int _E0,
int _E1,
int _E2,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element) restrict(cpu);
texture(
const Concurrency::extent<_Rank>& _Ext,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) ;
texture(
int _E0,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
int _E1,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
int _E0,
int _E1,
int _E2,
_In_ void* _Source,
unsigned int _Src_byte_size,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av) restrict(cpu);
texture(
const texture& _Src,
const Concurrency::accelerator_view& _Acc_view);
texture(
texture&& _Other);
texture(
const Concurrency::extent<_Rank>& _Ext,
unsigned int _Bits_per_scalar_element,
const Concurrency::accelerator_view& _Av);
texture(
const texture& _Src);
參數
_Acc_view
指定紋理位置的accelerator_view。
_Av
指定紋理位置的accelerator_view。
_Associated_av
accelerator_view,指定這個紋理複製的慣用目標。
每標量元素的位元數
紋理基礎純量類型中每個純量元素的位數。 一般而言,支援的值為 8、16、32 和 64。 如果指定了0,位數目會與基礎scalar_type相同。 64 僅適用於雙架構紋理。
_Ext
紋理每個維度中的範圍。
_E0
紋理最重要的元件。
_E1
紋理中次重要的元件。
_E2
紋理範圍最不重要的元件。
_Input_iterator
輸入迭代器的類型。
_Mipmap_層級
基礎紋理中的Mipmap層級數目。 如果指定了 0,紋理就會將 mipmap 層級的完整範圍縮小到指定範圍的最小可能大小。
_排行
範圍的排名。
_源
主機緩衝區的指標。
_Src
要複製的紋理。
_Src_byte_size
來源緩衝區中的字節數目。
_Src_first
來源容器中的起始迭代器。
_Src_last
來源容器中的結束迭代器。
_其他
其他數據源。
_排行
區段的排名。