diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 2e76eb6d0b8..d5bea810ade 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -4,7 +4,7 @@ Image datatype. - Native image datatype. Contains image data, which can be converted to a texture, and several functions to interact with it. + Native image datatype. Contains image data, which can be converted to a [Texture], and several functions to interact with it. The maximum width and height for an [code]Image[/code] is 16384 pixels. @@ -21,7 +21,7 @@ - Alpha-blends a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] on coordinates "dest". + Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dest[/code]. @@ -36,7 +36,7 @@ - Alpha-blends a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] using a "mask" [code]Image[/code] on coordinates "dest". Alpha channels are required for both "src" and "mask", dest pixels and src pixels will blend if the corresponding mask pixel's alpha value is not 0. "src" [code]Image[/code] and "mask" [code]Image[/code] *must* have the same size (width and height) but they can have different formats + Alpha-blends [code]src_rect[/code] from [code]src[/code] image to this image using [code]mask[/code] image at coordinates [code]dst[/code]. Alpha channels are required for both [code]src[/code] and [code]mask[/code]. [code]dst[/code] pixels and [code]src[/code] pixels will blend if the corresponding mask pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. @@ -49,7 +49,7 @@ - Copy a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] on coordinates "dest". + Copies [code]src_rect[/code] from [code]src[/code] image to this image at coordinates [code]dst[/code]. @@ -64,13 +64,14 @@ - Blits a "src_rect" [Rect2] from "src" [code]Image[/code] to this [code]Image[/code] using a "mask" [code]Image[/code] on coordinates "dest". Alpha channel is required for "mask", will copy src pixel onto dest if the corresponding mask pixel's alpha value is not 0. "src" [code]Image[/code] and "mask" [code]Image[/code] *must* have the same size (width and height) but they can have different formats + Blits [code]src_rect[/code] area from [code]src[/code] image to this image at the coordinates given by [code]dst[/code]. [code]src[/code] pixel is copied onto [code]dst[/code] if the corresponding [code]mask[/code] pixel's alpha value is not 0. [code]src[/code] image and [code]mask[/code] image [b]must[/b] have the same size (width and height) but they can have different formats. + Removes the image's mipmaps. @@ -83,6 +84,7 @@ + Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See [code]COMPRESS_*[/code] constants. @@ -91,6 +93,7 @@ + Converts the image's format. See [code]FORMAT_*[/code] constants. @@ -99,6 +102,7 @@ + Copies [code]src[/code] image to this image. @@ -113,7 +117,7 @@ - Create an empty image of a specific size and format. + Creates an empty image of given size and format. See [code]FORMAT_*[/code] constants. If [code]use_mipmaps[/code] is true then generate mipmaps for this image. See the [code]generate_mipmaps[/code] method. @@ -130,6 +134,7 @@ + Creates a new image of given size and format. See [code]FORMAT_*[/code] constants. Fills the image with the given raw data. If [code]use_mipmaps[/code] is true then generate mipmaps for this image. See the [code]generate_mipmaps[/code] method. @@ -140,24 +145,28 @@ + Crops the image to the given [code]width[/code] and [code]height[/code]. If the specified size is larger than the current size, the extra area is filled with black pixels. + Decompresses the image if it is compressed. Returns an error if decompress function is not available. + Returns ALPHA_BLEND if the image has data for alpha values. Returns ALPHA_BIT if all the alpha values are below a certain threshold or the maximum value. Returns ALPHA_NONE if no data for alpha values is found. + Stretches the image and enlarges it by a factor of 2. No interpolation is done. @@ -166,52 +175,56 @@ - Fills an [code]Image[/code] with a specified [Color] + Fills the image with a given [Color]. + Blends low-alpha pixels with nearby pixels. + Flips the image horizontally. + Flips the image vertically. + Generates mipmaps for the image. Mipmaps are pre-calculated and lower resolution copies of the image. Mipmaps are automatically used if the image needs to be scaled down when rendered. This improves image quality and the performance of the rendering. Returns an error if the image is compressed, in a custom format or if the image's width/height is 0. - Return the raw data of the [code]Image[/code]. + Returns the image's raw data. - Return the format of the [code]Image[/code], one of [code]Image[/code].FORMAT_*. + Returns the image's raw data. - Return the height of the [code]Image[/code]. + Returns the image's height. @@ -220,6 +233,7 @@ + Returns the offset where the image's mipmap with index [code]mipmap[/code] is stored in the [code]data[/code] dictionary. @@ -230,6 +244,7 @@ + Returns the color of the pixel at [code](x, y)[/code] if the image is locked. If the image is unlocked it always returns a [Color] with the value [code](0, 0, 0, 1.0)[/code]. @@ -238,51 +253,56 @@ - Return a new [code]Image[/code] that is a copy of "area" in this [code]Image[/code]. + Returns a new image that is a copy of the image's area specified with [code]rect[/code]. + Returns the image's size (width and height). - Return the area of this [code]Image[/code] that is used/visibly colored/opaque. + Returns a [Rect2] enclosing the visible portion of the image. - Return the width of the [code]Image[/code]. + Returns the image's width. + Returns [code]true[/code] if the image has generated mipmaps. + Returns [code]true[/code] if the image is compressed. + Returns [code]true[/code] if the image has no data. + Returns [code]true[/code] if all the image's pixels have an alpha value of 0. Returns [code]false[/code] if any pixel has an alpha value higher than 0. @@ -291,25 +311,28 @@ - Load an [code]Image[/code]. + Loads an image from file [code]path[/code]. + Locks the data and prevents changes. + Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normalmap. A normalmap can add lots of detail to a 3D surface without increasing the polygon count. + Multiplies color values with alpha values. Resulting color values for a pixel are [code](color * alpha)/256[/code]. @@ -322,6 +345,7 @@ + Resizes the image to the given [code]width[/code] and [code]height[/code]. New pixels are calculated using [code]interpolation[/code]. See [code]interpolation[/code] constants. @@ -330,6 +354,7 @@ + Resizes the image to the nearest power of 2 for the width and height. If [code]square[/code] is [code]true[/code] then set width and height to be the same. @@ -338,7 +363,7 @@ - Save this [code]Image[/code] as a png. + Saves the image as a PNG file to [code]path[/code]. @@ -351,29 +376,43 @@ + Sets the [Color] of the pixel at [code](x, y)[/code] if the image is unlocked. Example: + [code] + var img = Image.new() + img.lock() + img.set_pixel(x, y, color) # Does not have an effect + img.unlock() + img.set_pixel(x, y, color) # Works + [/code]. + Shrinks the image by a factor of 2. + Converts the raw data from the sRGB colorspace to a linear scale. + Unlocks the data for writing access. - + + + Holds all of the image's color data in a given format. See [code]FORMAT_*[/code] constants. +