103% of use cases use the returned value directly without checking, so
we might as well do the check ourselves. Added new function hasCurrent()
and added deprecated backward-compatibility conversion and -> operators.
Wow, that creeped to a lot of places.
Last dinosaur from the pointer age.
I would set the alignment to 1 every time, but 99% of image data has sane
dimensions and this would only bring needless state changes.
Note that this setting is not yet respected when uploading the texture
data, that will be done in later "pixel storage support" commits.
Makes it far easier to detect pixel storage misconfigurations and
improperly sized data arrays. Data owning classes (Image,
Trade::ImageData) accept Containers::Array<char> while wrappers
(ImageView, BufferImage) accept Containers::ArrayView<const void>.
ImageView reinterprets the passed array as const char to enable pointer
arithmetic on the data.
The old way (constructor/setData() call accepting void*) is now marked as
deprecated and will be removed in some future release. Because decay of
fixed-size arrays to void* is preferred to calling Containers::ArrayView
constructor, there are two more overloads to have proper handling of
const T(&)[n] and std::nullptr_t arguments.
Currently the TgaImporter and TgaImageConverter fail on images with row
length not aligned to 4, will fix that in followup commits.
Yeah, sorry, I know, the enums are renamed for second or third time in a
row, first they were Image::Format, then ImageFormat, then ColorFormat
and now PixelFormat. But this time it's final and last time they are
renamed and now everything is finally consistent:
* ColorFormat::DepthComponent -- depth is not a color, thus
PixelFormat::DepthComponent makes a lot more sense.
* There will be PixelStorage classes, which will be stored in images
alonside PixelFormat/PixelType enums, making everything nicely
aligned.
* The GL documentation about glTexImage2D() etc. denotes the <format>
and <type> parameters as format and type of *pixel* data, so now we
are _finally_ consistent with the official naming.
I wonder why did I not choose PixelFormat originally. Anyway, the old
<Magnum/ColorFormat.h> header, ColorFormat, ColorType and
CompressedColorFormat types are now aliases to the new ones, are marked
as deprecated and will be removed in some future release (as always, I'm
waiting at least six months before removing the deprecated
functionality).
Swizzle to RGB/RGBA on all platforms. Usability over (minor) performance
benefits. Otherwise we would be like the ugly mess called QImage (in
Qt4 at least).
`char*` is now the default type for byte arrays. Results in shorter
code, less annoyances and more convenient testing. As is the case with
Corrade, I'm not doing any compatibility/deprecation layer, as most of
these functions is not widely used anyway.
Took me TWO CRAZY HOURS of blaming visual studio, as it stopped reading
in the middle of the file without any reasonable error message ("stream
error", haha).
Commit mosra/corrade@9485ef7effd6c8241e03982c53e8fabfe260b525 broke
this, apparently the compiler can't decide which overload to select when
a type has implicit conversion to another type which is then supported
by both Debug and std::ostream operator<<. Working around this for now as
it is the only case, hopefully we won't run into something similar later.
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
It looks like I forgot to `delete` three times in the tests. It just
proves that the previous API was flawed (or unusable for people spoilt
with RAII like me).
Not sure how to handle everything properly (e.g. namespaces and naming
for implementation classes, tests...), will update coding style for
plugins accordingly later.
Solves the problem about image deletion, the image is imported again on
every request and the user is responsible for its deletion. Now also
asserting that the file is opened and that the image ID is zero.