Commit Graph

22 Commits

Author SHA1 Message Date
Alex Szpakowski 0a3adc0839 Unify pixel format enums for ImageData, CompressedImageData, and Canvas into a single PixelFormat enum.
Replace love.graphics.getRawImageFormats and love.graphics.getCompressedImageFormats with love.graphics.getImageFormats.

--HG--
branch : minor
2016-11-27 22:53:23 -04:00
Alex Szpakowski e71f95595c ImageData (and Images loaded from them) now support different data formats. Resolves issue #1048.
Currently exposed formats are rgba8 and rgba16 (normalized), and rgba16f and rgba32f (floating-point). Some systems, especially mobile ones, won't support every format when creating a love.graphics Image. Use love.graphics.getRawImageFormats to check for support.

love.image.newImageData now takes an optional format parameter as its third argument when creating an empty sized ImageData. It defaults to rgba8.

16-bit PNGs, .hdr images, and floating-point OpenEXR images can now be loaded via love.image.newImageData and love.graphics.newImage.

--HG--
branch : minor
2016-05-22 15:28:20 -03:00
Alex Szpakowski 46a2e7b85c Happy new year! 🎉 2016-01-01 00:05:06 -04:00
Bart van Strien 22f2175bec Add initial video playback support for Ogg Theora videos (resolves issue #66.)
The basic APIs are:

video = love.graphics.newVideo("myvideo.ogv")

love.graphics.draw(video, ...) -- Video objects are Drawables.

video:play(), video:pause()

video:getDuration(), video:tell(), video:rewind(), video:seek(seconds)

video:getSource()

video:getWidth(), video:getHeight(), video:setFilter(min, mag)

More advanced APIs include video:setSource(source), video:getStream(), and videostream:setSync.

To use a custom pixel shader when drawing a Video, call the new TexelVideo(texcoords) function instead of Texel(texture, texcoords) in order to get the pixel colors of a video frame.
2015-12-08 22:41:19 -04:00
Alex Szpakowski 2c4e713114 Imported some of the dynamiccore branch from love-experiments:
- Type names for love's Lua objects are specified as an argument to luax_register_type, rather than being statically defined in an array.

- luax_register_type takes a variable number of method array arguments, for registering superclass methods without copying them into the subclass' method array.

Also removed most of the header declarations for wrapper functions.
2015-11-29 20:38:12 -04:00
Alex Szpakowski 77998c707d Added the ability to use ASTC compressed textures, when the system supports them. 2015-11-28 14:55:26 -04:00
Alex Szpakowski 60e8cc24bf Removed iOS-specific code to decode and encode images using the ImageIO framework (it's now redundant.) 2015-05-03 20:49:06 -03:00
Alex Szpakowski 5dbf589d47 Removed libjpeg-turbo as a dependency (closes issue #1031.) Removed jpeg support for ImageData:encode. stb_image now handles jpeg image loading. 2015-05-03 17:52:20 -03:00
Alex Szpakowski a29b349014 Added love.math.compress(data, format [, level]) and love.math.decompress(compresseddata) / love.math.decompress(compressedstring, format).
Renamed the love.image CompressedData type to CompressedImageData.

love.math.compress returns a love.math CompressedData object which holds the newly compressed data. Currently supported formats are "lz4" and "zlib". Note that the formats are not file formats and don't compress filesystem hierarchies.
2015-03-23 11:28:14 -03:00
Alex Szpakowski d0300a4fa7 Made the TurboJPEG code for decoding and encoding images disable-able.
--HG--
branch : minor
2015-02-18 00:18:47 -04:00
Alex Szpakowski 482b61187f Added a new backend for loading and saving images using Apple's ImageIO framework. It's not enabled on any platform yet.
--HG--
branch : minor
2015-02-17 17:56:40 -04:00
Alex Szpakowski dfdd52e499 Added support for ETC1 and PVR1 compressed textures contained in KTX, PKM, and PVR files.
Most desktop graphics drivers don't support those formats.

--HG--
branch : minor
2015-01-20 03:18:28 -04:00
Alex Szpakowski a7e4148869 Merged default into minor
--HG--
branch : minor
2015-01-16 15:47:26 -04:00
Alex Szpakowski c7b45b3505 Updated copyright for the new year 2014-12-31 19:32:43 -04:00
Alex Szpakowski 51d1f2a7a9 Added support for loading TGA and BMP images (via stb_image.) Added support for encoding ImageData to TGA.
--HG--
branch : minor
2014-05-29 13:20:10 -03:00
Alex Szpakowski f3701dc0e1 Fixed ImageData:encode
--HG--
branch : minor
2014-05-29 00:27:40 -03:00
Alex Szpakowski eca8c17a69 Removed the DevIL backend from love.image. Replaced it with PNG and JPEG encoders/decoders via LodePNG, zlib, and libjpeg-turbo.
PNG and JPEG are now the only two supported image formats, aside from compressed DDS (DXT, etc.)

--HG--
branch : minor
2014-04-22 17:11:59 -03:00
Alex Szpakowski a3afb1a9ca Refactored the ImageData decoding/encoding backends a bit 2014-03-02 03:17:47 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski f25efcc8af Improved performance and reduced temporary memory usage of love.graphics.newScreenshot and Canvas:getImageData 2013-06-15 22:07:16 -03:00
Alex Szpakowski ce59756463 Fixed a case-sensitivity typo 2013-04-18 04:57:50 -03:00
Alex Szpakowski 88d64954a4 Replaced the devil love.image module with love.image.magpie, which can decide which image library to use in a similar manner to love.sound.lullaby. Some rough edges still exist.
love.filesystem.newFileData now accepts filepaths and File objects.

--HG--
branch : image-CompressedData
2013-04-07 17:18:34 -03:00