// Auto Selection Algorithm
function AutoSelectALG_Progress(ProgressBar : TProgressBar; Bitmap:TBitmap; SHPPalette:TPalette; List,Last: listed_colour) : byte; overload;
// Frame Loading Procedures
Procedure LoadFrameImageToSHP(var SHP:TSHP; const Frame:integer; const Bitmap:TBitmap; var List,Last:listed_colour; var Start:colour_element; alg : byte); overload;
Function LoadFrameImageToSHP(const Bitmap : TBitmap; const SHPPalette:TPalette; var List, Last: listed_colour; alg : byte) : real; overload;
// Pixel Loading Functions
function LoadPixel(const Bitmap:TBitmap; var Start:colour_element; var List,Last : listed_colour; alg : byte; x,y : integer) : integer; overload;
function LoadPixel(const Bitmap:TBitmap; var List,Last : listed_colour; alg : byte; x,y : integer) : integer; overload;
// Colour Conversion Methods: Functions
function RGBDiff(Colour : TColor; var List,Last:listed_colour) : byte;
function RGBAdvDifference(Colour : TColor; var List,Last:listed_colour) : byte;
function RGBDifference(Colour : Tcolor; var List,Last : listed_colour) : byte;
function RGB3DFullDiff(Colour : Tcolor; var List,Last:listed_colour) : byte;
function RGB3DColourPlus(Colour : Tcolor; var List,Last:listed_colour) : byte;
Function RGB3DInfurium(Color : Tcolor; var List,Last:listed_colour; Bitmap:TBitmap; x,y:integer) : byte;
The way to use it is simple. Make sure that the form or unit that your new feature will be written loads the following libraries:
SHP_Engine_CCMs; SHP_Colour_Bank; Colour_list;
In the function of your new feature, create the following variables:
Code:
var
Start : colour_element;
List, Last: listed_colour;
when you are loading the settings for the conversion, use the GenerateColourList(), so the colours that will be used in the conversion will be known. And use PrepareBank() to prepare the cache.
To convert each frame, use LoadFrameImageToSHP(); Here's a sample from FrmImportImageAsSHP:
FrmMain.SHP = SHP used in the operation
(x - start) + 1 = number of the frame
Bitmap = Current Bitmap (24bits) version of the image that is being converted.
List = first colour of the Colour List of colours from the palette that can be used in the conversion
Last = last colour of the Colour List of colours from the palette that can be used in the conversion (this is not much used but kept as default)
Start = The first element of the Colour Bank, that avoids colours from being checked more than once, speeding up the operation.
alg = number of CCM that will be used: 1 for R,G,B Difference; 2 for R+G+B Advanced Difference; 3 for R+G+B Difference; 4 for 3D RGB Fulld Difference; 5 for 3D RGB Full Difference Colour+ and 6 for 3D RGB Infurium. Note: Infurium doesnt use Colour Banks!
And finally, after all frames are converted, you should eliminate the cached info and colour list by using the following codes:
Code:
// Remove the trash:
ClearColourList(List,Last);
ClearBank(Start);
I dont see this as being hard and it makes conversion really faster. And, finally, I cant forget to mention the AutoSelect Algorithm that was also changed, although the name of the function is still the same it used to be:
Of course, change the palette, bitmap and other stuff to the name of the variables used in your function.
If, for some reason, you wanna make special versions of these functions, overload it, so the names won't be confusing, since they will be the same, but try using this system... QUICK_EDIT
You cannot post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum