texture 類別

紋理是範圍定義域中 的資料匯總 accelerator_view 。 它是變數的集合,一個用於範圍定義域中的每個元素。 每個變數都會保留對應至 C++ 基本類型 (、 floatintdouble 純量類型或 unsigned intnormunorm 短向量類型) 的值。

語法

template <typename value_type,  int _Rank>
class texture;

參數

value_type
紋理中專案的型別。

_排名
紋理的排名。

成員

公用 Typedefs

名稱 描述
scalar_type 純量類型。
value_type 實值型別。

公用建構函式

名稱 描述
紋理建構函式 初始化 texture 類別的新執行個體。
~紋理解構函式 texture終結 物件。

公用方法

名稱 描述
copy_to 執行深層複製,將 texture 物件複製到目的地。
data 傳回此紋理原始資料的 CPU 指標。
get 傳回位於指定索引處的專案值。
get_associated_accelerator_view 回要複製此紋理慣用目標的accelerator_view
get_depth_pitch 傳回 CPU 上 3D 暫存紋理中每個深度配量之間的位元組數目。
get_row_pitch 傳回 CPU 上 2D 或 3D 暫存紋理中每個資料列之間的位元組數目。
set 設定位於指定索引處的專案值。

公用運算子

名稱 描述
operator() 傳回參數所指定的專案值。
operator[] 傳回位於指定索引處的專案。
operator= 將指定的 紋理 物件複製到這個物件。

公用常數

名稱 描述
rank 常數 取得 物件的排名 texture

公用資料成員

名稱 描述
associated_accelerator_view 取得要複製此紋理慣用目標的accelerator_view
depth_pitch 取得 CPU 上 3D 暫存紋理中每個深度配量之間的位元組數目。
row_pitch 取得 CPU 上 2D 或 3D 暫存紋理中每個資料列之間的位元組數目。

繼承階層架構

_Texture_base

texture

需求

標頭: amp_graphics.h

命名空間: Concurrency::graphics

~紋理

texture終結 物件。

~texture() restrict(cpu);

associated_accelerator_view

取得要複製此紋理慣用目標的accelerator_view

__declspec(property(get= get_associated_accelerator_view)) Concurrency::accelerator_view associated_accelerator_view;

copy_to

執行深層複製,將 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
索引。

傳回值

位於指定索引處的專案。

operator=

將指定的 紋理 物件複製到這個物件。

texture& operator= (
    const texture& _Other);

texture& operator= (
    texture<value_type, _Rank>&& _Other);

參數

_其他
texture 從中複製的物件。

傳回值

這個 texture 物件的參考。

rank

取得 物件的排名 texture

static const int rank = _Rank;

row_pitch

取得 CPU 上 2D 或 3D 暫存紋理中每個資料列之間的位元組數目。

__declspec(property(get= get_row_pitch)) unsigned int row_pitch;

set

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

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

參數

_指數
項目的索引。

_排名
索引的排名。

value
項目的新值。

紋理

初始化 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,指定這個紋理複製的慣用目標。

_Bits_per_scalar_element
紋理基礎純量類型中每個純量元素的位數。 一般而言,支援的值為 8、16、32 和 64。 如果指定了 0,位數目會與基礎scalar_type相同。 64 僅適用于雙架構紋理。

_內線
紋理每個維度中的範圍。

_E0
紋理最重要的元件。

_E1
紋理的下一個到最重要元件。

_E2
紋理範圍最不重要的元件。

_Input_iterator
輸入迭代器的類型。

_Mipmap_levels
基礎紋理中的 Mipmap 層級數目。 如果指定了 0,紋理就會將 mipmap 層級的完整範圍縮小到指定範圍的最小可能大小。

_排名
範圍的排名。

_源
主機緩衝區的指標。

_Src
要複製的紋理。

_Src_byte_size
來源緩衝區中的位元組數目。

_Src_first
來源容器中的起始反覆運算器。

_Src_last
來源容器中的結束反覆運算器。

_其他
其他資料來源。

_排名
區段的排名。

另請參閱

Concurrency::graphics 命名空間