renamed GenImageLinearGradient to GenImageGradientLinear

This commit is contained in:
dane_madsen 2023-05-21 19:32:40 +10:00
parent 2633eb0579
commit 12d660cf8c
10 changed files with 16 additions and 13 deletions

View File

@ -27,9 +27,9 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation");
Image verticalGradient = GenImageLinearGradient(screenWidth, screenHeight, 0, RED, BLUE);
Image horizontalGradient = GenImageLinearGradient(screenWidth, screenHeight, 90, RED, BLUE);
Image diagonalGradient = GenImageLinearGradient(screenWidth, screenHeight, 45, RED, BLUE);
Image verticalGradient = GenImageGradientLinear(screenWidth, screenHeight, 0, RED, BLUE);
Image horizontalGradient = GenImageGradientLinear(screenWidth, screenHeight, 90, RED, BLUE);
Image diagonalGradient = GenImageGradientLinear(screenWidth, screenHeight, 45, RED, BLUE);
Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, WHITE, BLACK);
Image checked = GenImageChecked(screenWidth, screenHeight, 32, 32, RED, BLUE);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);

View File

@ -6241,7 +6241,7 @@
]
},
{
"name": "GenImageLinearGradient",
"name": "GenImageGradientLinear",
"description": "Generate image: linear gradient",
"returnType": "Image",
"params": [

View File

@ -4996,7 +4996,7 @@ return {
}
},
{
name = "GenImageLinearGradient",
name = "GenImageGradientLinear",
description = "Generate image: linear gradient",
returnType = "Image",
params = {

View File

@ -2416,8 +2416,8 @@ Function 245: GenImageColor() (3 input parameters)
Param[1]: width (type: int)
Param[2]: height (type: int)
Param[3]: color (type: Color)
Function 246: GenImageLinearGradient() (5 input parameters)
Name: GenImageLinearGradient
Function 246: GenImageGradientLinear() (5 input parameters)
Name: GenImageGradientLinear
Return type: Image
Description: Generate image: linear gradient
Param[1]: width (type: int)

View File

@ -1549,7 +1549,7 @@
<Param type="int" name="height" desc="" />
<Param type="Color" name="color" desc="" />
</Function>
<Function name="GenImageLinearGradient" retType="Image" paramCount="5" desc="Generate image: linear gradient">
<Function name="GenImageGradientLinear" retType="Image" paramCount="5" desc="Generate image: linear gradient">
<Param type="int" name="width" desc="" />
<Param type="int" name="height" desc="" />
<Param type="int" name="direction" desc="" />

View File

@ -211,7 +211,7 @@ ImageColorContrast|void|(Image *image, float contrast);|
ImageColorBrightness|void|(Image *image, int brightness);|
ImageColorReplace|void|(Image *image, Color color, Color replace);|
GenImageColor|Image|(int width, int height, Color color);|
GenImageLinearGradient|Image|(int width, int height, int direction, Color start, Color end);|
GenImageGradientLinear|Image|(int width, int height, int direction, Color start, Color end);|
GenImageGradientRadial|Image|(int width, int height, float density, Color inner, Color outer);|
GenImageChecked|Image|(int width, int height, int checksX, int checksY, Color col1, Color col2);|
GenImageWhiteNoise|Image|(int width, int height, float factor);|

View File

@ -1378,7 +1378,7 @@
<Param name="Color color" />
</Overload>
</KeyWord>
<KeyWord name="GenImageLinearGradient" func="yes">
<KeyWord name="GenImageGradientLinear" func="yes">
<Overload retVal="Image" descr="Generate image: linear gradient">
<Param name="int width" />
<Param name="int height" />

View File

@ -317,7 +317,7 @@ RLAPI bool ExportImageAsCode(Image image, const char *fileName);
// Image generation functions
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
RLAPI Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise

View File

@ -1239,7 +1239,7 @@ RLAPI bool ExportImageAsCode(Image image, const char *fileName);
// Image generation functions
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
RLAPI Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
RLAPI Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end); // Generate image: linear gradient
RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise

View File

@ -685,7 +685,10 @@ Image GenImageColor(int width, int height, Color color)
#if defined(SUPPORT_IMAGE_GENERATION)
// Generate image: linear gradient
Image GenImageLinearGradient(int width, int height, int direction, Color start, Color end)
// The direction value specifies the direction of the gradient (in degrees)
// with 0 being vertical (from top to bottom), 90 being horizontal (from left to right).
// The gradient effectively rotates counter-clockwise by the specified amount.
Image GenImageGradientLinear(int width, int height, int direction, Color start, Color end)
{
Color *pixels = (Color *)RL_MALLOC(width*height*sizeof(Color));