Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties

ZBar.Image Class Reference

Representation of an image in ZBar. More...

List of all members.

Public Member Functions

 Image ()
 Create/allocate a new uninitialized image.
 Image (System.Drawing.Image image)
 Create image from an instance of System.Drawing.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.

Static Public Member Functions

static uint FourCC (char c0, char c1, char c2, char c3)
 Get FourCC code from four chars.

Protected Member Functions

virtual void Dispose (bool disposing)
 Dispose this object.

Properties

uint Width [get, set]
uint Height [get, set]
uint Format [get, set]
uint SequenceNumber [get, set]
byte[] Data [get, set]
IEnumerable< SymbolSymbols [get]

Detailed Description

Representation of an image in ZBar.

Definition at line 36 of file Image.cs.


Constructor & Destructor Documentation

ZBar.Image.Image (  ) 

Create/allocate a new uninitialized image.

Be aware that this image is NOT initialized, allocated. And you must set width, height, format, data etc...

Definition at line 69 of file Image.cs.

ZBar.Image.Image ( System.Drawing.Image  image  ) 

Create image from an instance of System.Drawing.Image.

Parameters:
image Image to convert to ZBar.Image

The converted image is in RGB3 format, so it should be converted using Image.Convert() before it is scanned, as ZBar only reads images in GREY/Y800

Definition at line 85 of file Image.cs.

ZBar.Image.Image ( string  filename  ) 

Load image from file in the same format as written by Dump().

Parameters:
filename Path to the file to load the image from

Definition at line 112 of file Image.cs.


Member Function Documentation

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. See Image.FourCC for how to get the fourCC code.

Parameters:
format FourCC format to convert to.
Returns:
A new Image with the sample data from the original image converted to the requested format. The original image is unaffected.

Definition at line 261 of file Image.cs.

void ZBar.Image.Dispose (  ) 

Release resources held by this object.

Definition at line 310 of file Image.cs.

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.

Parameters:
disposing A System.Boolean False if called from the finalizer, True if called from Dispose.

Definition at line 297 of file Image.cs.

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

Parameters:
filebase base filename, appended with ".XXXX.zimg" where XXXX is the format fourcc

Definition at line 143 of file Image.cs.

static uint ZBar.Image.FourCC ( char  c0,
char  c1,
char  c2,
char  c3 
) [static]

Get FourCC code from four chars.

See FourCC.org for more information on FourCC. For information on format supported by zbar see: http://sourceforge.net/apps/mediawiki/zbar/index.php?title=Supported_image_formats

Definition at line 276 of file Image.cs.


Property Documentation

byte [] ZBar.Image.Data [get, set]

Get/set the data associated with this image

This method copies that data, using Marshal.Copy.

Definition at line 206 of file Image.cs.

uint ZBar.Image.Format [get, set]

Get/set the fourcc image format code for image sample data.

Chaning this doesn't affect the data. See Image.FourCC for how to get the fourCC code. For information on supported format see: http://sourceforge.net/apps/mediawiki/zbar/index.php?title=Supported_image_formats

Definition at line 181 of file Image.cs.

uint ZBar.Image.Height [get, set]

Get/set the height of the image, doesn't affect the data

Definition at line 163 of file Image.cs.

uint ZBar.Image.SequenceNumber [get, set]

Get/set a "sequence" (page/frame) number associated with this image.

Definition at line 193 of file Image.cs.

IEnumerable<Symbol> ZBar.Image.Symbols [get]

Get ImageScanner decode result iterator.

Definition at line 237 of file Image.cs.

uint ZBar.Image.Width [get, set]

Get/set the width of the image, doesn't affect the data

Definition at line 151 of file Image.cs.


The documentation for this class was generated from the following file: