public void Constructor_Correctly_Initializes_Length_And_Capacity() { var buffer = new ArrayBuffer(bufferSize); Assert.That(buffer.Length, Is.EqualTo(0)); Assert.That(buffer.Capacity, Is.EqualTo(bufferSize)); }
public void ReadByte_Throws_Exception_If_Length_Is_Zero() { byte[] bufferData = { }; var buffer = new ArrayBuffer(bufferData); Assert.That(() => buffer.ReadByte(), Throws.InstanceOf<InvalidOperationException>()); }
public void Constructor_Correctly_Initializes_Length_And_Capacity_For_Explicit_Offset_And_Count() { int count = 4; var buffer = new ArrayBuffer(new byte[bufferSize], 2, count); Assert.That(buffer.Length, Is.EqualTo(count)); Assert.That(buffer.Capacity, Is.EqualTo(bufferSize)); }
public async Task ReceiveAsync_Deserializes_Input_From_Buffer() { string expectedInput = "987654321"; var buffer = new ArrayBuffer(Encoding.UTF8.GetBytes(expectedInput), 0, expectedInput.Length); var reader = A.Fake<IAsyncBufferedReader>(); A.CallTo(() => reader.ReadAsync()).Returns(buffer); var channel = new AsyncInputChannel<string>(reader, new StringDeserializer()); string actualInput = await channel.ReceiveAsync(); Assert.That(actualInput, Is.EqualTo(expectedInput)); }
public void Receive_Deserializes_Input_From_Buffer() { string expectedInput = "1234567"; var buffer = new ArrayBuffer(Encoding.UTF8.GetBytes(expectedInput), 0, expectedInput.Length); var reader = A.Fake<IBufferedReader>(); A.CallTo(() => reader.Read()).Returns(buffer); var channel = new InputChannel<string>(reader, new StringDeserializer()); string actualInput = channel.Receive(); Assert.That(actualInput, Is.EqualTo(expectedInput)); }
public void ReadByte_Correctly_Read_Bytes() { byte[] bufferData = { 4, 8, 7 }; var buffer = new ArrayBuffer(bufferData, 0, bufferData.Length); byte byte1 = buffer.ReadByte(); Assert.That(buffer.Length, Is.EqualTo(bufferData.Length - 1)); byte byte2 = buffer.ReadByte(); Assert.That(buffer.Length, Is.EqualTo(bufferData.Length - 2)); Assert.That(bufferData[0], Is.EqualTo(byte1)); Assert.That(bufferData[1], Is.EqualTo(byte2)); }
public void ReadFrom_Correctly_Reads_Data_From_Input_Stream() { var buffer = new ArrayBuffer(bufferSize); byte[] streamData = GenerateData(5); var stream = A.Fake<IInputStream>(); A.CallTo(() => stream.Receive(A<byte[]>._, A<int>._, A<int>._)).Invokes(foc => { var buffer1 = foc.GetArgument<byte[]>(0); int offset = foc.GetArgument<int>(1); int count = foc.GetArgument<int>(2); Array.Copy(streamData, 0, buffer1, offset, streamData.Length); }).Returns(streamData.Length); int readed = buffer.ReadFrom(stream); Assert.That(readed, Is.EqualTo(streamData.Length)); Assert.That(buffer.Length, Is.EqualTo(streamData.Length)); VerifyBufferData(buffer, streamData, 0, streamData.Length); }
protected override void Add(ref ArrayBuffer<T> collection, int index, T value) { collection.Add(value); }
public static void MarshalArrayBuffer(ArrayBuffer buffer) { using (var bytes = new Uint8Array(buffer)) byteBuffer = bytes.ToArray(); }
public void Write_Fills_Full_Buffer_After_Read() { var buffer = new ArrayBuffer(bufferSize); byte[] data1 = GenerateData(bufferSize); buffer.Write(data1, 0, data1.Length); buffer.Read(bufferSize / 2); byte[] data2 = GenerateData(bufferSize / 2); buffer.Write(data2, 0, data2.Length); byte[] expectedData = data1.Skip(bufferSize / 2).Concat(data2).ToArray(); Assert.That(buffer.Length, Is.EqualTo(expectedData.Length)); VerifyBufferData(buffer, expectedData, 0, expectedData.Length); }
public void Write_Writes_Bytes_Into_Buffer() { var buffer = new ArrayBuffer(bufferSize); byte[] data = { 1, 2, 3, 4, 5, 6 }; int offset = 1; int count = 3; buffer.Write(data, offset, count); Assert.That(buffer.Length, Is.EqualTo(count)); VerifyBufferData(buffer, data, offset, count); }
public void decodeAudioData(ArrayBuffer audioData, AudioBufferCallback successCallback, AudioBufferCallback errorCallback) {}
protected override IEnumerable<T> Complete(ref ArrayBuffer<T> intermediateCollection) { return intermediateCollection.ToArray(); }
private static void MarshalByteBufferToDoubles(ArrayBuffer buffer) { using (var doubles = new Float64Array(buffer)) _doubleBuffer = doubles.ToArray(); }
/// <summary> /// Returns a new DataView object using the passed ArrayBuffer for its storage. /// </summary> /// <param name="buffer">An existing ArrayBuffer to use as the storage for the new DataView object.</param> /// <param name="byteOffset">The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the view of the buffer will start with the first byte.</param> public DataView(ArrayBuffer buffer, long byteOffset) { }
public RAM(ArrayBuffer heap, int ramoffset) { this.mem = heap; this.int32mem = new Int32Array(this.mem, ramoffset); this.uint8mem = new Uint8Array(this.mem, ramoffset); }
private static void MarshalArrayBufferToFloat32Array(ArrayBuffer buffer) { using (var floats = new Float32Array(buffer)) _floatBuffer = floats.ToArray(); }
private static DataView DataViewByteOffset(ArrayBuffer buffer) { var x = new DataView(buffer, 4, 2); return(x); }
private static DataView DataViewArrayBuffer(ArrayBuffer buffer) { var view1 = new DataView(buffer); return(view1); }
public void decodeAudioData(ArrayBuffer audioData, AudioBufferCallback successCallback) { }
public AudioBuffer createBuffer(ArrayBuffer buffer, bool mixToMono) { return(default(AudioBuffer)); }
public static DataView DataViewByteLength(ArrayBuffer buffer) { var x = new DataView(buffer, 4, 2); return(x); }
/// <summary> /// Creates a new Float64Array out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Float64Array(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }
public static void MarshalArrayBufferToInt32Array(ArrayBuffer buffer) { using (var ints = new Int32Array(buffer)) intBuffer = ints.ToArray(); }
/// <summary> /// Creates a new Int16Array out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Int16Array(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }
public static byte[] ArrayBufferToByteArray(ArrayBuffer data) { return(null); }
public void Send(ArrayBuffer data) { }
// TODO DM 24.11.2019: This would require another bunch of reflection code to get working... /* * public TaskAwaiter GetAwaiter() * { * if (TryConvertIntern(typeof(Task), out object task)) * { * return ((Task)task).GetAwaiter(); * } * throw new InvalidOperationException("JS object is not awaitable"); * }*/ internal bool TryConvertIntern(Type type, out object result) { // Converting to string. if (type == typeof(object) || type.IsAssignableFrom(GetType())) { result = this; return(true); } //Console.WriteLine($"Converting to {type.Name}"); if (type == typeof(string)) { var jsResult = _host.InvokeByName("String", JsValue.Global, 1, new DotNetValue[] { DotNetValue.FromJsValue(Handle) }); var gotString = jsResult.TryGetObject(_host, typeof(string), out result); if (!gotString) { return(false); } return(result is string); } if (typeof(Task).IsAssignableFrom(type)) { var thenHandle = _host.GetMember(Handle, "then"); try { // Ensure that Handle is a thenable/promise like object if (thenHandle.Type == JsType.Function) { if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Task <>)) { // TODO DM 24.11.2019: This is inefficient. We need to do this in the native code somehow... // How about _host.AttachTaskToPromise(Action<JsValue>,Action<JsValue>)? var resultType = type.GetGenericArguments()[0]; var completionSourceType = typeof(TaskCompletionSource <>).MakeGenericType(resultType); var tcs = Activator.CreateInstance(completionSourceType); var resolve = Delegate.CreateDelegate(typeof(Action <>).MakeGenericType(resultType), tcs, completionSourceType.GetMethod(nameof(TaskCompletionSource <object> .SetResult))); var reject = new Action <object>(error => { completionSourceType.GetMethod(nameof(TaskCompletionSource <object> .SetException)) .Invoke(tcs, new object[] { GetExceptionFromPromiseRejection(error) }); }); var thenResult = _host.Invoke(thenHandle, Handle, 2, new[] { DotNetValue.FromDelegate(resolve, _host), DotNetValue.FromDelegate(reject, _host) }); // DM 29.11.2019: thenResult is always another promise _host.Release(thenResult); result = completionSourceType.GetProperty(nameof(TaskCompletionSource <object> .Task)) .GetValue(tcs); return(true); } else { var tcs = new TaskCompletionSource <object>(); var thenResult = _host.Invoke(thenHandle, Handle, 2, new DotNetValue[] { DotNetValue.FromDelegate(new Action(() => tcs.SetResult(null)), _host), DotNetValue.FromDelegate(new Action <object>((error) => { tcs.SetException(GetExceptionFromPromiseRejection(error)); }), _host) }); // DM 29.11.2019: thenResult is always another promise _host.Release(thenResult); result = tcs.Task; return(true); } } } finally { _host.Release(thenHandle); } result = null; return(false); } if (typeof(Exception).IsAssignableFrom(type)) { dynamic dynamic = this; string stack = dynamic.stack; if (stack != null) { result = new InvalidOperationException($"JS Error:\n{stack}"); return(true); } result = null; return(false); } if (type.IsArray) { var innerType = type.GetElementType(); if (TryConvertToArray(innerType, out result)) { return(true); } result = null; return(false); } if (type.IsGenericType && type.IsInterface) { var unclosed = type.GetGenericTypeDefinition(); if (unclosed == typeof(IEnumerable <>) || unclosed == typeof(IReadOnlyCollection <>)) { var innerType = type.GetGenericArguments()[0]; if (TryConvertToArray(innerType, out result)) { return(true); } } result = null; return(false); } // TODO DM 17.05.2020: This dependency is unwanted (circular), we should use opend/closed for type conversion if (type == typeof(ArrayBuffer)) { if (_host.TryAccessArrayBuffer(Handle, out var address, out var byteLength)) { result = new ArrayBuffer(address, byteLength, this); return(true); } result = null; return(false); } result = null; return(false); }
public StreamBufferedReader(IAsyncInputStream stream, int bufferSize) { buffer = new ArrayBuffer(bufferSize); args = new BufferFilledEventArgs(buffer); this.asyncStream = stream; }
public void ByteLengthPropertyWorks() { var buf = new ArrayBuffer(10); Assert.AreEqual(10, buf.ByteLength, "ByteLength"); }
public void Write_Fills_Full_Buffer() { var buffer = new ArrayBuffer(bufferSize); byte[] data = GenerateData(bufferSize); int count = data.Length / 2; buffer.Write(data, 0, count); buffer.Write(data, count, count); VerifyBufferData(buffer, data, 0, count * 2); Assert.That(buffer.Length, Is.EqualTo(count * 2)); }
public static void ArrayBufferOut(out Puerts.ArrayBuffer value) { byte[] bytes = { 1 }; value = new ArrayBuffer(bytes); }
public void Write_Throws_Exception_If_Count_Greater_Then_Available_Buffer() { byte[] data = GenerateData(bufferSize - 2); var buffer = new ArrayBuffer(bufferSize); buffer.Write(data, 0, data.Length); Assert.That(() => buffer.Write(data, 0, data.Length), Throws.InstanceOf<ArgumentException>()); }
public static void ArrayBufferRef(ref Puerts.ArrayBuffer value) { byte[] bytes = { 1 }; value = new ArrayBuffer(bytes); /*一时没想到怎么修改ab,先留着*/ }
private void VerifyBufferData(ArrayBuffer buffer, byte[] expectedData, int offset, int count) { for (int i = 0; i < count; i++) { Assert.That(buffer[i], Is.EqualTo(expectedData[i + offset])); } }
public Blob(ArrayBuffer[] arrayBuffer) { }
protected override IReadOnlyCollection<T> Complete(ref ArrayBuffer<T> intermediateCollection) { return intermediateCollection.ToArray(); }
protected BaseBuffer(CSGL gl,ArrayBuffer BufferType,float[] BufferData,Usage Use) : base(gl) { U = Use; Data = BufferData; BType = BufferType; T = DataType.Float; Initial(); }
/// <summary> /// Creates a new Uint8ClampedArray out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Uint8ClampedArray(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }
public T[,,,] Deserialize(ref JsonReader reader, IJsonFormatterResolver formatterResolver) { if (reader.ReadIsNull()) { return(null); } var buffer = new ArrayBuffer <ArrayBuffer <ArrayBuffer <ArrayBuffer <T> > > >(4); var formatter = formatterResolver.GetFormatterWithVerify <T>(); var guessInnerLength3 = 0; var guessInnerLength2 = 0; var guessInnerLength = 0; var outerCount = 0; reader.ReadIsBeginArrayWithVerify(); while (!reader.ReadIsEndArrayWithSkipValueSeparator(ref outerCount)) { var innerArray = new ArrayBuffer <ArrayBuffer <ArrayBuffer <T> > >(guessInnerLength == 0 ? 4 : guessInnerLength); var innerCount = 0; reader.ReadIsBeginArrayWithVerify(); while (!reader.ReadIsEndArrayWithSkipValueSeparator(ref innerCount)) { var innerArray2 = new ArrayBuffer <ArrayBuffer <T> >(guessInnerLength2 == 0 ? 4 : guessInnerLength2); var innerCount2 = 0; reader.ReadIsBeginArrayWithVerify(); while (!reader.ReadIsEndArrayWithSkipValueSeparator(ref innerCount2)) { var innerArray3 = new ArrayBuffer <T>(guessInnerLength3 == 0 ? 4 : guessInnerLength3); var innerCount3 = 0; reader.ReadIsBeginArrayWithVerify(); while (!reader.ReadIsEndArrayWithSkipValueSeparator(ref innerCount3)) { innerArray3.Add(formatter.Deserialize(ref reader, formatterResolver)); } guessInnerLength3 = innerArray3.Size; innerArray2.Add(innerArray3); } guessInnerLength2 = innerArray2.Size; innerArray.Add(innerArray2); } guessInnerLength = innerArray.Size; buffer.Add(innerArray); } var t = new T[buffer.Size, guessInnerLength, guessInnerLength2, guessInnerLength3]; for (int i = 0; i < buffer.Size; i++) { for (int j = 0; j < guessInnerLength; j++) { for (int k = 0; k < guessInnerLength2; k++) { for (int l = 0; l < guessInnerLength3; l++) { t[i, j, k, l] = buffer.Buffer[i].Buffer[j].Buffer[k].Buffer[l]; } } } } return(t); }
public void Read_Returns_Correct_ArraySegment() { byte[] bufferData = { 0, 1, 2, 3 }; int bufferOffset = 1; var buffer = new ArrayBuffer(bufferData, bufferOffset, bufferData.Length - bufferOffset); int readCount = 3; var data = buffer.Read(readCount); Assert.That(buffer.Length, Is.EqualTo(bufferData.Length - bufferOffset - readCount)); Assert.That(data.Offset, Is.EqualTo(bufferOffset)); Assert.That(data.Count, Is.EqualTo(readCount)); var expectedData = bufferData.Skip(bufferOffset).Take(readCount); var actualData = data.Array.Skip(bufferOffset).Take(readCount); CollectionAssert.AreEqual(expectedData, actualData); }
public Uint8Array(ArrayBuffer buffer) : base(nameof(Uint8Array), buffer) { }
public Blob(ArrayBuffer[] arrayBuffer, object propertyBag) { }
public Uint8Array(ArrayBuffer buffer, int byteOffset) : base(nameof(Uint8Array), buffer, byteOffset) { }
protected BaseBuffer(CSGL gl,ArrayBuffer BufferType,double[] BufferData,Usage Use) : base(gl) { U = Use; Data = BufferData; BType = BufferType; T = DataType.Double; Initial(); }
public Uint8Array(ArrayBuffer buffer, int byteOffset, int length) : base(nameof(Uint8Array), buffer, byteOffset, length) { }
public void bufferData(GLenum target, ArrayBuffer data, GLenum usage) { Invoke("bufferData", target, data.Object, usage); }
/// <summary> /// Creates a new Float32Array out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Float32Array(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }
/// <summary> /// Creates a new buffer and adds the segments to the buffer pool. /// </summary> private void CreateBuffer() { // create a new buffer var newBuf = new ArrayBuffer(this, _segmentCount * _segmentSize); // create segments from the buffer for (int i = 0; i < _segmentCount; i++) { _availableSegments.Enqueue(new BufferSegment(newBuf, i * _segmentSize, _segmentSize, _segmentId++)); } // increment our total count _totalSegmentCount += _segmentCount; // hold a ref to our new buffer _buffers.Add(newBuf); // update global alloc'd memory Interlocked.Add(ref GlobalAllocatedMemory, _segmentCount * _segmentSize); }
public VertexArrays CreateArrays(ObjContext objContext) { if (objContext == null) { throw new ArgumentNullException("objContext"); } VertexArrays vertexArray = new VertexArrays(); List <ObjFaceCoord> coords = new List <ObjFaceCoord>(); bool hasTexCoord = Material.DiffuseTexture != null; bool hasNormals = false; bool hasTanCoord = hasTexCoord && Material.NormalTexture != null; foreach (ObjFace f in Faces) { hasTexCoord |= f.HasTexCoord; hasNormals |= f.HasNormal; coords.AddRange(f.Triangulate()); } uint vertexCount = (uint)coords.Count; Vertex4f[] position = new Vertex4f[vertexCount]; Vertex3f[] normal = hasNormals ? new Vertex3f[vertexCount] : null; Vertex2f[] texcoord = new Vertex2f[vertexCount]; for (int i = 0; i < position.Length; i++) { Debug.Assert(coords[i].VertexIndex < objContext.Vertices.Count); position[i] = objContext.Vertices[coords[i].VertexIndex]; if (hasTexCoord) { Debug.Assert(coords[i].TexCoordIndex < objContext.TextureCoords.Count); texcoord[i] = objContext.TextureCoords[coords[i].TexCoordIndex]; } if (hasNormals) { Debug.Assert(coords[i].NormalIndex < objContext.Normals.Count); normal[i] = objContext.Normals[coords[i].NormalIndex]; } } // Position (mandatory) ArrayBuffer <Vertex4f> positionBuffer = new ArrayBuffer <Vertex4f>(); positionBuffer.Create(position); vertexArray.SetArray(positionBuffer, VertexArraySemantic.Position); // Layout (triangles) vertexArray.SetElementArray(PrimitiveType.Triangles); // Texture if (hasTexCoord) { ArrayBuffer <Vertex2f> texCoordBuffer = new ArrayBuffer <Vertex2f>(); texCoordBuffer.Create(texcoord); vertexArray.SetArray(texCoordBuffer, VertexArraySemantic.TexCoord); } // Normals if (hasNormals) { ArrayBuffer <Vertex3f> normalBuffer = new ArrayBuffer <Vertex3f>(); normalBuffer.Create(normal); vertexArray.SetArray(normalBuffer, VertexArraySemantic.Normal); } else { ArrayBuffer <Vertex3f> normalBuffer = new ArrayBuffer <Vertex3f>(); normalBuffer.Create(vertexCount); vertexArray.SetArray(normalBuffer, VertexArraySemantic.Normal); // XXX vertexArray.GenerateNormals(); } // Tangents if (hasTanCoord) { ArrayBuffer <Vertex3f> tanCoordBuffer = new ArrayBuffer <Vertex3f>(); tanCoordBuffer.Create(vertexCount); vertexArray.SetArray(tanCoordBuffer, VertexArraySemantic.Tangent); ArrayBuffer <Vertex3f> bitanCoordBuffer = new ArrayBuffer <Vertex3f>(); bitanCoordBuffer.Create(vertexCount); vertexArray.SetArray(bitanCoordBuffer, VertexArraySemantic.Bitangent); // XXX vertexArray.GenerateTangents(); } return(vertexArray); }
/// <summary> /// Returns a new DataView object using the passed ArrayBuffer for its storage. /// </summary> /// <param name="buffer">An existing ArrayBuffer to use as the storage for the new DataView object.</param> public DataView(ArrayBuffer buffer) { }
private void VisionControl_ContextCreated(object sender, OpenGL.GlControlEventArgs e) { // Create GL context abstraction _GraphicsContext = new GraphicsContext(e.DeviceContext, e.RenderContext); // Create texture _FramebufferTexture = new Texture2d(1024, 1024, PixelLayout.RGB24); _FramebufferTexture.SamplerParams.MagFilter = TextureMagFilter.Linear; _FramebufferTexture.SamplerParams.MinFilter = TextureMinFilter.Linear; _FramebufferTexture.Create(_GraphicsContext); // Create framebuffer _Framebuffer = new Framebuffer(); _Framebuffer.AttachColor(0, _FramebufferTexture); _Framebuffer.Create(_GraphicsContext); // Create shader (standard) _ProgramStd = _GraphicsContext.CreateProgram("OpenGL.Standard"); _ProgramStd.Create(_GraphicsContext); // Create program (standard + texture) _ProgramStdTex = _GraphicsContext.CreateProgram("OpenGL.Standard+Texture"); _ProgramStdTex.Create(_GraphicsContext); // Create vertex arrays (square) ArrayBuffer <Vertex2f> quadBuffer = new ArrayBuffer <Vertex2f>(BufferUsage.StaticDraw); quadBuffer.Create(new Vertex2f[] { new Vertex2f(-0.5f, +0.5f), new Vertex2f(-0.5f, -0.5f), new Vertex2f(+0.5f, +0.5f), new Vertex2f(+0.5f, -0.5f), }); _ArraysQuad = new VertexArrays(); _ArraysQuad.SetArray(quadBuffer, VertexArraySemantic.Position); _ArraysQuad.SetElementArray(PrimitiveType.TriangleStrip); _ArraysQuad.Create(_GraphicsContext); // Create vertex arrays (square) ArrayBuffer <Vertex2f> postquadBuffer = new ArrayBuffer <Vertex2f>(BufferUsage.StaticDraw); postquadBuffer.Create(new Vertex2f[] { new Vertex2f(0.0f, 1.0f), new Vertex2f(0.0f, 0.0f), new Vertex2f(1.0f, 1.0f), new Vertex2f(1.0f, 0.0f), }); _ArraysPostQuad = new VertexArrays(); _ArraysPostQuad.SetArray(postquadBuffer, VertexArraySemantic.Position); _ArraysPostQuad.SetArray(postquadBuffer, VertexArraySemantic.TexCoord); _ArraysPostQuad.SetElementArray(PrimitiveType.TriangleStrip); _ArraysPostQuad.Create(_GraphicsContext); // Create vertex arrays (optical markers) _BufferOpticalMarkers = new ArrayBuffer <Vertex2f>(BufferUsage.DynamicDraw); _BufferOpticalMarkers.Create(10000 * 2); _ArraysOpticalMarkers = new VertexArrays(); _ArraysOpticalMarkers.SetArray(_BufferOpticalMarkers, VertexArraySemantic.Position); _ArraysOpticalMarkers.SetElementArray(PrimitiveType.Lines); _ArraysOpticalMarkers.Create(_GraphicsContext); }
/// <summary> /// Returns a new DataView object using the passed ArrayBuffer for its storage. /// </summary> /// <param name="buffer">An existing ArrayBuffer to use as the storage for the new DataView object.</param> /// <param name="byteOffset">The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the view of the buffer will start with the first byte.</param> /// <param name="byteLength">The number of elements in the byte array. If unspecified, length of the view will match the buffer's length.</param> public DataView(ArrayBuffer buffer, long byteOffset, long byteLength) { }
public ArrayBuffer TestArrayBuffer(ArrayBuffer array) { return(array); }
public AudioBuffer createBuffer(ArrayBuffer buffer, bool mixToMono) { return default(AudioBuffer); }
public static void DataViewArrayBuffer(ArrayBuffer buffer) { var x = new DataView(buffer); Assert.True(buffer == x.Buffer); }
public static void DataViewByteLength(ArrayBuffer buffer) { var x = new DataView(buffer, 4, 2); Assert.Equal(2, x.ByteLength); }
public void WriteByte_Writes_Byte_Into_Buffer() { var buffer = new ArrayBuffer(bufferSize); byte @byte = 101; buffer.WriteByte(@byte); Assert.That(buffer.Length, Is.EqualTo(1)); Assert.That(buffer[0], Is.EqualTo(@byte)); }
/// <summary> /// Creates a new Uint32Array out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Uint32Array(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }
/// <summary> /// Creates a new Int16Array out of the specified buffer and byteOffset with the specified length. /// </summary> /// <param name="buffer">Arraybuffer to use as base for contents.</param> /// <param name="byteOffset">Optional. Position in the buffer to start reading data from.</param> /// <param name="length">Optional. Number of elements to consider while creating the array.</param> public Int16Array(ArrayBuffer buffer, uint byteOffset = 0, uint length = 0) { }