Representation of an image in ZBar. More...
Public Member Functions | |
Image () | |
Create/allocate a new uninitialized image. | |
Image (string filename) | |
Load image from file in the same format as written by Dump(). | |
void | Dump (string filebase) |
Dump raw image data to a file for debug. | |
Image | Convert (uint format) |
Image format conversion. refer to the documentation for supported image formats. | |
void | Dispose () |
Release resources held by this object. | |
Protected Member Functions | |
virtual void | Dispose (bool disposing) |
Dispose this object. | |
Properties | |
internal IntPtr | Handle [get] |
uint | Width [get, set] |
uint | Height [get, set] |
uint | Format [get, set] |
uint | SequenceNumber [get, set] |
byte[] | Data [get, set] |
IEnumerable< Symbol > | Symbols [get] |
Private Member Functions | |
internal | Image (IntPtr handle, bool incRef) |
Create a new image from a pointer to an unmanaged resource. | |
~Image () | |
Finalize this object. | |
static IntPtr | zbar_image_create () |
new image constructor. | |
static void | zbar_image_destroy (IntPtr image) |
image destructor. all images created by or returned to the application should be destroyed using this function. when an image is destroyed, the associated data cleanup handler will be invoked if available | |
static void | zbar_image_ref (IntPtr image, int refs) |
image reference count manipulation. increment the reference count when you store a new reference to the image. decrement when the reference is no longer used. do not refer to the image any longer once the count is decremented. zbar_image_ref(image, -1) is the same as zbar_image_destroy(image) | |
static IntPtr | zbar_image_convert (IntPtr image, uint format) |
image format conversion. refer to the documentation for supported image formats | |
static IntPtr | zbar_image_convert_resize (IntPtr image, uint format, uint width, uint height) |
image format conversion with crop/pad. if the requested size is larger than the image, the last row/column are duplicated to cover the difference. if the requested size is smaller than the image, the extra rows/columns are dropped from the right/bottom. | |
static uint | zbar_image_get_format (IntPtr image) |
retrieve the image format. | |
static uint | zbar_image_get_sequence (IntPtr image) |
retrieve a "sequence" (page/frame) number associated with this image. | |
static uint | zbar_image_get_width (IntPtr image) |
retrieve the width of the image. | |
static uint | zbar_image_get_height (IntPtr image) |
retrieve the height of the image. | |
static IntPtr | zbar_image_get_data (IntPtr image) |
return the image sample data. the returned data buffer is only valid until zbar_image_destroy() is called | |
static uint | zbar_image_get_data_length (IntPtr img) |
return the size of image data. | |
static IntPtr | zbar_image_first_symbol (IntPtr image) |
image_scanner decode result iterator. | |
static void | zbar_image_set_format (IntPtr image, uint format) |
specify the fourcc image format code for image sample data. refer to the documentation for supported formats. | |
static void | zbar_image_set_sequence (IntPtr image, uint sequence_num) |
associate a "sequence" (page/frame) number with this image. | |
static void | zbar_image_set_size (IntPtr image, uint width, uint height) |
specify the pixel size of the image. | |
delegate void | zbar_image_cleanup_handler (IntPtr image) |
Cleanup handler callback for image data. | |
static void | zbar_image_set_data (IntPtr image, IntPtr data, uint data_byte_length, zbar_image_cleanup_handler cleanup_handler) |
specify image sample data. when image data is no longer needed by the library the specific data cleanup handler will be called (unless NULL) | |
static void | zbar_image_free_data (IntPtr image) |
built-in cleanup handler. passes the image data buffer to free() | |
static void | zbar_image_set_userdata (IntPtr image, IntPtr userdata) |
associate user specified data value with an image. | |
static IntPtr | zbar_image_get_userdata (IntPtr image) |
return user specified data value associated with the image. | |
static int | zbar_image_write (IntPtr image, string filebase) |
dump raw image data to a file for debug. | |
static IntPtr | zbar_image_read (string filename) |
read back an image in the format written by zbar_image_write() | |
Private Attributes | |
IntPtr | handle |
Representation of an image in ZBar.
Definition at line 33 of file Image.cs.
internal ZBar.Image.Image | ( | IntPtr | handle, | |
bool | incRef | |||
) | [private] |
ZBar.Image.Image | ( | ) |
ZBar.Image.Image | ( | string | filename | ) |
Image ZBar.Image.Convert | ( | uint | format | ) |
Image format conversion. refer to the documentation for supported image formats.
The converted image size may be rounded (up) due to format constraints
format | FourCC format to convert to. |
void ZBar.Image.Dispose | ( | ) |
virtual void ZBar.Image.Dispose | ( | bool | disposing | ) | [protected, virtual] |
Dispose this object.
This boolean disposing parameter here ensures that objects with a finalizer is not disposed, this is method is invoked from the finalizer. Do overwrite, and call, this method in base classes if you use any unmanaged resources.
disposing | A System.Boolean False if called from the finalizer, True if called from Dispose. |
void ZBar.Image.Dump | ( | string | filebase | ) |
Dump raw image data to a file for debug.
the data will be prefixed with a 16 byte header consisting of: 4 bytes uint = 0x676d697a ("zimg") 4 bytes format fourcc 2 bytes width 2 bytes height 4 bytes size of following image data in bytes
filebase | base filename, appended with ".XXXX.zimg" where XXXX is the format fourcc |
delegate void ZBar.Image.zbar_image_cleanup_handler | ( | IntPtr | image | ) | [private] |
Cleanup handler callback for image data.
static IntPtr ZBar.Image.zbar_image_convert | ( | IntPtr | image, | |
uint | format | |||
) | [private] |
image format conversion. refer to the documentation for supported image formats
the converted image size may be rounded (up) due to format constraints
static IntPtr ZBar.Image.zbar_image_convert_resize | ( | IntPtr | image, | |
uint | format, | |||
uint | width, | |||
uint | height | |||
) | [private] |
image format conversion with crop/pad. if the requested size is larger than the image, the last row/column are duplicated to cover the difference. if the requested size is smaller than the image, the extra rows/columns are dropped from the right/bottom.
the image is not scaled
static IntPtr ZBar.Image.zbar_image_create | ( | ) | [private] |
new image constructor.
static void ZBar.Image.zbar_image_destroy | ( | IntPtr | image | ) | [private] |
image destructor. all images created by or returned to the application should be destroyed using this function. when an image is destroyed, the associated data cleanup handler will be invoked if available
make no assumptions about the image or the data buffer. they may not be destroyed/cleaned immediately if the library is still using them. if necessary, use the cleanup handler hook to keep track of image data buffers
static IntPtr ZBar.Image.zbar_image_first_symbol | ( | IntPtr | image | ) | [private] |
image_scanner decode result iterator.
static void ZBar.Image.zbar_image_free_data | ( | IntPtr | image | ) | [private] |
built-in cleanup handler. passes the image data buffer to free()
static IntPtr ZBar.Image.zbar_image_get_data | ( | IntPtr | image | ) | [private] |
return the image sample data. the returned data buffer is only valid until zbar_image_destroy() is called
static uint ZBar.Image.zbar_image_get_data_length | ( | IntPtr | img | ) | [private] |
return the size of image data.
static uint ZBar.Image.zbar_image_get_format | ( | IntPtr | image | ) | [private] |
retrieve the image format.
static uint ZBar.Image.zbar_image_get_height | ( | IntPtr | image | ) | [private] |
retrieve the height of the image.
static uint ZBar.Image.zbar_image_get_sequence | ( | IntPtr | image | ) | [private] |
retrieve a "sequence" (page/frame) number associated with this image.
static IntPtr ZBar.Image.zbar_image_get_userdata | ( | IntPtr | image | ) | [private] |
return user specified data value associated with the image.
static uint ZBar.Image.zbar_image_get_width | ( | IntPtr | image | ) | [private] |
retrieve the width of the image.
static IntPtr ZBar.Image.zbar_image_read | ( | string | filename | ) | [private] |
read back an image in the format written by zbar_image_write()
static void ZBar.Image.zbar_image_ref | ( | IntPtr | image, | |
int | refs | |||
) | [private] |
image reference count manipulation. increment the reference count when you store a new reference to the image. decrement when the reference is no longer used. do not refer to the image any longer once the count is decremented. zbar_image_ref(image, -1) is the same as zbar_image_destroy(image)
static void ZBar.Image.zbar_image_set_data | ( | IntPtr | image, | |
IntPtr | data, | |||
uint | data_byte_length, | |||
zbar_image_cleanup_handler | cleanup_handler | |||
) | [private] |
specify image sample data. when image data is no longer needed by the library the specific data cleanup handler will be called (unless NULL)
application image data will not be modified by the library
static void ZBar.Image.zbar_image_set_format | ( | IntPtr | image, | |
uint | format | |||
) | [private] |
specify the fourcc image format code for image sample data. refer to the documentation for supported formats.
this does not convert the data! (see zbar_image_convert() for that)
static void ZBar.Image.zbar_image_set_sequence | ( | IntPtr | image, | |
uint | sequence_num | |||
) | [private] |
associate a "sequence" (page/frame) number with this image.
static void ZBar.Image.zbar_image_set_size | ( | IntPtr | image, | |
uint | width, | |||
uint | height | |||
) | [private] |
specify the pixel size of the image.
this does not affect the data!
static void ZBar.Image.zbar_image_set_userdata | ( | IntPtr | image, | |
IntPtr | userdata | |||
) | [private] |
associate user specified data value with an image.
static int ZBar.Image.zbar_image_write | ( | IntPtr | image, | |
string | filebase | |||
) | [private] |
dump raw image data to a file for debug.
Rhe data will be prefixed with a 16 byte header consisting of:
/// od -Ax -tx1z -N16 -w4 [file] ///
/// display -size 640x480+16 [-depth ?] [-sampling-factor ?x?] \ /// {GRAY,RGB,UYVY,YUV}:[file] ///
image | the image object to dump | |
filebase | base filename, appended with ".XXXX.zimg" where XXXX is the format fourcc |
IntPtr ZBar.Image.handle [private] |
byte [] ZBar.Image.Data [get, set] |
uint ZBar.Image.Format [get, set] |
internal IntPtr ZBar.Image.Handle [get, private] |
uint ZBar.Image.Height [get, set] |
uint ZBar.Image.SequenceNumber [get, set] |
IEnumerable<Symbol> ZBar.Image.Symbols [get] |
Get ImageScanner decode result iterator.
uint ZBar.Image.Width [get, set] |