Roxame Home - Diccan Home

Gradations and Touch

Main commands

gradationl_hue makes a gradation in hue, bottom up
gradationl_sat makes a gradation in saturation, bottom up
gradaionl_val makes a global gradation in value (luminosity), bottom upfait un dégradé général en luminosité, du bas vers le haut

gradationl_X makes a general gradation, choosing at random the parameter ((h, s or v), the direction and the proportion. ;

Gradations l_ operate on the whole image, north oriented, in function of number and the specified parameter (gradationl_hue, ..._sat, ... val )

gradation list gradation_ gradationl gradationr gradationC gradationrC
gradation list l_gradation l_gradationl l_gradationr lgradationC
gradationC list gradationC_sat gradationC_val
gradationC list gradationC_sat gradationC_val gradationrC_sat gradatiionrC_val
gradation__rd list gradation_rd gradationl_rd gradation_r_rd gradationC_rd gradationrC_rd

Philosophy

There are several families of terms commanding gradations.

The gradation depth is controlled by the number typed before the call of the function. Between 0 and 100. If the number is greater than 100, it will be transformed in a random number from 0 to 99.

The gradation_ family operates on all regions. Works quite well

The gradationll_ family operates on the whole image. It is simplistic.

gradationl_ family operates on one region only. On a non segmented image, i works like gradationll. To use it specifically, you must begin by a segmentation, then choose a region by its number followed by R . e.g. 159 R . That may be efficient on simple regions, with geometric uniform regioins.

In each family some parameters are implied by the term used. These parameters are :

- direction : N growing upwards, E rightwards, etc.. X indicates a random choice between the direction
- Munzel space dimension: hue, saturation, value. this is specified for some terms. e.g. gradationll_hue
- excep t if black pixels are not modified
- rate: 0 no modif, 100, from 0 à 255 ou 999 (for sat)

On a parameter, the letter X indicates that the parameter is chosen at random

i t w uses the center of the region
j u y use the center of the region, and a distance to the center

gradations can also be called using the lists

The commands must be preceded by an integer between 0 (no gradation) and 100 (gradation on the full scale of the variations, for instance from black to maximum value).


Programming tips

The code :
gradations Gradation functions
Touch Touch functions

The basic function in the program is Deg(int regloc, char hsvparam, char dsens, char excep, int taux) applies a gradation to a region, according to 4 parameters
- hue, saturation or value
- direction ! north, south, west, east)
- some exceptions can be applied (e.g; for whites)
- the gradation can bi more or less deep, from 0 to 100%

DegGen(char sensh , int tauxh , char senss, int tauxs, char sensv, int tauxv, char excp) applies to te active region. It is called by the termes gradation_ (X, hue; sat; val) and also by gradationC_ (sat and val)

DegGenR()
DegTemp()

DegGenReg(char sensh , int tauxh , char senss, int tauxs, char sensv, int tauxv, char excp) applies to all and each region. It is calld by the terms gradationr_ (X, hue, sat val). and by gradation_country, and also by gradationC_ (sat and val)


hsvparam : section of h, s or v, or even i, u, y. For h,s,v, the center of each region is computed (xcreg, ycreg). Besides, i,u,v, we xompurz cdist , the distance to the center of the image (640x480)
sens : N, S, W, E ou au hasrd si X.
exception : if t, the black pixels are not modified

DegTemp( ) supposes that the region is defined eslewhere. In general, it will be more efficient to use


case 0 : break;
case 1 : DegTemp('h', 'N', 50); break;
case 2 : DegTemp('s', 'N', 50); break;
case 3 : DegTemp('v', 'N', 50); break;
case 4 : DegTemp('v', 'S', 50); break;
case 5 : DegTemp('v', 'E', 50); break;
case 6 : DegTemp('x', 'x', 50); break;

 

//case 8001 : Deg(0, 'x' , 'X', 'u', number); break; gradationl_X
//case 8002 : Deg(0, 'h', 'N', 't', number); break; gradationl_hue
//case 8003 : Deg(0, 's', 'N', 't', number ) ; break; gradationl_sat
//case 8004 : Deg(0, 'v', 'N', 'u', number ) ; break; gradationl_val

case 8005 : Deg(refReg, 'x', 'X', 'u', 100); break; //gradationl_X
case 8006 : Deg(refReg, 'h', 'N', 't', 100); break; //gradationl_hue
case 8007 : Deg(refReg, 's', 'N', 't', 100); break; //gradationl_sat
case 8008 : Deg(refReg, 'v', 'N', 'u', 100); break; //gradationl_val

//DegGen(char sensh , int tauxh , char senss, int tauxs, char sensv, int tauxv, char excp)
case 8011 : DegGen('X',195, 'X', 195, 'X', 195, 'u') ; break; //gradation_X
case 8012 : DegGen('X', number, 'N',0, 'N', 0, 'u'); break; //gradation_hue
case 8013 : DegGen('N',0, 'X', number, 'N', 0, 'u'); break; //gradation_sat
case 8014 : DegGen('N', 0, 'N',0, 'X', number, 'u'); break; //gradation_val

//DegGenReg(char sensh , int tauxh , char senss, int tauxs, char sensv, int tauxv, char excp)
//for (int regila=regdeb ; regila<nbregutil+1; regila++){

case 8021 : DegGenReg('X',195, 'X', 195, 'X', 195, 'u') ; break; //gradationr_X
case 8022 : DegGenReg('N',90, 'N', 0, 'N', 0, 'u') ; break; //gradationr_hue
case 8023 : DegGenReg('N',0, 'N', 90, 'N', 0, 'u') ; break; //gradationr_sat
case 8024 : DegGenReg('N',0, 'N', 0, 'N', 90, 'u') ; break; //gradationr_val

case 8031 : // gradation_country
DegGenReg('N', 50, 'S', 30, 'N', 30, 'u');
break;

//case 8040 : DegGenReg('X',195, 'X', 195, 'X', 195, 'u') ; break; //gradationr_X
case 8041 : if (number == 0) number = 20; DegGen('N',0, 'C', number, 'N', 0, 'u'); break; //gradationC_sat
case 8042 : if (number == 0) number = 20; DegGen('N',0, 'N', 0, 'C', number, 'u'); break; //gradationC_val
case 8043 : if (number == 0) number = 20; DegGenReg('N',0, 'C', number, 'N', 0, 'u'); break; //gradationrC_sat
case 8044 : if (number == 0) number = 20; DegGenReg('N',0, 'N', 0, 'C', number, 'u'); break; //gradationrC_val

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.