From 7801b00a804bcd68aacda265afdf4d774486b4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 20 Jul 2021 19:36:35 +0800 Subject: update --- meta/3rd/love2d/library/love.image.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'meta/3rd/love2d/library/love.image.lua') 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. -- cgit v1.2.3