Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web application site fix (Part - 30) Part 2 #2006

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/application/web/guides/w3c/supplement/typedarray.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Typed Array - Khronos is an HTML5 feature that allows you to access binary data in JavaScript. It is designed to effectively handle the complex binary data of WebGL™. It provides better performance than the WebGL - Khronos API (in [mobile](../../../api/latest/w3c_api/w3c_api_m.html#webgl), [wearable](../../../api/latest/w3c_api/w3c_api_w.html#webgl), and [TV](../../../api/latest/w3c_api/w3c_api_tv.html#webgl) applications) when manipulating binary data and handling the data of other HTML APIs.

The main features of the Typed Array - Khronos API include:
The main features of the Typed Array - Khronos API include the following:

- Creating an array buffer

Expand All @@ -28,11 +28,11 @@ A typed array is capable of handling binary data in different sources:

Additionally, a typed array can be used to manage in-memory binary data of byte layouts, and assist in efficiently manipulating raw data for complex and powerful Web applications, such as audio and video operation, Web sockets, and the [File API operations](../../data/file-system.md).

## Creating an Array Buffer
## Create an array buffer

To handle binary data in your application with JavaScript, you must learn to create array buffers:

1. Create a new [ArrayBuffer](http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor) with a specific length:
1. Create a new [ArrayBuffer](http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor){:target="_blank"} with a specific length:

```
<script>
Expand Down Expand Up @@ -69,11 +69,11 @@ To handle binary data in your application with JavaScript, you must learn to cre

![Creating and slicing array buffers (in mobile applications only)](./media/arraybuffer.png)

### Source Code
### Source code

For the complete source code related to this use case, see the following file:

- [sample_1.html](http://download.tizen.org/misc/examples/w3c_html5/graphics/khronos_typed_array)
- [sample_1.html](http://download.tizen.org/misc/examples/w3c_html5/graphics/khronos_typed_array){:target="_blank"}

## Creating Typed Array Views

Expand Down Expand Up @@ -103,7 +103,7 @@ The array buffer view shares information between views of all types, and has the

<sup>2</sup> The `Uint8ClampedArray` is a special view, and it replaces the `CanvasPixelArray`.

> **Note**
> [!NOTE]
> There are no restrictions related to sorting the typed array view types.

- DataView view types
Expand Down Expand Up @@ -137,7 +137,7 @@ To handle binary data in your application with JavaScript, you must learn to acc
</script>
```

> **Note**
> [!NOTE]
maliha-srbd marked this conversation as resolved.
Show resolved Hide resolved
> In the above code, to access a buffer with an array of 16-bit signed integers, use the `Int16Array` instance that references an array buffer.

2. Create a typed array view:
Expand Down Expand Up @@ -218,15 +218,15 @@ To handle binary data in your application with JavaScript, you must learn to acc
The `DataView` stores the values of the given type at the specified byte offset from the start of the view. Moreover, alignment is not a constraint, and it can store the multi-byte values at any offset. For multi-byte values, the optional `littleEndian` argument indicates that the value can be stored in a big-endian or little-endian byte order. If the argument is set to `false` or is undefined, the value gets stored in the big-endian byte order.
![DataView](./media/data_view.png)

### Source Code
### Source code

For the complete source code related to this use case, see the following files:

- [sample_2.html](http://download.tizen.org/misc/examples/w3c_html5/graphics/khronos_typed_array)
- [sample_3.html](http://download.tizen.org/misc/examples/w3c_html5/graphics/khronos_typed_array)
- [sample_4.html](http://download.tizen.org/misc/examples/w3c_html5/graphics/khronos_typed_array)

## Using Typed Arrays
## Use typed arrays

To handle binary data in your application with JavaScript, you must learn to deliver binary data effectively in other HTML5 APIs that employ a typed array:

Expand Down Expand Up @@ -265,7 +265,7 @@ To handle binary data in your application with JavaScript, you must learn to del
</script>
```

> **Note**
> [!NOTE]
> The pixel array of a canvas can be created and edited without direct manipulation of the canvas element.

3. For the XMLHttpRequest API (in [mobile](../../../api/latest/w3c_api/w3c_api_m.html#httpreq), [wearable](../../../api/latest/w3c_api/w3c_api_w.html#httpreq), and [TV](../../../api/latest/w3c_api/w3c_api_tv.html#httpreq) applications), set the response type of the `XMLHttpRequest` object as `arraybuffer` to receive a typed array response. This allows you to parse the binary file through the network.
Expand All @@ -283,7 +283,7 @@ To handle binary data in your application with JavaScript, you must learn to del
};
```

## Related Information
## Related information
* Dependencies
- Tizen 2.4 and Higher for Mobile
- Tizen 2.3.1 and Higher for Wearable
Expand Down