image.h File Reference
#include "fvstypes.h"
Go to the source code of this file.
|
Typedefs |
typedef FvsHandle_t | FvsImage_t |
Enumerations |
enum | FvsImageFlag_t { FvsImageGray = 0,
FvsImageBinarized = 1,
FvsImageThinned = 2
} |
Functions |
FvsImage_t | ImageCreate (void) |
void | ImageDestroy (FvsImage_t image) |
FvsError_t | ImageSetSize (FvsImage_t image, const FvsInt_t width, const FvsInt_t height) |
FvsError_t | ImageSetFlag (FvsImage_t image, const FvsImageFlag_t flag) |
FvsImageFlag_t | ImageGetFlag (const FvsImage_t image) |
FvsError_t | ImageCopy (FvsImage_t destination, const FvsImage_t source) |
FvsError_t | ImageClear (FvsImage_t image) |
FvsError_t | ImageFlood (FvsImage_t image, const FvsByte_t value) |
void | ImageSetPixel (FvsImage_t image, const FvsInt_t x, const FvsInt_t y, const FvsByte_t val) |
FvsByte_t | ImageGetPixel (const FvsImage_t image, const FvsInt_t x, const FvsInt_t y) |
FvsByte_t * | ImageGetBuffer (FvsImage_t image) |
FvsInt_t | ImageGetWidth (const FvsImage_t image) |
FvsInt_t | ImageGetHeight (const FvsImage_t image) |
FvsInt_t | ImageGetPitch (const FvsImage_t image) |
FvsInt_t | ImageGetSize (const FvsImage_t image) |
FvsBool_t | ImageCompareSize (const FvsImage_t image1, const FvsImage_t image2) |
Typedef Documentation
|
The implementation of the object is private and must not be known by the user. Use this handle to manipulate the file through the functions provided hereunder. |
Enumeration Type Documentation
|
Flags that define what for properties the image has. These flags are managed automatically by the library on some function calls. You may also set them by yourself if you know what you are doing. These flags will empeach some functions that only work with thinned images to end with a crash or incoherent results.
- Todo:
- implement...
- Enumeration values:
-
FvsImageGray |
no special properties, 8 bit gray level |
FvsImageBinarized |
marks a binarized image |
FvsImageThinned |
marks a thinned image |
|
Function Documentation
|
Create a new image object. - Returns:
- NULL if allocation failed, otherwise a new object handle.
|
|
Destroy an image object. - Parameters:
-
image | pointer to an image object |
- Returns:
- nothing.
|
|
Set the size if an image. The memory allocation is done automatically when needed and the function returns an error if it failed. - Parameters:
-
image | an image object |
width | width in pixels |
height | height in pixels |
- Returns:
- an error code.
|
|
Set the current image flag. It should only be used in special cases, the flag will mostly be set automatically by the library. - Parameters:
-
- Returns:
- An error code
|
|
Retrieve the current image flag. - Parameters:
-
- Returns:
- The flag associated with the image
|
|
Copy a source image into a destination image. The memory allocation and resizing is done automatically when needed. - Parameters:
-
destination | a destination image object |
source | a source image object |
- Returns:
- an error code.
|
|
Clear an image. Resets the contents of an image to zero. - Parameters:
-
- Returns:
- an error code.
|
|
Set all pixels in the image to a specific value. - Parameters:
-
image | an image object |
value | the value of every pixel after the call |
- Returns:
- an error code.
|
|
Set a pixel value in the picture. - Parameters:
-
image | an image object |
x | x-coordinate |
y | y-coordinate |
val | value to set |
- Returns:
- nothing
|
|
This function returns the pixel for the x and y value. - Parameters:
-
image | an image object |
x | x-coordinate |
y | y-coordinate |
- Returns:
- the pixel value
|
|
Returns a pointer to the image buffer. - Parameters:
-
- Returns:
- a pointer to the beginning of the memory buffer
|
|
Retrieve the image width. - Parameters:
-
- Returns:
- the width in pixels
|
|
Retrieve the image height. - Parameters:
-
- Returns:
- the heigth in pixels
|
|
Get the pitch. The pitch of an image is not necessary the width of the image. In the image, pixel(x,y) position in the buffer is at x + y * pitch. - Parameters:
-
- Returns:
- the pitch in bytes
|
|
Gets the number of bytes in the image buffer. - Parameters:
-
- Returns:
- the number of bytes
|
|
Compares the sizes of 2 images and returns true if they are the same. - Parameters:
-
image1 | an image object |
image2 | an image object |
- Returns:
- a boolean value telling if the images are of the same size
|