summaryrefslogtreecommitdiff
path: root/meta/3rd/love2d/library/love.image.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-20 19:36:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-20 19:36:35 +0800
commit7801b00a804bcd68aacda265afdf4d774486b4e9 (patch)
treedc73791db11a7c49f2eb25f9141d1497b6e1e7e3 /meta/3rd/love2d/library/love.image.lua
parentda6942640931afd8f39db0fc84e8e0394f95d9b1 (diff)
downloadlua-language-server-7801b00a804bcd68aacda265afdf4d774486b4e9.zip
update
Diffstat (limited to 'meta/3rd/love2d/library/love.image.lua')
-rw-r--r--meta/3rd/love2d/library/love.image.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love.image.lua
index 8fee22d4..85070b9c 100644
--- a/meta/3rd/love2d/library/love.image.lua
+++ b/meta/3rd/love2d/library/love.image.lua
@@ -9,6 +9,7 @@ love.image = {}
---
---Determines whether a file can be loaded as CompressedImageData.
---
+---@overload fun(fileData: love.FileData):boolean
---@param filename string # The filename of the potentially compressed image file.
---@return boolean compressed # Whether the file can be loaded as CompressedImageData or not.
function love.image.isCompressed(filename) end
@@ -16,6 +17,7 @@ function love.image.isCompressed(filename) end
---
---Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page.
---
+---@overload fun(fileData: love.FileData):love.CompressedImageData
---@param filename string # The filename of the compressed image file.
---@return love.CompressedImageData compressedImageData # The new CompressedImageData object.
function love.image.newCompressedData(filename) end
@@ -23,6 +25,10 @@ function love.image.newCompressedData(filename) end
---
---Creates a new ImageData object.
---
+---@overload fun(width: number, height: number, format: love.PixelFormat, data: string):love.ImageData
+---@overload fun(width: number, height: number, data: string):love.ImageData
+---@overload fun(filename: string):love.ImageData
+---@overload fun(filedata: love.FileData):love.ImageData
---@param width number # The width of the ImageData.
---@param height number # The height of the ImageData.
---@return love.ImageData imageData # The new blank ImageData object. Each pixel's color values, (including the alpha values!) will be set to zero.
@@ -41,6 +47,7 @@ local CompressedImageData = {}
---
---Gets the width and height of the CompressedImageData.
---
+---@overload fun(level: number):number, number
---@return number width # The width of the CompressedImageData.
---@return number height # The height of the CompressedImageData.
function CompressedImageData:getDimensions() end
@@ -54,6 +61,7 @@ function CompressedImageData:getFormat() end
---
---Gets the height of the CompressedImageData.
---
+---@overload fun(level: number):number
---@return number height # The height of the CompressedImageData.
function CompressedImageData:getHeight() end
@@ -66,6 +74,7 @@ function CompressedImageData:getMipmapCount() end
---
---Gets the width of the CompressedImageData.
---
+---@overload fun(level: number):number
---@return number width # The width of the CompressedImageData.
function CompressedImageData:getWidth() end
@@ -80,6 +89,8 @@ local ImageData = {}
---
---Encodes the ImageData and optionally writes it to the save directory.
---
+---@overload fun(outFile: string)
+---@overload fun(outFile: string, format: love.ImageFormat)
---@param format love.ImageFormat # The format to encode the image as.
---@param filename string # The filename to write the file to. If nil, no file will be written but the FileData will still be returned.
---@return love.FileData filedata # The encoded image as a new FileData object.