Pythonic API for the framewave SIMD library
Project description
************************************************
:mod:`motmot.FastImage` -- SIMD image processing
************************************************
.. module:: motmot.FastImage.FastImage
:synopsis: SIMD image processing
.. index::
module: FastImage
single: FastImage
Description
===========
FastImage implements low-level image processing operations designed to
operate very quickly by using SIMD instructions. This is achieved by
calling the Framewave__ library. A bridge to numpy is made through the
`array interface`__.
__ http://framewave.sourceforge.net/
__ http://docs.scipy.org/doc/numpy/reference/arrays.interface.html
Allocation of aligned memory
============================
For the SIMD instructions to perform at maximal speed, images must be
aligned on 32-byte boundaries. FastImage relies on the underlying
image processing library to allocate the memory, trusting that it
knows best::
import motmot.FastImage.FastImage as FastImage
import numpy as np
# Allocate the image
fi_im1 = FastImage.FastImage8u( FastImage.Size(4,5) ) # width, height
# Get a numpy view
im1 = np.asarray( fi_im1 )
assert im1.shape == (5,4) # height, width
In the above example, im1.strides will be (32,1), indicating that each
row is aligned on a 32 byte boundary.
:mod:`motmot.FastImage` -- SIMD image processing
************************************************
.. module:: motmot.FastImage.FastImage
:synopsis: SIMD image processing
.. index::
module: FastImage
single: FastImage
Description
===========
FastImage implements low-level image processing operations designed to
operate very quickly by using SIMD instructions. This is achieved by
calling the Framewave__ library. A bridge to numpy is made through the
`array interface`__.
__ http://framewave.sourceforge.net/
__ http://docs.scipy.org/doc/numpy/reference/arrays.interface.html
Allocation of aligned memory
============================
For the SIMD instructions to perform at maximal speed, images must be
aligned on 32-byte boundaries. FastImage relies on the underlying
image processing library to allocate the memory, trusting that it
knows best::
import motmot.FastImage.FastImage as FastImage
import numpy as np
# Allocate the image
fi_im1 = FastImage.FastImage8u( FastImage.Size(4,5) ) # width, height
# Get a numpy view
im1 = np.asarray( fi_im1 )
assert im1.shape == (5,4) # height, width
In the above example, im1.strides will be (32,1), indicating that each
row is aligned on a 32 byte boundary.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
motmot.FastImage-0.5.5.zip
(33.3 kB
view details)
motmot.FastImage-0.5.5.tar.gz
(25.8 kB
view details)
File details
Details for the file motmot.FastImage-0.5.5.zip
.
File metadata
- Download URL: motmot.FastImage-0.5.5.zip
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 396e45bcc4217530c61f10b80e39bd250aac2779687cd1f3ec96e5a06c48d781 |
|
MD5 | 5d58e639e3a739f5bb44989ba6bc1a61 |
|
BLAKE2b-256 | 05e6944e992c168a4bd93a50a02d2a6e85ac636576df9efb7083c47d6e170a92 |
File details
Details for the file motmot.FastImage-0.5.5.tar.gz
.
File metadata
- Download URL: motmot.FastImage-0.5.5.tar.gz
- Upload date:
- Size: 25.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6e31f6377514a5615f714474be934651148bdbec6195d27d9cb2dc4f1ea632 |
|
MD5 | e20c214dd917605817642ddf498293fc |
|
BLAKE2b-256 | 314d4b7b08c595d56beb8837f383bd9a5bfbe3e02f9a033a4dbb2624ceb7683e |