|
I32 | ImageAllocateEdge (image *src, image *dst, I32 edgeX, I32 edgeY) |
| Allocates a New Image With Padding Content from Originating Image. More...
|
|
void | ImageAssign_Bayer (image *img) |
| Assigns a correct aligned IMAGE_BAYER Image with maximum dimension. More...
|
|
I32 | ImageROI (image *roi, I8 copyIff1, image *src, I32 x0, I32 y0, I32 dx, I32 dy) |
| Gets a Sub-Region of an Image. More...
|
|
I32 | ImageOffset (I32 *x0, I32 *y0, image *roi, I32 chRoi, image *src, I32 chSrc) |
| Gets the Offset for a Sub-Region of an Image. More...
|
|
#define | rlcmalloc(x) (U16 *)sysmalloc((x+1)/2, MDATA) |
| Allocation Helper for RLC Data. More...
|
|
#define | rlcfree(x) sysfree((void *)x) |
| Frees Memory from RLC Data. More...
|
|
U8 * | ImageAllocate (image *img, U32 type, U32 dx, U32 dy) |
| Allocates Memory for an Image. More...
|
|
void | ImageFree (image *img) |
| Release Memory for an Image Variable. More...
|
|
Functions in this group provide methods for memory management.
◆ rlcmalloc
#define rlcmalloc |
( |
|
x | ) |
(U16 *)sysmalloc((x+1)/2, MDATA) |
The macro returns a pointer to a heap memory area for size
RLC Items (U16).
◆ rlcfree
#define rlcfree |
( |
|
x | ) |
sysfree((void *)x) |
The macro simply calls sysfree().
◆ ImageAllocate()
This function allocates memory for an image and sets the image variable struct components to the appropriate values. type
is the image type, dx
and dy
are the horizontal and vertical dimensions of the image. The function allocates memory for a tight storage, i.e. img->pitch is set to dx
.
type | Definition | Image Type | Memory Requirement | st | ccmp1 | ccmp2 |
0 | IMAGE_GREY | Grey-Scale Image (U8) | 1 * dy * pitch | grey | — | — |
1 | IMAGE_BAYER | Bayer Pattern | 1 * dy * pitch | bayer | — | — |
2 | IMAGE_RGB | Color Image RGB | 3 * dy * pitch | red | green | blue |
3 | IMAGE_CBCR444 | Color Image YCbCr 4:4:4 | 3 * dy * pitch | y | u | v |
4 | IMAGE_CBCR411 | Color Image YCbCr 4:1:1 | 3/2 * dy * pitch | y | u | v |
5 | IMAGE_YUVNORM | Normalized YcbCr 4:4:4 | 3 * dy * pitch | y | u* | v* |
6 | IMAGE_IHS | Color Image IHS (HSI) | 3 * dy * pitch | i | h | s |
7 | IMAGE_RGBO | Reserved | — | — | — | — |
8 | IMAGE_VECTOR | Vector Image | 2 * dy * pitch | mag | dir | — |
9 | IMAGE_GREY16 | Grey-Scale Image (U16) | 2 * dy * pitch | grey | — | — |
10 | IMAGE_GREY32 | Grey-Scale Image (U32) | 4 * dy * pitch | grey | — | — |
11 | IMAGE_CMPLX16 | Complex Valued Image | 4 * dy * pitch | cmplx | — | — |
13 | IMAGE_CBCR422 | Color Image YCbCr 4:2:2 | 2 * dy * pitch | y | u | v |
14 | IMAGE_YCBYCR | Reserved | — | — | — | — |
The function returns the start address of the memory block allocated. If out of memory, the NULL pointer is returned.
- Parameters
-
img | Destination Image Pointer. |
type | Types of Image Data. |
dx | Horizontal Pixel Count. |
dy | Vertical Pixel Count. |
- Memory Consumption
- See Tabular.
- See also
- ImageFree().
- Return values
-
NULL | on Allocation Failure. |
Address | Pointer of the New Allocated Memory (equals img->st). |
NULL | on Allocation Failure. |
Address | Pointer of the New Allocated Memory (equals img->st). |
◆ ImageAllocateEdge()
Allocates a new image consisting of an additional padding region around the contents of the given image.
The padding region is being filled with the color of the next lying horizontal or vertical pixel.
- Parameters
-
src | Source Image Pointer, Type: IMAGE_GREY. |
dst | Destination Image Pointer, Type: IMAGE_GREY. |
edgeX | Pixel Count added left and right. |
edgeY | Pixel Count added top and bottom. |
- Returns
- Standard Error Code.
- Return values
-
ERR_MEMORY | iff Memory could not be allocated. |
ERR_NONE | iff OK. |
◆ ImageFree()
void ImageFree |
( |
image * |
img | ) |
|
◆ ImageAssign_Bayer()
void ImageAssign_Bayer |
( |
image * |
img | ) |
|
This function assigns an image of type IMAGE_BAYER with respect to the sensor Bayer pattern alignment. This is necessary, since depending on the sensor type, the first pixel may be non-red which is to be guaranteed for our functions to work properly. The image has the maximum possible size. Due to realignment the result image dx
and/or dy
values may be one pixel smaller than the total sensor size.
- Parameters
-
◆ ImageROI()
This functions gets a sub-region of a given image. Depending on the input image type, x0
, y0
, dx
, dy
may be divideable by 2. If copyIff1
is set to one, it is assumed, that roi
is pre-allocated, and the copy routine will be called. Else it is assumed, that roi
is only used to reference the src
image memory directly, and the st
, ccmp1
, ccmp2
will point to the src
image data.
- Parameters
-
roi | Output Image. |
copyIff1 | If 1: src Content is copied, else roi refers to src data. |
src | Input Image. |
x0,y0,dx,dy | Output ROI at the source image, may be needed to be divideable by 2. |
- Return values
-
ERR_PARAM | if either of x0 , y0 , dx , dy is smaller than 0 or needed to be divideable by 2 by input image type. |
ERR_BOUNDS | if ROI exceeds source image. |
ERR_TYPE | on source image type error. |
copy() | if copy() fails. |
◆ ImageOffset()
This functions gets the offset for a sub-region of a given image. As Formula:
addrDiff = (roiAddrOfCh - srcAddrOfCh)/srcPxBytes;
x0 = (addrDiff<0) ? ((addrDiff % srcPitch + srcPitch)%srcPitch) : (addrDiff%srcPitch);
y0 = (addrDiff<0) ? ((addrDiff + 1 - srcPitch)/srcPitch) : (addrDiff/srcPitch);
- Parameters
-
x0,y0 | Output Offset of the image roi to the image src. |
roi,src | Input Images. |
chRoi,chSrc | Channels of images which are used for calculation. |
- Return values
-
ERR_TYPE | on source image type discrepance, or unsupported type. |
ERR_PARAM | on channel selector range failure. |