// //------------------ DOK FILE -------------------------------------------------- +Header 2dLib =pkg bios =title Bitmaps =short drawing with pixels =desc // // //------------------ PROTO ----------------------------------------------------- bitmapCircle +Proto bitmapCircle =type fun Bitmap Int Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws an ellipse inside the rectangle defined by x, y, width, height. A color and a blending function are specified. See [[BlendFunction]] for a description. See [[bitmapFillCircle]] if you need a function that draws a filled ellipse. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x top-left coordinate // +arg y =type Int =desc y top-left coordinate // +arg width =type Int =desc width of the circle. nil for reaching the right border of the bitmap // +arg height =type Int =desc height of the circle. nil for reaching the bottom border of the bitmap // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapComponents +Proto bitmapComponents =type fun Bitmap Component Component Component Component -> Bitmap =mode function =pkg bios =impl native =link =desc This function manipulates components of each pixel with a kind of permutation. You can replace each component with another component, 255 minus another component, 0 or 255. The following example will lead to a yellow and black bitmap where the yellow intensity is the initial alpha channel, and where the alpha channel has been set to 255. bitmapComponents (bmp, COMP_255, COMP_A, COMP_A, COMP_0) You may also invert a component: a value V becomes 255-V. The next example inverts the three components R, G, B and preserves the alpha channel: bitmapComponents (bmp, COMP_A, COMP_R_INV, COMP_G_INV, COMP_B_INV) // +arg bmp =type Bitmap =desc Any bitmap // +arg A =type Component =desc Component for A // +arg R =type Component =desc Component for R // +arg G =type Component =desc Component for G // +arg B =type Component =desc Component for B // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapCopy +Proto bitmapCopy =type fun Bitmap Int Int Int Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function creates a new bitmap with the content of a rectangle area of the bitmap src. The following examples makes a full copy: bitmapCopy (bmp, 0, 0, nil, nil) // +arg src =type Bitmap =desc A bitmap // +arg x =type Int =desc x top-left coordinate // +arg y =type Int =desc y top-left coordinate // +arg width =type Int =desc width of the area, nil for reaching the right border of the bitmap // +arg height =type Int =desc height of the area, nil for reaching the bottom border of the bitmap // +arg result =type Bitmap =desc An extract of the bitmap bmp // // //------------------ PROTO ----------------------------------------------------- bitmapCreate +Proto bitmapCreate =type fun Int Int Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function creates a new bitmap with the specified size, and an initial color. // +arg width =type Int =desc Bitmap's width (must be less or equal to 16384) // +arg height =type Int =desc Bitmap's height (must be less or equal to 16384) // +arg color =type Int =desc Initial ARGB color // +arg result =type Bitmap =desc A new bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapErase +Proto bitmapErase =type fun Bitmap Int -> Bitmap =mode function =pkg bios =impl mcy =link =desc This function erases the bitmap with the specified color. The color is ARGB: when you pass 0, you get a black transparent bitmap. // +arg bmp =type Bitmap =desc A bitmap // +arg color =type Int =desc An ARGB color // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapFill +Proto bitmapFill =type fun Bitmap Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function applies a color filter all over the bitmap. The color filter is specified by an ARGB color and a blending function. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapFillCircle +Proto bitmapFillCircle =type fun Bitmap Int Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws a filled ellipse inside the rectangle defined by x, y, width, height. A color and a blending function are specified. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x top-left coordinate // +arg y =type Int =desc y top-left coordinate // +arg width =type Int =desc width of the circle. nil for reaching the right border of the bitmap // +arg height =type Int =desc height of the circle. nil for reaching the bottom border of the bitmap // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapFillRectangle +Proto bitmapFillRectangle =type fun Bitmap Int Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws a filled rectangle defined by x, y, width, height. A color and a blending function are specified. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x top-left coordinate // +arg y =type Int =desc y top-left coordinate // +arg width =type Int =desc width of the rectangle. nil for reaching the right border of the bitmap // +arg height =type Int =desc height of the rectangle. nil for reaching the bottom border of the bitmap // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapGet +Proto bitmapGet =type fun Bitmap Int Int -> Int =mode function =pkg bios =impl native =link =desc This function returns the ARGB color at position (x,y). It returns nil when (x,y) is outside the bitmap. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x coordinate // +arg y =type Int =desc y coordinate // +arg result =type Int =desc An ARGB color // // //------------------ PROTO ----------------------------------------------------- bitmapH +Proto bitmapH =type fun Bitmap -> Int =mode function =pkg bios =impl native =link =desc This function returns the height of the bitmap. // +arg bmp =type Bitmap =desc A bitmap // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- bitmapLine +Proto bitmapLine =type fun Bitmap Int Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws a line from pixel (x1,y1) to pixel (x2,y2). Pixels may be outside the bitmap. A color and a blending function are specified. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg x1 =type Int =desc x coordinate of the first point // +arg y1 =type Int =desc y coordinate of the first point // +arg x2 =type Int =desc x coordinate of the second point // +arg y2 =type Int =desc y coordinate of the second point // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapMakeColorTransparent +Proto bitmapMakeColorTransparent =type fun Bitmap Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function tests each pixel and compare its RGB color with the argument color. If equal, its alpha channel is set to 0 (transparent). Otherwise it is set to 255 (full opacity). // +arg bmp =type Bitmap =desc A bitmap // +arg color =type Int =desc A RGB color // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapPlot +Proto bitmapPlot =type fun Bitmap Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draw a pixel at position (x,y). A color and a blending function are specified. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x coordinate // +arg y =type Int =desc y coordinate // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapRectangle +Proto bitmapRectangle =type fun Bitmap Int Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws a rectangle defined by x, y, width, height. A color and a blending function are specified. See [[BlendFunction]] for a description. See [[bitmapFilledRectangle]] if you need a function that draws a filled rectangle. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x top-left coordinate // +arg y =type Int =desc y top-left coordinate // +arg width =type Int =desc width of the rectangle. nil for reaching the right border of the bitmap // +arg height =type Int =desc height of the rectangle. nil for reaching the bottom border of the bitmap // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapResize +Proto bitmapResize =type fun Bitmap Bitmap Bool -> Bitmap =mode function =pkg bios =impl native =link =desc This function stretches the bitmap src into the bitmap dst. A smoothing is applied when smooth is true. Be aware that the operation is much longer with the smoothing. // +arg dst =type Bitmap =desc A bitmap // +arg src =type Bitmap =desc A bitmap // +arg smooth =type Bool =desc A boolean // +arg result =type Bitmap =desc The bitmap dst // // //------------------ PROTO ----------------------------------------------------- bitmapScanline +Proto bitmapScanline =type fun Bitmap Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws an horizontal line from (x1,y) to (x2,y), A color and a blending function are specified. See [[BlendFunction]] for a description. // +arg bmp =type Bitmap =desc A bitmap // +arg x1 =type Int =desc x coordinate of the left pixel // +arg x2 =type Int =desc x coordinate of the right pixel // +arg y =type Int =desc y coordinate // +arg color =type Int =desc An ARGB color // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapSet +Proto bitmapSet =type fun Bitmap Int Int Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function sets the pixel (x,y) with the specified color. Contrary to [[bitmapPlot]], there is no blending function. // +arg bmp =type Bitmap =desc A bitmap // +arg x =type Int =desc x coordinate // +arg y =type Int =desc y coordinate // +arg color =type Int =desc An ARGB color // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapBlit +Proto bitmapBlit =type fun Bitmap Int Int Bitmap Int Int Int Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function copies an area from the bitmap src onto the bitmap dst, specifying the position of the area on the source and on the destination. A blending function is specified and will be applied on each pixel. See [[BlendFunction]] for a description. // +arg dst =type Bitmap =desc A bitmap // +arg xDst =type Int =desc x top-left coordinate in the bitmap dst // +arg yDst =type Int =desc y top-left coordinate in the bitmap dst // +arg src =type Bitmap =desc A bitmap // +arg xSrc =type Int =desc x top-left coordinate in the bitmap src // +arg ySrc =type Int =desc y top-left coordinate in the bitmap src // +arg width =type Int =desc width of the area, nil for the larger possible width // +arg height =type Int =desc height of the area, nil for the higher possible height // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg result =type Bitmap =desc The bitmap dst // // //------------------ PROTO ----------------------------------------------------- bitmapColoredBlit +Proto bitmapColoredBlit =type fun Bitmap Int Int Bitmap Int Int Int Int BlendFunction Int BlendFunction -> Bitmap =mode function =pkg bios =impl native =link =desc This function copies an area from the bitmap src onto the bitmap dst, specifying the position of the area on the source and on the destination. Two blending functions are specified and one ARGB color. The color blending is applied to the source pixel, then the second blending is applied to the destination pixel. See [[BlendFunction]] for a description. // +arg dst =type Bitmap =desc A bitmap // +arg xDst =type Int =desc x top-left coordinate in the bitmap dst // +arg yDst =type Int =desc y top-left coordinate in the bitmap dst // +arg src =type Bitmap =desc A bitmap // +arg xSrc =type Int =desc x top-left coordinate in the bitmap src // +arg ySrc =type Int =desc y top-left coordinate in the bitmap src // +arg width =type Int =desc width of the area, nil for the larger possible width // +arg height =type Int =desc height of the area, nil for the higher possible height // +arg blending =type BlendFunction =desc A blending function, nil for no blending // +arg color =type Int =desc An ARGB color // +arg K =type BlendFunction =desc Another Blending function for the color // +arg result =type Bitmap =desc The bitmap dst // // //------------------ PROTO ----------------------------------------------------- bitmapW +Proto bitmapW =type fun Bitmap -> Int =mode function =pkg bios =impl native =link =desc This function returns the width of the bitmap. // +arg bmp =type Bitmap =desc A bitmap // +arg result =type Int =desc A positive integer // // //------------------ PROTO ----------------------------------------------------- Bitmap +Proto Bitmap =type Bitmap =mode type =pkg bios =impl native =link =desc A bitmap is a matrix of pixels. It is defined by its width and height, expressed in pixels. Each pixel has exactly one ARGB color. Colors are 32 bits, this means 8 bits (one byte) for each component. For example, the color 0x80ffc000 is a half-transparent amber color: A=128, R=255, G=192, B=0 // // //------------------ PROTO ----------------------------------------------------- BlendFunction +Proto BlendFunction =type BlendFunction =mode type =pkg bios =impl native =link =desc This is the type of blending functions. A blending function applies a filter to 2 ARGB colors and results in one ARGB color. Available filters are: [[BLEND_ADD]], [[BLEND_ALPHA]], [[BLEND_AND]], [[BLEND_MAX]], [[BLEND_MIN]], [[BLEND_NONE]], [[BLEND_OR]], [[BLEND_SUB]], [[BLEND_XOR]]. // // //------------------ PROTO ----------------------------------------------------- BLEND_ADD +Proto BLEND_ADD =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: min 255 (srcA + dstA) -> dstA min 255 (srcR + dstR) -> dstR min 255 (srcG + dstG) -> dstG min 255 (srcB + dstB) -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_ALPHA +Proto BLEND_ALPHA =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: (srcA * srcA + dstA * (255-srcA))>>8 -> dstA (srcR * srcA + dstR * (255-srcA))>>8 -> dstR (srcG * srcA + dstG * (255-srcA))>>8 -> dstG (srcB * srcA + dstB * (255-srcA))>>8 -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_AND +Proto BLEND_AND =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: srcA & dstA -> dstA srcR & dstR -> dstR srcG & dstG -> dstG srcB & dstB -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_MAX +Proto BLEND_MAX =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: max srcA dstA -> dstA max srcR dstR -> dstR max srcG dstG -> dstG max srcB dstB -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_MIN +Proto BLEND_MIN =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: min srcA dstA -> dstA min srcR dstR -> dstR min srcG dstG -> dstG min srcB dstB -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_MUL +Proto BLEND_MUL =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: (srcA * dstA)>>8 -> dstA (srcR * dstR)>>8 -> dstR (srcG * dstG)>>8 -> dstG (srcB * dstB)>>8 -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_NONE +Proto BLEND_NONE =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: srcA -> dstA srcR -> dstR srcG -> dstG srcB -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_OR +Proto BLEND_OR =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: srcA | dstA -> dstA srcR | dstR -> dstR srcG | dstG -> dstG srcB | dstB -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_SUB +Proto BLEND_SUB =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: max 0 (srcA + dstA) -> dstA max 0 (srcR + dstR) -> dstR max 0 (srcG + dstG) -> dstG max 0 (srcB + dstB) -> dstB // // //------------------ PROTO ----------------------------------------------------- BLEND_XOR +Proto BLEND_XOR =type BlendFunction =mode constant =pkg bios =impl native =link =desc Blending function: srcA ^ dstA -> dstA srcR ^ dstR -> dstR srcG ^ dstG -> dstG srcB ^ dstB -> dstB // // //------------------ PROTO ----------------------------------------------------- COMP_A +Proto COMP_A =type Component =mode constant =pkg bios =impl native =link =desc A component constant: alpha channel // // //------------------ PROTO ----------------------------------------------------- COMP_A_INV +Proto COMP_A_INV =type Component =mode constant =pkg bios =impl native =link =desc A component constant: inverse alpha channel // // //------------------ PROTO ----------------------------------------------------- COMP_B +Proto COMP_B =type Component =mode constant =pkg bios =impl native =link =desc A component constant: blue channel // // //------------------ PROTO ----------------------------------------------------- COMP_B_INV +Proto COMP_B_INV =type Component =mode constant =pkg bios =impl native =link =desc A component constant: inverse blue channel // // //------------------ PROTO ----------------------------------------------------- COMP_G +Proto COMP_G =type Component =mode constant =pkg bios =impl native =link =desc A component constant: green channel // // //------------------ PROTO ----------------------------------------------------- COMP_G_INV +Proto COMP_G_INV =type Component =mode constant =pkg bios =impl native =link =desc A component constant: inverse green channel // // //------------------ PROTO ----------------------------------------------------- COMP_R +Proto COMP_R =type Component =mode constant =pkg bios =impl native =link =desc A component constant: red channel // // //------------------ PROTO ----------------------------------------------------- COMP_R_INV +Proto COMP_R_INV =type Component =mode constant =pkg bios =impl native =link =desc A component constant: inverse red channel // // //------------------ PROTO ----------------------------------------------------- COMP_0 +Proto COMP_0 =type Component =mode constant =pkg bios =impl native =link =desc A component constant: zero // // //------------------ PROTO ----------------------------------------------------- COMP_255 +Proto COMP_255 =type Component =mode constant =pkg bios =impl native =link =desc A component constant: 255 // // //------------------ PROTO ----------------------------------------------------- Component +Proto Component =type Component =mode type =pkg bios =impl native =link =desc This is the type Component, used in function bitmapComponent. Each constant of type Component defines either a value (COMP_0 or COMP_255), an ARGB component or an inverse ARGB component. // // //------------------ PROTO ----------------------------------------------------- idct88 +Proto idct88 =type fun array Float -> array Float =mode function =pkg bios =impl native =link =desc This function is mostly used for jpeg decoding. It assumes that the matrix is a 8x8 matrix, and performs a fast IDCT operation on it (inverse discrete cosine transform). This function does not create a new array, it returns the existing array with updated values. // +arg matrix =type array Float =desc An array of exactly 64 values // +arg result =type array Float =desc The same array // // //------------------ PROTO ----------------------------------------------------- bitmapFromYCrCb +Proto bitmapFromYCrCb =type fun Bitmap -> Int =mode function =pkg bios =impl native =link =desc This function assumes that the entire bitmap is encoded in YCrCb colors. It converts all its pixels into RGB colors, without modifying the alpha component. This is usefull for jpeg decoding. // +arg bmp =type Bitmap =desc A bitmap // +arg result =type Int =desc Always 0 // // //------------------ PROTO ----------------------------------------------------- rgbFromYCrCb +Proto rgbFromYCrCb =type fun Int -> Int =mode function =pkg bios =impl native =link =desc This function converts an YCrCb 24bits color into the corresponding RGB 24bits. // +arg yCrCb =type Int =desc An YCrCb color // +arg result =type Int =desc A RGB color // // //------------------ PROTO ----------------------------------------------------- dct88 +Proto dct88 =type fun array Float -> array Float =mode function =pkg bios =impl native =link =desc This function is mostly used for jpeg encoding. It assumes that the matrix is a 8x8 matrix, and performs a fast DCT operation on it (discrete cosine transform). This function does not create a new array, it returns the existing array with updated values. // +arg matrix =type array Float =desc An array of exactly 64 values // +arg result =type array Float =desc The same array // // //------------------ PROTO ----------------------------------------------------- bitmapToYCrCb +Proto bitmapToYCrCb =type fun Bitmap -> Int =mode function =pkg bios =impl native =link =desc This function assumes that the entire bitmap is encoded in RGB colors. It converts all its pixels into YCrCb colors, without modifying the alpha component. This is usefull for jpeg encoding. // +arg bmp =type Bitmap =desc A bitmap // +arg result =type Int =desc Always 0 // // //------------------ PROTO ----------------------------------------------------- yCrCbFromRgb +Proto yCrCbFromRgb =type fun Int -> Int =mode function =pkg bios =impl native =link =desc This function converts a RGB 24bits color into the corresponding YCrCb 24bits. // +arg rgb =type Int =desc A RGB color // +arg result =type Int =desc A YCrCb color // // //------------------ PROTO ----------------------------------------------------- BLEND_DESTINATION +Proto BLEND_DESTINATION =type BlendFunction =mode constant =pkg bios =impl native =link =desc This blending function does not affect the destination. It might be usefull to homogenize code, instead of inserting conditional statements. // // //------------------ PROTO ----------------------------------------------------- CORNER_BOTTOM_LEFT +Proto CORNER_BOTTOM_LEFT =type Int =mode constant =pkg bios =impl native =link =desc A constant to be used with [[bitmapCorners]] // // //------------------ PROTO ----------------------------------------------------- CORNER_BOTTOM_RIGHT +Proto CORNER_BOTTOM_RIGHT =type Int =mode constant =pkg bios =impl native =link =desc A constant to be used with [[bitmapCorners]] // // //------------------ PROTO ----------------------------------------------------- CORNER_TOP_LEFT +Proto CORNER_TOP_LEFT =type Int =mode constant =pkg bios =impl native =link =desc A constant to be used with [[bitmapCorners]] // // //------------------ PROTO ----------------------------------------------------- CORNER_TOP_RIGHT +Proto CORNER_TOP_RIGHT =type Int =mode constant =pkg bios =impl native =link =desc A constant to be used with [[bitmapCorners]] // // //------------------ PROTO ----------------------------------------------------- bitmapCorners +Proto bitmapCorners =type fun Bitmap Int Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function adds corners to an existing bitmap. It modifies only the alpha component. You provide the radius, it can't be greater than half the width or half the height of the bitmap. You provide also the list of the corners to draw. Pass 0 or nil to draw all 4 corners. // +arg bmp =type Bitmap =desc A bitmap // +arg r =type Int =desc The radius (in pixels) // +arg corners =type Int =desc A mask of corners: [[CORNER_BOTTOM_LEFT]], [[CORNER_BOTTOM_RIGHT]], [[CORNER_TOP_LEFT]], [[CORNER_TOP_RIGHT]]. 0 or [[nil]] for all corners. // +arg result =type Bitmap =desc The same bitmap // // //------------------ PROTO ----------------------------------------------------- bitmapGradient +Proto bitmapGradient =type fun Bitmap Int Int Int -> Bitmap =mode function =pkg bios =impl native =link =desc This function draws a gradient of colors in a bitmap. You only provide 3 colors for top left, top right and bottom left corner. It modifies all the pixels in the bitmap. You may use it to draw nice backgrounds in bitmaps. // +arg bmp =type Bitmap =desc A bitmap // +arg color00 =type Int =desc an ARGB color for the top left corner // +arg colorW0 =type Int =desc an ARGB color for the top right corner // +arg color0H =type Int =desc an ARGB color for the bottom left corner // +arg result =type Bitmap =desc The same bitmap