upsample

提供: Tommy6
移動: 案内検索

他に指定されている場合を除き、型名 gentype を、組み込みデータ型 char, char{2|3|4|8|16}, uchar, uchar{2|3|4|8|16}, short, short{2|3|4|8|16}, ushort, ushort{2|3|4|8|16}, int, int{2|3|4|8|16}, uint, uint{2|3|4|8|16}, long, long{2|3|4|8|16}, ulong, ulong{2|3|4|8|16} を指すものとして用います。また、型名 ugentype を型名 gentype の符号無し版を指すものとして用います。たとえば、gentype が char4 のとき、ugentype は uchar4 です。型名 sgentype を、組み込みスカラデータ型 char, uchar, short, ushort, int, uint, long, ulong を指すものとして用います。整数関数が gentype と sgentype をとるとき、gentype は sgentype のスカラもしくはベクトル版になります。たとえば、sgentype が uchar のとき、gentype は uchar もしくは uchar{2|3|4|8|18} になります。

他に指定されている場合を除き、関数を使用する際の引数および戻り値の型は全て同じです。

short upsample (char hi, uchar lo) ushort upsample (uchar hi, uchar lo) shortn upsample (charn hi, ucharn lo) ushortn upsample (ucharn hi, ucharn lo)

int upsample (short hi, ushort lo) uint upsample (ushort hi, ushort lo) intn upsample (shortn hi, ushortn lo) uintn upsample (ushortn hi, ushortn lo)

long upsample (int hi, uint lo) ulong upsample (uint hi, uint lo) longn upsample (intn hi, uintn lo) ulongn upsample (uintn hi, uintn lo)

  • ((short)hi[i] << 8) | lo[i]
  • ((ushort)hi[i] << 8) | lo[i]
  • ((int)hi[i] << 16) | lo[i]
  • ((uint)hi[i] << 16) | lo[i]
  • ((long)hi[i] << 32) | lo[i]
  • ((ulong)hi[i] << 32) | lo[i]

を求めます。

変更記録

脚注



―――― Version 1.1, The OpenCL Specification より翻訳