summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/bitmap.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Cleaned up bitmap API. Vas Crabb2020-09-271-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* util/bitmap.cpp: Use std::fill_n to get better code for modern CPUs. Vas Crabb2020-09-201-74/+15
|
* use C++ library includes (nw) firewave2020-01-221-1/+1
|
* Make bitmap8_t, bitmap16_t, bitmap32_t and bitmap64_t specializations of one ↵ AJR2019-09-161-0/+39
| | | | class template (nw)
* make rectangle work better with constexpr, change many things to use ↵ Vas Crabb2018-07-281-30/+30
| | | | designated getters/setters (nw)
* Make bitmaps movable, allowing them to be used in vectors and emplaced easily. Vas Crabb2016-12-151-36/+67
| | | | You're still responsible for ensuring you don't move a bitmap while a texture refers to it.
* More ie15 optimizations, nw. Also removes cache-line padding of dubious ↵ therealmogminer@gmail.com2016-10-231-21/+4
| | | | performance value in core bitmap class in favor of behavior of least surprise
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-37/+37
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-12/+12
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+456