| // Copyright 2015 Google Inc. All Rights Reserved. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // https://www.khronos.org/registry/typedarray/specs/latest/#7 |
| |
| [ |
| Constructor(unsigned long length), |
| Constructor(Float32Array array), |
| Constructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length), |
| ConstructorCallWith=EnvironmentSettings, |
| RaisesException=Constructor |
| ] |
| interface Float32Array : ArrayBufferView { |
| const unsigned long BYTES_PER_ELEMENT = 4; |
| |
| readonly attribute unsigned long length; |
| |
| getter unrestricted float get(unsigned long index); |
| setter void set(unsigned long index, unrestricted float value); |
| |
| // Return a new Float32Array that is a view on top of this one. |
| // Contains this[start]..this[end]. end defaults to length if unspecified. |
| [CallWith=EnvironmentSettings] Float32Array subarray(long start, optional long end); |
| }; |