dojo.require(esri.layers.PixelBlock");
Description
(Added at v3.13)
The PixelBlock is used to hold pixels. It stores and decodes source data fetched from an image service.
Samples
Search for
samples that use this class.
Constructors
Properties
Methods
Constructor Details
Creates a new PixelBlock object.
Parameters:
<Object > options |
Required |
Constructor parameters. See options list below. |
options
properties:
<Number > height |
Required |
Number of rows. |
<Array > mask |
Optional |
An array of nodata mask. The size is height*width. It's arranged row by row in this format: [p_00, p_10, p_20, ... p_10, p_11, .....]. p_xy means pixel value at the column x row y. The mask is per pixel, not per band. |
<String > pixelType |
Optional |
Pixel type. Known values include "S8" | "S16" | "S32" | "U8" | "U16" | "U32" | "F32" | "F64" |
<Number[][] > pixels |
Required |
A two dimensional array. The first dimension is number of bands, the second dimension is height * width. The band x is pixels[x-1]. For each band pixels[x], the size is height*width. It's arranged row by row in this format: [p_00, p_10, p_20, ... p_10, p_11, .....]. p_xy means pixel value at the column x row y. |
<Object[] > statistics |
Optional |
Array of objects containing numeric statistical properties (for example minValue, maxValue, noDataValue, etc.). |
<Number > width |
Required |
Number of columns. |
Property Details
An array of nodata mask. The size is height*width. It's arranged row by row in this format: [p_00, p_10, p_20, ... p_10, p_11, .....]. p_xy means pixel value at the column x row y. The mask is per pixel, not per band.
Pixel type.
Known values: "S8" | "S16" | "S32" | "U8" | "U16" | "U32" | "F32" | "F64"
A two dimensional array representing the pixels from the Image Service displayed on the client. The first dimension is number of bands, the second dimension is height * width. The band x is pixels[x-1]. For each band pixels[x], the size is height*width. It's arranged row by row in this format: [p_00, p_10, p_20, ... p_10, p_11, .....]. p_xy means pixel value at the column x row y.
Array of objects containing numeric statistical properties (for example minValue, maxValue, noDataValue, etc.).
Method Details
Adds another plane. The planData
parameter needs to have two properties set: pixels and statistics.
Parameters:
<Object > planeData |
Required |
Must have two properties set: pixels and statistics . |
Object Specifications: <planeData
>
<Number[][] > pixels |
Required |
A two dimensional array. The first dimension is number of bands, the second dimension is height * width. |
<Object[] > statistics |
Required |
Array of objects containing numeric statistical properties (for example minValue, maxValue, noDataValue, etc.). |
Returns pixels and masks using a single array in bip format (for example [p_00_r, p_00_g, p_00_b, p_00_a, p_10_r, p_10_g, p_10_b, p_10_a, .....]
). Use this method to get an unsigned 8 bit pixel array. The result can be used to create a webgl texture.
Similar to getAsRGBA, but returns floating point data. The result can be used to create a webgl texture (OES_texture_float).
Returns the plane band count.