summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/png.cpp
Commit message (Collapse)AuthorAgeFilesLines
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-46/+16
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* Allow loading PNG/JPEG/MS DIB bitmaps from Lua, and cleanup. Vas Crabb2023-04-131-83/+87
| | | | | | | | | | | Use VirtualAlloc rather than VirtualProtect on Windows to change page protection, as the latter can cause severe performance issues with some antivirus software. Added noexcept to lots of hash- and bitmap-related things, and added a little more error checking. Yes, I realise it will abort if an allocation fails while printing a log message, but if you get to that point, you're probably screwed already.
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-182/+270
| | | | | * Turned `core_file` into an implementation of `random_read_write`. * Turned PNG errors into a standard error category. * Added a helper for generating what look like derived classes on-the-fly.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-3/+3
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Low-level #include overhaul AJR2021-01-021-0/+1
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* util/png: Use std::string_view internally in another function AJR2020-12-221-8/+6
|
* util/png: Update add_text to take std::string_view for arguments AJR2020-12-211-11/+9
|
* Various improvements to image file handling: Vas Crabb2020-10-081-130/+123
| | | | | | | | | | | | | | | | | | | | | | | | Moved MS DIB parser out of ICO file reader and made it available for artwork and layout images. Added more efficient I/O and better error checking for JPEG file loading (MAME will no longer exit immediately on a bad JPEG file). Made caller responsible for opening files for loading images, to avoid decompressing images used in ZIP/7z artwork multiple times. Added support for JPEG and Windows DIB to picture_image_device. Added support for SVG image files in external artwork. Added support for using I/O port value for animation state and masking animation state values. Made bounds elements more flexible in layouts. Reworked headers to reduce dependencies. Updated layout file format documentation.
* Cleaned up bitmap API. Vas Crabb2020-09-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* recording: fix frame sync regression (nw) hap2020-06-191-3/+3
|
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-5/+5
|
* use C++ library includes (nw) firewave2020-01-221-2/+2
|
* Fix compilation errors with -Og Celelibi2018-12-111-1/+1
| | | | Signed-off-by: Celelibi <celelibi@gmail.com>
* that doesn't require an instance (nw) Vas Crabb2017-09-031-18/+18
|
* png: make verify_header public (nw) hap2017-09-021-15/+26
|
* add a not BIOS machine filter (useful in composite filters), support RGB PNG ↵ Vas Crabb2017-08-151-7/+19
| | | | with transparent pen because why not
* fix indexed transparency (nw) Vas Crabb2017-08-141-3/+3
|
* PNG: support greyscale with transparent pen, encode/decode text chunks as ↵ Vas Crabb2017-08-141-99/+162
| | | | UTF-8, don't crash on trying to write back a text chunk read from a PNG file, enforce restrictions on keywords
* png: make it not leak memory by default, and look a but more like C++ Vas Crabb2017-08-131-431/+368
|
* png: support 16-bit samples Vas Crabb2017-08-131-21/+35
|
* PNG: fix unfiltering Vas Crabb2017-08-121-76/+71
|
* ui: save/restore images/info selection in right panel Vas Crabb2017-08-121-0/+2
|
* More PNG handling overhaul: Vas Crabb2017-08-121-115/+211
| | | | | | | * Unify code for copying PNG data into bitmap for MAME and pngcmp * Fix upsampling of monochrome PNGs (need to splat across byte) * Add support for greyscale+alpha * Detect more unsupported conditions rather than just behaving badly
* add minimal support for reading Adam7 interlaced PNG Vas Crabb2017-08-121-360/+372
| | | | | | | | | | | | | (nw) This is the path of least resistance, and I plan to fix it up later, I just wanted to get it to actually work first. Decompression and unfiltering is fully supported, at least for all the pixel formats that previously worked. Expanding 1/2/4bpp to 8bpp should work properly, too. Bitmap mapping for Adam7 is only implemented in rendutil.cpp which is whate everything in MAME uses. The function in png.cpp (used by pngcmp) has not been updated. At some point I'll unify at least one of the functions in rendutil.cpp with the one in png.cpp and we can go from three functions that need to do the mapping down to two at the most.
* more TRUE/FALSE cleanup (nw) Miodrag Milanovic2016-10-221-7/+7
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-55/+55
| | | | | 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
* made constexprs lower case and used constexpr for returning input value as ↵ Miodrag Milanovic2016-07-311-4/+4
| | | | well for rest of defines in osdcomm.h (nw)
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-5/+5
|
* Turn core_file into a proper class that gets cleaned up safely using unique_ptr Vas Crabb2016-03-061-31/+31
| | | | Subverted somewhat by chd_file class
* macro removal INLINE -> static inline (nw) Miodrag Milanovic2015-12-121-8/+8
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-45/+45
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+1165