|
KiCad PCB EDA Suite
|
#include <sch_io/ole_image.h>#include <algorithm>#include <boost/endian/conversion.hpp>#include <memory>#include <utility>#include <optional>#include <array>#include <cmath>#include <limits>#include <string_view>#include <wx/buffer.h>#include <wx/filename.h>#include <wx/image.h>#include <math/vector2d.h>#include <wx/log.h>#include <compoundfilereader.h>#include <paths.h>#include <trace_helpers.h>#include <libwmf/api.h>#include <libwmf/gd.h>Go to the source code of this file.
Functions | |
| std::optional< std::pair< size_t, size_t > > | OleEmbeddedCompoundFile (const std::vector< uint8_t > &aPayload) |
| The 26-byte prologue stores length at offset 22 and length plus 22 at offset 0. | |
| OLE_IMAGE_PAYLOAD | ExtractOleImage (const uint8_t *aCfb, size_t aSize) |
| Prefer CONTENTS, then OlePres000, then the native stream. | |
| OLE_IMAGE_PAYLOAD | ExtractOleImageFromPayload (const std::vector< uint8_t > &aPayload) |
| Read the picture out of an OLE object payload that carries the 26-byte prologue. | |
| bool | OleMakeBmpFromDib (const std::vector< uint8_t > &aDib, wxMemoryBuffer &aOut) |
| std::vector< uint8_t > | OleExtractEmbeddedEmf (const std::vector< uint8_t > &aWmf) |
| Reassemble an EMF carried by WMF META_ESCAPE_ENHANCED_METAFILE records. | |
| std::vector< uint8_t > | OleExtractCiImage (const std::vector< uint8_t > &aPayload) |
| The CI marker follows the preview DIB; the raster has a counted decimal length. | |
| VECTOR2I | OleWmfRenderSize (int aNaturalWidth, int aNaturalHeight, int aMaxWidth, int aMaxHeight, double aTargetAspect) |
| bool | OleRenderWmf (const std::vector< uint8_t > &aWmf, int aMaxWidth, int aMaxHeight, wxImage &aImage, double aTargetAspect) |
| bool | OleRenderMetafilePreview (const std::vector< uint8_t > &aWmf, int aMaxWidth, int aMaxHeight, wxImage &aImage, double aTargetAspect, bool *aUsedEmbeddedEmf) |
| Render a metafile preview, preferring an EMF the WMF carries over the WMF itself. | |
| wxString | OleDescribeImagePayload (const std::vector< uint8_t > &aPayload) |
| Include leading bytes when the payload format is unknown. | |
| OLE_IMAGE_PAYLOAD ExtractOleImage | ( | const uint8_t * | aCfb, |
| size_t | aSize ) |
Prefer CONTENTS, then OlePres000, then the native stream.
Definition at line 276 of file ole_image.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ExtractOleImage(), and ExtractOleImageFromPayload().
| OLE_IMAGE_PAYLOAD ExtractOleImageFromPayload | ( | const std::vector< uint8_t > & | aPayload | ) |
Read the picture out of an OLE object payload that carries the 26-byte prologue.
Definition at line 331 of file ole_image.cpp.
References ExtractOleImage(), and OleEmbeddedCompoundFile().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::placeBitmap().
| wxString OleDescribeImagePayload | ( | const std::vector< uint8_t > & | aPayload | ) |
Include leading bytes when the payload format is unknown.
Definition at line 697 of file ole_image.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::placeBitmap().
| std::optional< std::pair< size_t, size_t > > OleEmbeddedCompoundFile | ( | const std::vector< uint8_t > & | aPayload | ) |
The 26-byte prologue stores length at offset 22 and length plus 22 at offset 0.
Definition at line 250 of file ole_image.cpp.
Referenced by ExtractOleImageFromPayload(), and OleExtractCiImage().
| std::vector< uint8_t > OleExtractCiImage | ( | const std::vector< uint8_t > & | aPayload | ) |
The CI marker follows the preview DIB; the raster has a counted decimal length.
Definition at line 477 of file ole_image.cpp.
References image, and OleEmbeddedCompoundFile().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::placeBitmap().
| std::vector< uint8_t > OleExtractEmbeddedEmf | ( | const std::vector< uint8_t > & | aWmf | ) |
Reassemble an EMF carried by WMF META_ESCAPE_ENHANCED_METAFILE records.
Definition at line 384 of file ole_image.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and OleRenderMetafilePreview().
| bool OleMakeBmpFromDib | ( | const std::vector< uint8_t > & | aDib, |
| wxMemoryBuffer & | aOut ) |
Definition at line 348 of file ole_image.cpp.
Referenced by ORCAD_CONVERTER::placeBitmap().
| bool OleRenderMetafilePreview | ( | const std::vector< uint8_t > & | aWmf, |
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| wxImage & | aImage, | ||
| double | aTargetAspect, | ||
| bool * | aUsedEmbeddedEmf ) |
Render a metafile preview, preferring an EMF the WMF carries over the WMF itself.
Definition at line 677 of file ole_image.cpp.
References OleExtractEmbeddedEmf(), OleRenderEmf(), and OleRenderWmf().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ORCAD_CONVERTER::placeBitmap().
| bool OleRenderWmf | ( | const std::vector< uint8_t > & | aWmf, |
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| wxImage & | aImage, | ||
| double | aTargetAspect ) |
Definition at line 584 of file ole_image.cpp.
References OleWmfRenderSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and OleRenderMetafilePreview().
| VECTOR2I OleWmfRenderSize | ( | int | aNaturalWidth, |
| int | aNaturalHeight, | ||
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| double | aTargetAspect ) |
Definition at line 554 of file ole_image.cpp.
References KiROUND(), and scale.
Referenced by BOOST_AUTO_TEST_CASE(), OleRenderEmf(), and OleRenderWmf().