diff options
author | 2020-10-08 02:04:31 +1100 | |
---|---|---|
committer | 2020-10-08 02:04:31 +1100 | |
commit | b90fd355150a0f56e368bb33619459b19ec92bee (patch) | |
tree | 41ac320a4199b0856a485c9d75458dbc98aa168e /src/lib/util/msdib.h | |
parent | 4b0903bfdbe88d4e220fc2c2f140e7b503060909 (diff) |
Various improvements to image file handling:
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.
Diffstat (limited to 'src/lib/util/msdib.h')
-rw-r--r-- | src/lib/util/msdib.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/lib/util/msdib.h b/src/lib/util/msdib.h new file mode 100644 index 00000000000..54767e216fb --- /dev/null +++ b/src/lib/util/msdib.h @@ -0,0 +1,46 @@ +// license:BSD-3-Clause +// copyright-holders:Vas Crabb +/*************************************************************************** + + msdib.h + + Microsoft Device-Independent Bitmap file loading. + +***************************************************************************/ +#ifndef MAME_LIB_UTIL_MSDIB_H +#define MAME_LIB_UTIL_MSDIB_H + +#pragma once + +#include "bitmap.h" +#include "corefile.h" +#include "osdcore.h" + +#include <cstdint> + + +namespace util { + +/*************************************************************************** + CONSTANTS +***************************************************************************/ + +// Error types +enum class msdib_error +{ + NONE, + OUT_OF_MEMORY, + FILE_ERROR, + BAD_SIGNATURE, + FILE_TRUNCATED, + FILE_CORRUPT, + UNSUPPORTED_FORMAT +}; + +msdib_error msdib_verify_header(core_file &fp); +msdib_error msdib_read_bitmap(core_file &fp, bitmap_argb32 &bitmap); +msdib_error msdib_read_bitmap_data(core_file &fp, bitmap_argb32 &bitmap, std::uint32_t length, std::uint32_t dirheight = 0U); + +} // namespace util + +#endif // MAME_LIB_UTIL_MSDIB_H |