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
3e6d01748e
Merged default into minor
...
--HG--
branch : minor
2016-05-22 15:11:15 -03:00
Alex Szpakowski
9900051647
Improved performance of ImageData:mapPixel when JIT compilation is unavailable (e.g. on iOS and Android)
2016-05-21 22:18:12 +00:00
Alex Szpakowski
4666d83beb
Fixed ImageData:mapPixel again, for non-JIT platforms this time.
...
--HG--
branch : minor
2016-05-21 15:24:11 -03:00
Alex Szpakowski
ed933847f8
Color values in love's APIs are now in the range of [0, 1] rather than [0, 255].
...
--HG--
branch : minor
2016-01-31 10:49:29 -04:00
Alex Szpakowski
46a2e7b85c
Happy new year! 🎉
2016-01-01 00:05:06 -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
2168d509b3
Reworked ImageData:encode:
...
- It now returns a FileData containing the encoded ImageData.
- The first argument is now the format to encode to.
- The second argument is now the filename to write to, and is optional. No file will be written if a filename is not given.
2015-07-04 22:30:09 -03:00
Bart van Strien
3cb777e2b7
Add basic lua 5.3 support
2015-06-16 10:25:41 +02:00
Alex Szpakowski
df1bd42dec
Implemented efficient FFI versions of ImageData methods.
...
Note that ImageData:mapPixel (with its optional sub-rectangle parameters) is often many times faster than a loop of ImageData:setPixel and/or getPixel, for anything more than a few pixels.
2015-06-15 00:50:01 -03:00
Alex Szpakowski
aac595525a
Cleaned up some ImageData code.
2015-06-14 01:01:44 -03:00
Alex Szpakowski
2f419c1c83
Replaced most cases of type bits and type name strings in love's Lua wrapper code with type id's.
...
--HG--
branch : minor
2015-03-01 18:32:41 -04:00
Alex Szpakowski
c7b45b3505
Updated copyright for the new year
2014-12-31 19:32:43 -04:00
Alex Szpakowski
dfa319e01a
Replaced the EXCEPT_GUARD macro for converting love exceptions into Lua errors with the new luax_catchexcept function, which takes lambda function arguments.
2014-06-03 19:27:00 -03:00
Alex Szpakowski
3120a0e650
Goodbye 2013, hello 2014!
2014-01-03 17:28:58 -04:00
Alex Szpakowski
e068aab6ea
The function passed to ImageData:mapPixel must return at least r,g,b. Alpha component defaults to 255 (resolves issue #603 )
2013-10-12 00:40:18 -03:00
Alex Szpakowski
06f80d5c08
Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729 )
2013-09-05 23:17:29 -03:00
Alex Szpakowski
c15fc4453b
Re-added Data:getPointer (can be used with LuaJIT's FFI)
2013-08-29 17:16:21 -03:00
Alex Szpakowski
bcc85f884e
ImageData:mapPixel can now take optional x,y,w,h parameters to constrain it to a rectangle in the ImageData
2013-07-11 01:10:19 -03:00
Alex Szpakowski
b04a2fee87
Improved performance when using ImageData methods in multiple threads when ImageData:encode is called
2013-06-26 03:42:42 -03:00
Alex Szpakowski
b8efa6372b
oops
2013-06-25 05:37:44 -03:00
Alex Szpakowski
6e3a7288dd
Improved performance of ImageData:mapPixel (now up to 2x as fast as in 0.8.0!); love.graphics.newImage, Image:refresh, love.window.setIcon, and ImageRasterizers now prevent other threads from modifying the ImageData used in those functions until they're done accessing it
2013-06-25 05:28:20 -03:00
Bart van Strien
402ae4638a
Make ImageData:setPixel accept a table (issue #582 )
2013-05-10 17:28:55 +02:00
Alex Szpakowski
3bf43dadd8
Renamed CompressedData:getNumMipmaps to CompressedData:getMipmapCount; Improved type-checking error messages for some functions which expect function arguments
2013-05-02 17:26:50 -04:00
Alex Szpakowski
fb9f8d2962
Added the getString method to all Data objects (issue #608 )
2013-04-26 22:35:01 -07:00
Alex Szpakowski
16f3a93f28
Removed vestigial internal code for Data:getPointer
2013-04-26 22:05:58 -07:00
Alex Szpakowski
e9ff803c42
alpha values for ImageData:mapPixel default to 255 (issue #603 )
2013-04-19 14:20:11 -03:00
Alex Szpakowski
7403245715
Cosmetic code improvements
...
--HG--
branch : image-CompressedData
2013-04-07 22:58:08 -03:00
Alex Szpakowski
d5aa807747
More internal code cleanup
2013-03-31 19:02:27 -03:00
darthfodder
275a144907
Remove commented out line
2013-03-25 20:43:51 -07:00
darthfodder
69ccf4aaa1
Set default alpha value on ImageData:setPixel to 255. resolves #575
...
--HG--
branch : imagedata-alpha-default
2013-03-25 11:42:19 -07:00
Alex Szpakowski
17bcab4f32
Added love.graphics.getDimensions and Image/Canvas/ImageData:getDimensions (issue #566 )
2013-03-11 19:03:37 -03:00
Alex Szpakowski
96161c66f6
Updated copyright text for the new year
2013-02-05 05:32:49 -04:00
Bart van Strien
7793e7f02f
CRLF to LF
2012-07-04 14:40:24 +02:00
rude
81c38e22d0
Applied the new style guidelines.
...
Well, sort of. Lot's more to be done, but this is a start.
2012-06-28 23:52:33 +02:00
Boolsheet
73672bd674
Clean up love.image because we own the memory, not DevIL
2012-05-29 23:36:49 +02:00
Bart van Strien
830283ff17
Properly catch exceptions thrown by ImageData:getPixel/setPixel, thereby preventing an uncaught exception for an invalid index. (Bug #381 )
2012-03-03 12:35:55 +01:00
Bart van Strien
d525349549
Fix usage of a string past its lifetime, and set a default type for encode
2012-01-12 11:30:09 +01:00
Bill Meltsner
be55579a22
Happy New Year, have an enormous diff
2012-01-09 02:41:11 -06:00
Bart van Strien
c707a4ca45
Properly export all lua-facing functions and use those for initialization (love.cpp no longer explicitly mentions implementations)
2011-12-24 01:10:40 +01:00
Bart van Strien
0aae9684b3
Automated formatting fix
2011-11-16 11:32:41 +01:00
Bart van Strien
ceab3f7a44
Catch exceptions thrown while encoding image data (issue #282 )
2011-08-22 18:07:50 +02:00
Bart van Strien
94ec448a1b
Fix getPixel
2011-07-03 12:49:11 +02:00
Bart van Strien
f993fe99d3
Catch errors in getPixel and setPixel (bug #93 )
2011-07-02 16:24:58 +02:00
Bill Meltsner
cee7a4ccdb
Removed EncodedImageData, added three new encoded image formats, and changed the way screenshots work - saving screenshots will be broken until we have some way of flipping ImageData, though
...
--HG--
branch : minor
2011-03-19 23:41:07 -05:00
Bill Meltsner
fde708160e
bringing in the new year by changing every 2010 to 2011
2011-01-15 14:40:27 -06:00
Bill Meltsner
b1dac7f381
EncodedImageData was implemented really stupidly. Now it's less stupid.
2010-04-11 23:09:29 -04:00
rude
aa01c984b9
Updated all dates to 2010.
2010-01-31 16:54:47 +01:00
rude
dd420d68a3
Ok, project generation didn't really work out. Reverted.
2009-08-10 21:33:07 +02:00