IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Lib.ImageBuilderBase Class Referenceabstract

Base class for storing image data and exporting and importing images froom files and different types of objects. More...

+ Inheritance diagram for IG.Lib.ImageBuilderBase:
+ Collaboration diagram for IG.Lib.ImageBuilderBase:

Public Member Functions

 ImageBuilderBase ()
 
 ImageBuilderBase (System.Drawing.Bitmap bitmap)
 
void ClearData ()
 Clears the data that holds image information. More...
 
abstract void InitData ()
 
System.Drawing.Bitmap ToBitmap ()
 Creates and returns a bitmap object from the current image data. More...
 
void FromBitmap (System.Drawing.Bitmap bitmap)
 Copies image data from the specified bitmap. More...
 
void FromBitmap (System.Drawing.Bitmap bitmap, bool extractColorComponents, bool extractGreyLevels)
 Copies image data from the specified bitmap. More...
 
void FromCsv (CsvData csv)
 Copies image data from the specified CsvData. More...
 
void LoadCsv (string filePath)
 Reads image data from the specified file in CSV format. More...
 
void ToCsv (ref CsvData csv)
 Write the current image data to a CSV object. More...
 
string ToCsvString ()
 Returns a CSV string containing current image data written in the CSV (comma separated values) form. More...
 
void SaveCsv (string filePath)
 Saves image data to the specified file in CSV format. More...
 

Public Attributes

const string ConstImage = "Image"
 

Protected Attributes

int _sizeX = 0
 
int _sizeY = 0
 
double[] _red = null
 
double[] _green = null
 
double[] _blue = null
 
double[] _grey = null
 
double[] _opacity = null
 
IG.Lib.CsvData _csv = null
 

Private Member Functions

void SetSize (int sizeX, int sizeY)
 Sets or changes image size. More...
 
int GetIndex (int i, int j)
 Returns the flat array index corresponding to 2D indices of a pixel. More...
 
void GetIndex (int flatIndex, out int indexX, out int indexY)
 Calculates and returns (through output arguments) 2D indices of a pixel that correspond to the specified flat index. More...
 

Private Attributes

const string ConstDim = "Dimensions"
 
const string ConstRed = "Red"
 
const string ConstGreen = "Green"
 
const string ConstBlue = "Blue"
 
const string ConstGrey = "Grey"
 
const string ConstAlpha = "Alpha"
 

Detailed Description

Base class for storing image data and exporting and importing images froom files and different types of objects.

Constructor & Destructor Documentation

IG.Lib.ImageBuilderBase.ImageBuilderBase ( )
inline
IG.Lib.ImageBuilderBase.ImageBuilderBase ( System.Drawing.Bitmap  bitmap)
inline

Member Function Documentation

void IG.Lib.ImageBuilderBase.ClearData ( )
inline

Clears the data that holds image information.

void IG.Lib.ImageBuilderBase.SetSize ( int  sizeX,
int  sizeY 
)
inlineprivate

Sets or changes image size.

Parameters
sizeXSize in x direction.
sizeYSize in y direction.
int IG.Lib.ImageBuilderBase.GetIndex ( int  i,
int  j 
)
inlineprivate

Returns the flat array index corresponding to 2D indices of a pixel.

Parameters
iFirst index.
jSecond index.
void IG.Lib.ImageBuilderBase.GetIndex ( int  flatIndex,
out int  indexX,
out int  indexY 
)
inlineprivate

Calculates and returns (through output arguments) 2D indices of a pixel that correspond to the specified flat index.

Parameters
flatIndexFat (1D) index that count pixels column by column.
indexXPixel index in x direction.
indexYPixel index in y direction.
abstract void IG.Lib.ImageBuilderBase.InitData ( )
pure virtual
System.Drawing.Bitmap IG.Lib.ImageBuilderBase.ToBitmap ( )
inline

Creates and returns a bitmap object from the current image data.

Referenced by IPLab.MainForm.OpenFile(), and IPLab.MainForm.SaveFile().

void IG.Lib.ImageBuilderBase.FromBitmap ( System.Drawing.Bitmap  bitmap)
inline

Copies image data from the specified bitmap.

Parameters
bitmapBitmap where data is copied from.
void IG.Lib.ImageBuilderBase.FromBitmap ( System.Drawing.Bitmap  bitmap,
bool  extractColorComponents,
bool  extractGreyLevels 
)
inline

Copies image data from the specified bitmap.

Parameters
bitmapBitmap where data is copied from.
extractColorComponentsWhether color components are extracted from the bitmap and stored in the current object.
extractGreyLevelsWhether grey levels are extracted from the bitmap and stored in the current object.
void IG.Lib.ImageBuilderBase.FromCsv ( CsvData  csv)
inline

Copies image data from the specified CsvData.

Parameters
bitmapBitmap where data is copied from.
extractColorComponentsWhether color components are extracted from the bitmap and stored in the current object.
extractGreyLevelsWhether grey levels are extracted from the bitmap and stored in the current object.

References IG.Lib.StringTable.GetInt(), IG.Lib.StringTable.IsDefined(), IG.Lib.StringTable.IsInt(), IG.Lib.StringTable.IsNotNullOrEmpty(), and IG.Lib.StringTable.NumRows.

void IG.Lib.ImageBuilderBase.LoadCsv ( string  filePath)
inline

Reads image data from the specified file in CSV format.

Parameters
filePathFile from which data is saved.

References IG.Lib.StringTable.LoadCsv().

Referenced by IPLab.MainForm.OpenFile().

void IG.Lib.ImageBuilderBase.ToCsv ( ref CsvData  csv)
inline

Write the current image data to a CSV object.

Parameters
csvCSV object where image data is stored in the agreed format.
string IG.Lib.ImageBuilderBase.ToCsvString ( )
inline

Returns a CSV string containing current image data written in the CSV (comma separated values) form.

Returns
void IG.Lib.ImageBuilderBase.SaveCsv ( string  filePath)
inline

Saves image data to the specified file in CSV format.

If the file exists then it is overwritten.

Parameters
filePathFile to which data is saved.

Referenced by IPLab.MainForm.SaveFile().

Member Data Documentation

const string IG.Lib.ImageBuilderBase.ConstImage = "Image"
const string IG.Lib.ImageBuilderBase.ConstDim = "Dimensions"
private
const string IG.Lib.ImageBuilderBase.ConstRed = "Red"
private
const string IG.Lib.ImageBuilderBase.ConstGreen = "Green"
private
const string IG.Lib.ImageBuilderBase.ConstBlue = "Blue"
private
const string IG.Lib.ImageBuilderBase.ConstGrey = "Grey"
private
const string IG.Lib.ImageBuilderBase.ConstAlpha = "Alpha"
private
int IG.Lib.ImageBuilderBase._sizeX = 0
protected
int IG.Lib.ImageBuilderBase._sizeY = 0
protected
double [] IG.Lib.ImageBuilderBase._red = null
protected
double [] IG.Lib.ImageBuilderBase._green = null
protected
double [] IG.Lib.ImageBuilderBase._blue = null
protected
double [] IG.Lib.ImageBuilderBase._grey = null
protected
double [] IG.Lib.ImageBuilderBase._opacity = null
protected
IG.Lib.CsvData IG.Lib.ImageBuilderBase._csv = null
protected

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