Renders portions of the work sheet (including 2D maths) as bitmap.
More...
#include <BitmapOut.h>
|
| | BitmapOut (const Configuration *const *configuration, double scale=1) |
| | The constructor.
|
| |
|
| BitmapOut (const Configuration *const *configuration, std::unique_ptr< Cell > &&tree, double scale=1, long maxSize=-1) |
| | Constructs and renders the bitmap, setting the IsOK() status accordingly.
|
| |
| bool | Render (std::unique_ptr< Cell > &&tree, long int maxSize=-1) |
| | Renders tree as bitmap.
|
| |
|
bool | IsOk () const |
| | Returns whether the tree rendering succeeded.
|
| |
| wxSize | ToFile (const wxString &file) |
| | Exports this bitmap to a file.
|
| |
|
wxBitmap | GetBitmap () const |
| | Returns the bitmap representation of the list of cells that was passed to SetData()
|
| |
|
std::unique_ptr< wxBitmapDataObject > | GetDataObject () const |
| |
|
bool | ToClipboard () const |
| | Copies the bitmap representation of the list of cells that was passed to SetData()
|
| |
|
| static wxBitmap | RenderForClipboard (const Configuration *const *configuration, const std::function< std::unique_ptr< Cell >()> &cells, double scale) |
| | Draws cells as a bitmap for the clipboard.
|
| |
|
| static constexpr long | CLIPBOARD_MAX_PIXELS = 32000000 |
| | The largest bitmap, in pixels, that is put on the clipboard.
|
| |
Renders portions of the work sheet (including 2D maths) as bitmap.
This is used for exporting HTML with embedded maths as bitmap and for putting bitmaps for the clipboard
◆ BitmapOut()
| BitmapOut::BitmapOut |
( |
const Configuration *const * |
configuration, |
|
|
double |
scale = 1 |
|
) |
| |
|
explicit |
The constructor.
- Parameters
-
| scale | By which factor the resolution should be increased in respect to the default 755 DPI? |
| configuration | A pointer to the pointer to this worksheet's configuration storage |
◆ Render()
| bool BitmapOut::Render |
( |
std::unique_ptr< Cell > && |
tree, |
|
|
long int |
maxSize = -1 |
|
) |
| |
Renders tree as bitmap.
- Parameters
-
| tree | The list of cells that is to be rendered |
| maxSize | maxSize tells the maximum size [in square pixels] that will be rendered. -1 means: No limit. |
- Returns
- true, if the bitmap could be created.
◆ RenderForClipboard()
| wxBitmap BitmapOut::RenderForClipboard |
( |
const Configuration *const * |
configuration, |
|
|
const std::function< std::unique_ptr< Cell >()> & |
cells, |
|
|
double |
scale |
|
) |
| |
|
static |
Draws cells as a bitmap for the clipboard.
Draws at the given scale if the bitmap stays below CLIPBOARD_MAX_PIXELS, else at scale 1 if that is small enough, and else not at all.
- Parameters
-
| configuration | A pointer to the pointer to the configuration to draw with |
| cells | Makes a fresh copy of the cells each time it is called: a BitmapOut consumes the cells it draws, and the second try needs them again. |
| scale | The scale to try first |
- Returns
- The bitmap, or an invalid bitmap if it would have been too large.
◆ ToFile()
| wxSize BitmapOut::ToFile |
( |
const wxString & |
file | ) |
|
Exports this bitmap to a file.
- Returns
- The size of the bitmap in millimeters. Sizes <0 indicate that the export has failed.
◆ CLIPBOARD_MAX_PIXELS
| constexpr long BitmapOut::CLIPBOARD_MAX_PIXELS = 32000000 |
|
staticconstexpr |
The largest bitmap, in pixels, that is put on the clipboard.
Without a limit, copying a large matrix as a whole (a selected block only contains the selected entries) asked for a bitmap of several gigabytes: copying a 300x300 matrix grew wxMaxima to 8 GB and kept it busy for minutes. wxQt draws every clipboard format when Ctrl+C is pressed, so there nothing reached the clipboard until that was over. 32 million pixels are 128 MB, more than any program pasting a picture wants.
The documentation for this class was generated from the following files: