|
KiCad PCB EDA Suite
|
#include <cstddef>#include <cstdint>#include <optional>#include <string>#include <utility>#include <vector>#include <math/vector2d.h>#include <wx/string.h>Go to the source code of this file.
Classes | |
| struct | OLE_IMAGE_PAYLOAD |
Enumerations | |
| enum class | OLE_IMAGE_TYPE { NONE , BMP , DIB , WMF } |
Functions | |
| OLE_IMAGE_PAYLOAD | ExtractOleImage (const uint8_t *aCfb, size_t aSize) |
| Prefer CONTENTS, then OlePres000, then the native stream. | |
| OLE_IMAGE_PAYLOAD | ExtractOleImage (const std::vector< uint8_t > &aCfb) |
| 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 | ExtractOleImageFromPayload (const std::vector< uint8_t > &aPayload) |
| Read the picture out of an OLE object payload that carries the 26-byte prologue. | |
| 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. | |
| wxString | OleDescribeImagePayload (const std::vector< uint8_t > &aPayload) |
| Include leading bytes when the payload format is unknown. | |
| wxString | OleLibWmfFontDirectory () |
| Locate the bundled libwmf fonts directory, falling back to a search above the executable so running from a build directory works even on macOS. | |
| bool | OleMakeBmpFromDib (const std::vector< uint8_t > &aDib, wxMemoryBuffer &aOut) |
| bool | OleRenderWmf (const std::vector< uint8_t > &aWmf, int aMaxWidth, int aMaxHeight, wxImage &aImage, double aTargetAspect=0.0) |
| bool | OleRenderMetafilePreview (const std::vector< uint8_t > &aWmf, int aMaxWidth, int aMaxHeight, wxImage &aImage, double aTargetAspect=0.0, bool *aUsedEmbeddedEmf=nullptr) |
| Render a metafile preview, preferring an EMF the WMF carries over the WMF itself. | |
| bool | OleRenderEmf (const std::vector< uint8_t > &aEmf, int aMaxWidth, int aMaxHeight, wxImage &aImage, double aTargetAspect=0.0) |
| VECTOR2I | OleWmfRenderSize (int aNaturalWidth, int aNaturalHeight, int aMaxWidth, int aMaxHeight, double aTargetAspect) |
|
strong |
| Enumerator | |
|---|---|
| NONE | |
| BMP | |
| DIB | |
| WMF | |
Definition at line 36 of file ole_image.h.
|
inline |
Definition at line 56 of file ole_image.h.
References ExtractOleImage().
| OLE_IMAGE_PAYLOAD ExtractOleImage | ( | const uint8_t * | aCfb, |
| size_t | aSize ) |
Prefer CONTENTS, then OlePres000, then the native stream.
Definition at line 274 of file ole_image.cpp.
Referenced by 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 329 of file ole_image.cpp.
References ExtractOleImage(), and OleEmbeddedCompoundFile().
Referenced by 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 695 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 248 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 475 of file ole_image.cpp.
References image, and OleEmbeddedCompoundFile().
Referenced by 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 382 of file ole_image.cpp.
Referenced by OleRenderMetafilePreview().
| wxString OleLibWmfFontDirectory | ( | ) |
Locate the bundled libwmf fonts directory, falling back to a search above the executable so running from a build directory works even on macOS.
Definition at line 216 of file ole_image.cpp.
References PATHS::GetExecutablePath(), PATHS::GetStockDataPath(), and traceSchPlugin.
Referenced by ORCAD_CONVERTER::applyFont(), and OleRenderWmf().
| bool OleMakeBmpFromDib | ( | const std::vector< uint8_t > & | aDib, |
| wxMemoryBuffer & | aOut ) |
Definition at line 346 of file ole_image.cpp.
Referenced by ORCAD_CONVERTER::placeBitmap().
| bool OleRenderEmf | ( | const std::vector< uint8_t > & | aEmf, |
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| wxImage & | aImage, | ||
| double | aTargetAspect = 0.0 ) |
Definition at line 121 of file ole_emf.cpp.
References fonts, image, KiROUND(), OleWmfRenderSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by OleRenderMetafilePreview().
| bool OleRenderMetafilePreview | ( | const std::vector< uint8_t > & | aWmf, |
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| wxImage & | aImage, | ||
| double | aTargetAspect = 0.0, | ||
| bool * | aUsedEmbeddedEmf = nullptr ) |
Render a metafile preview, preferring an EMF the WMF carries over the WMF itself.
Definition at line 675 of file ole_image.cpp.
References OleExtractEmbeddedEmf(), OleRenderEmf(), and OleRenderWmf().
Referenced by ORCAD_CONVERTER::placeBitmap().
| bool OleRenderWmf | ( | const std::vector< uint8_t > & | aWmf, |
| int | aMaxWidth, | ||
| int | aMaxHeight, | ||
| wxImage & | aImage, | ||
| double | aTargetAspect = 0.0 ) |
Definition at line 582 of file ole_image.cpp.
References normalized(), OleLibWmfFontDirectory(), OleWmfRenderSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by 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 552 of file ole_image.cpp.
References KiROUND(), and scale.
Referenced by BOOST_AUTO_TEST_CASE(), OleRenderEmf(), and OleRenderWmf().