-
Notifications
You must be signed in to change notification settings - Fork 0
module core
Tianshu Huang edited this page Oct 22, 2018
·
3 revisions
| Slack | Github | |
|---|---|---|
| Tianshu | @thetianshuhuang | @thetianshuhuang |
For a complete description, see the rust doc (cargo build).
Todo (image ingest routines and python interface TBD)
The image data type is given as an Image struct:
pub struct Image {
width: u32,
height: u32,
data: Vec<u32>
}Width and height store the dimensions of the image, while the data is contained in a flattened, packed 32-bit vector (see the algorithms notes for a more detailed description).
Access pixels with Image.acess(x, y) or Image.unpack(idx). This returns a Pixel struct:
pub struct Pixel { h: i32, s: i32, v: i32, mask: i32 }In order to write back to the image, use Image.pack(pixel, idx) to pack the pixel and return it to the source image.