Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

fpoptimizer.cpp File Reference

#include "fpconfig.h"
#include "fparser.h"
#include "fptypes.h"
#include <cmath>
#include <list>
#include <utility>
#include <cassert>

Include dependency graph for fpoptimizer.cpp:

Go to the source code of this file.

Defines

#define M_PI   3.1415926535897932384626433832795
#define CONSTANT_E   2.71828182845904509080
#define CONSTANT_PI   M_PI
#define CONSTANT_L10   2.30258509299404590109
#define CONSTANT_L10I   0.43429448190325176116
#define CONSTANT_L10E   CONSTANT_L10I
#define CONSTANT_L10EI   CONSTANT_L10
#define CONSTANT_DR   (180.0 / M_PI)
#define CONSTANT_RD   (M_PI / 180.0)
#define CHECKCONSTNEG(item, op)
#define ConstantUnaryFun(token, fun)
#define ConstantBinaryFun(token, fun)
#define AddCmd(op)   byteCode.push_back((op))
#define AddConst(v)
#define SubTreeDecl(p1, p2)   SubTree::SubTree p1 : tree(new CodeTree p2), sign(false) { }
#define GROW(n)
#define EAT(n, opcode)
#define ADDCONST(n)

Typedefs

typedef list< SubTree > paramlist

Functions

double Min (double d1, double d2)
double Max (double d1, double d2)
bool IsNegate (const SubTree &p1, const SubTree &p2)
bool IsInverse (const SubTree &p1, const SubTree &p2)
bool IsNegate (const SubTree &p1, const SubTree &p2)
bool IsInverse (const SubTree &p1, const SubTree &p2)
 SubTreeDecl ((const CodeTree &b),(b)) SubTreeDecl((double value)

Variables

const compres maybe = (char)2


Define Documentation

#define AddCmd ( op   )     byteCode.push_back((op))

#define ADDCONST (  ) 

Value:

do { \
        stack[stacktop].SetImmed((n)); \
        GROW(1); \
    } while(0)

Referenced by FunctionParser::MakeTree().

#define AddConst (  ) 

Value:

do { \
        byteCode.push_back(cImmed); \
        immed.push_back((v)); \
    } while(0)

#define CHECKCONSTNEG ( item,
op   ) 

Value:

((op)==cMul) \
       ? (item).CheckConstInv() \
       : (item).CheckConstNeg()

Definition at line 243 of file fpoptimizer.cpp.

#define CONSTANT_DR   (180.0 / M_PI)

Definition at line 47 of file fpoptimizer.cpp.

Referenced by FunctionParser::MakeTree().

#define CONSTANT_E   2.71828182845904509080

Definition at line 41 of file fpoptimizer.cpp.

Referenced by FunctionParser::MakeTree().

#define CONSTANT_L10   2.30258509299404590109

Definition at line 43 of file fpoptimizer.cpp.

#define CONSTANT_L10E   CONSTANT_L10I

Definition at line 45 of file fpoptimizer.cpp.

#define CONSTANT_L10EI   CONSTANT_L10

Definition at line 46 of file fpoptimizer.cpp.

#define CONSTANT_L10I   0.43429448190325176116

Definition at line 44 of file fpoptimizer.cpp.

Referenced by FunctionParser::MakeTree().

#define CONSTANT_PI   M_PI

Definition at line 42 of file fpoptimizer.cpp.

#define CONSTANT_RD   (M_PI / 180.0)

Definition at line 48 of file fpoptimizer.cpp.

Referenced by FunctionParser::MakeTree().

#define ConstantBinaryFun ( token,
fun   ) 

Value:

case token: { const SubTree &p0 = getp0(); \
                              const SubTree &p1 = getp1(); \
                    if(p0->IsImmed() && \
                       p1->IsImmed()) ReplaceWithConst(fun(p0->GetImmed(), p1->GetImmed())); \
                    break; }

#define ConstantUnaryFun ( token,
fun   ) 

Value:

case token: { const SubTree &p0 = getp0(); \
                    if(p0->IsImmed()) ReplaceWithConst(fun(p0->GetImmed())); \
                    break; }

#define EAT ( n,
opcode   ) 

Value:

do { \
        unsigned newstacktop = stacktop-n; \
        if((n) == 0) GROW(1); \
        stack[stacktop].SetOp((opcode)); \
        for(unsigned a=0, b=(n); a<b; ++a) \
            stack[stacktop].AddParam(stack[newstacktop+a]); \
        stack.erase(stack.begin() + newstacktop, \
                    stack.begin() + stacktop); \
        stacktop = newstacktop; GROW(1); \
    } while(0)

Referenced by FunctionParser::MakeTree().

#define GROW (  ) 

Value:

do { \
        stacktop += n; \
        if(stack.size() <= stacktop) stack.resize(stacktop+1); \
    } while(0)

Referenced by FunctionParser::MakeTree().

#define M_PI   3.1415926535897932384626433832795

Definition at line 38 of file fpoptimizer.cpp.

#define SubTreeDecl ( p1,
p2   )     SubTree::SubTree p1 : tree(new CodeTree p2), sign(false) { }

Definition at line 1517 of file fpoptimizer.cpp.


Typedef Documentation

typedef list<SubTree> paramlist [static]

Definition at line 115 of file fpoptimizer.cpp.


Function Documentation

bool @211::IsInverse ( const SubTree &  p1,
const SubTree &  p2 
) [static]

Definition at line 1498 of file fpoptimizer.cpp.

bool @211::IsInverse ( const SubTree &  p1,
const SubTree &  p2 
) [static]

bool @211::IsNegate ( const SubTree &  p1,
const SubTree &  p2 
) [static]

Definition at line 1489 of file fpoptimizer.cpp.

bool @211::IsNegate ( const SubTree &  p1,
const SubTree &  p2 
) [static]

double @211::Max ( double  d1,
double  d2 
) [inline, static]

Definition at line 55 of file fpoptimizer.cpp.

double @211::Min ( double  d1,
double  d2 
) [inline, static]

Definition at line 51 of file fpoptimizer.cpp.

@211::SubTreeDecl ( (const CodeTree &b)  ,
(b)   
) [static]


Variable Documentation

list<pit> cp

CodeTreeDataPtr data

Definition at line 250 of file fpoptimizer.cpp.

Referenced by desaxe::Lookup_body< Data_Type >::begin(), desaxe::Getter_body< Obj_Type, Data_Type >::begin(), RawImage::bits(), StringPushButton::buttonClicked(), DataPushButton::buttonClicked(), UndoTransaction::cancel(), ColorPixmapItem::colorName(), UndoTransaction::commit(), ScribusView::contentsDropEvent(), StencilReader::createObjects(), StencilReader::createShape(), ScImgDataLoader_PS::decodeA85(), ScPainterEx_GDI::drawImage(), PDFLibCore::EncodeArrayToStream(), PDFLibCore::EncStream(), PDFLibCore::EncStreamArray(), PDFLibCore::EncString(), PDFLibCore::EncStringUTF16(), desaxe::SetterWithConversion_body< Obj_Type, Data_Type, Store_Type >::end(), desaxe::Setter_body< Obj_Type, Data_Type >::end(), desaxe::SetterP_body< Obj_Type, Data_Type, Store_Type >::end(), AIPlug::extractFromPDF(), LoadSavePlugin::getDialogFilter(), ScFace::ScFaceData::glyphBBox(), EPSPlug::Image(), EPSPlug::import(), PluginManager::loadDLL(), ScImgDataLoader_PS::loadEmbeddedProfile(), ScImgDataLoader_PS::loadPhotoshopBinary(), ScImgDataLoader_JPEG::loadPicture(), ScImgDataLoader_PS::loadPSjpeg(), AspellPluginImpl::on_flistDicts_activated(), ScListBoxPixmap< pixWidth, pixHeight >::paint(), ScImgDataLoader_PS::parseData(), OODPlug::parseSVG(), SEditor::paste(), Printer_print(), UpgradeChecker::process(), AIPlug::processRaster(), PSLib::PS_image(), PSLib::PS_ImageData(), IconBuffer::readData(), PluginManager::resolveSym(), RawImage::scanLine(), PrintDialog::SelPrinter(), RawImage::setAlpha(), StoryEditor::setCurrentDocumentAndItem(), ScListBoxPixmap< pixWidth, pixHeight >::sizeHint(), and DataPushButton::~DataPushButton().

unsigned funcno

Definition at line 125 of file fpoptimizer.cpp.

Referenced by FunctionParser::MakeTree().

bool inverted

Definition at line 193 of file fpoptimizer.cpp.

const compres maybe = (char)2 [static]

Definition at line 76 of file fpoptimizer.cpp.

bool negated

Definition at line 194 of file fpoptimizer.cpp.

unsigned op

double orig

Definition at line 192 of file fpoptimizer.cpp.

Referenced by Canvas::DrawMasterItems(), and Canvas::DrawPageItems().

pp p

Definition at line 205 of file fpoptimizer.cpp.

Referenced by FPointArray::addQuadPoint(), Canvas::adjustBuffer(), ScImage::applyCurve(), ColorWheel::baseColor(), ScImgDataLoader_PS::blendImages(), PPreview::blendImages(), ScImage::blur(), Imposition::booklet4p(), StoryEditor::changeAlign(), Imposition::changeDocFold(), Imposition::changeDocGrid(), StoryEditor::changeStyle(), CharZoom::CharZoom(), Biblio::copyObj(), PagePalette::CreateIcon(), LineCombo::createIcon(), PicStatus::createImgIcon(), PPreview::CreatePreview(), PicSearch::createPreview(), EffectsDialog::createPreview(), CharTableModel::data(), do_extract_currentfile(), CurveWidget::doInvert(), CurveWidget::doSave(), ColorWheel::drawBorderPoint(), ColorChart::drawPalette(), TabDisplay::drawRuler(), SeView::dropEvent(), export_PageItem(), ExtImageProps::ExtImageProps(), FontSample(), FDialogPreview::GenPreview(), getCurveYValue(), ScPrintEngine_GDI::getDefaultPrinter(), getSmallPixmap(), ContentReader::getStyle(), PageSelector::GotoPage(), FPointArray::hasLastQuadPoint(), CharSelect::hide(), LensItem::hoverEnterEvent(), LensItem::hoverMoveEvent(), HSVTORGB(), ScImage::invert(), ScribusMainWindow::keyPressEvent(), WortEdit::keyPressEvent(), KCurve::keyPressEvent(), UrlLauncher::launchUrlExt(), LensDialog::lensSelected(), BookMItem::level(), ScribusMainWindow::loadDoc(), LoadPDF(), ScImgDataLoader_PS::loadPhotoshop(), ScImgDataLoader_PS::loadPhotoshopBinary(), ScImgDataLoader_PS::loadPicture(), ScImgDataLoader_JPEG::loadPicture(), ScImage::LoadPicture(), ScImgDataLoader_PS::loadPSjpeg(), makedir(), FPointArray::map(), SeView::mouseMoveEvent(), KCurve::mouseMoveEvent(), CanvasMode_NodeEdit::mouseMoveEvent(), LegacyMode::mouseMoveEvent(), FreehandMode::mouseMoveEvent(), BezierMode::mouseMoveEvent(), CreateMode::mouseMoveEvent(), KCurve::mousePressEvent(), CanvasMode_NodeEdit::mousePressEvent(), LegacyMode::mousePressEvent(), FreehandMode::mousePressEvent(), BezierMode::mousePressEvent(), CreateMode::mousePressEvent(), SideBar::mouseReleaseEvent(), LegacyMode::mouseReleaseEvent(), FreehandMode::mouseReleaseEvent(), SMParagraphStyle::nameChanged(), SMParagraphStyle::newStyle(), Biblio::ObjFromCopyAction(), Biblio::ObjFromMenu(), PagePalette::pageView_gotoPage(), paintAlert(), ColorWheel::paintCenterSample(), Vruler::paintEvent(), RulerT::paintEvent(), SideBar::paintEvent(), Navigator::paintEvent(), Hruler::paintEvent(), GradientPreview::paintEvent(), DashPreview::paintEvent(), KCurve::paintEvent(), ColorChart::paintEvent(), CharZoom::paintEvent(), ColorWheel::paintWheel(), FPointArray::point(), FPointArray::pointQ(), FPointArray::pointQF(), AIPlug::processPattern(), AIPlug::processRaster(), FPointArray::putPoints(), BibView::ReadContents(), LineFormatItemDelegate::redraw(), ColorWheel::sampleByAngle(), FPointArray::scale(), ScPaths::ScPaths(), scribus_importpage(), scribus_newdoc(), scribus_newdocument(), scribus_newstyledialog(), EffectsDialog::selectEffectHelper(), LegacyMode::SeleItem(), FPointArray::setPoint(), CWDialog::setPreview(), nftdialog::setTNails(), CharSelect::show(), StyleManager::showEvent(), ScribusDoc::SizeItem(), CMYKChoose::SliderBlack(), CMYKChoose::SliderPix(), SearchReplace::slotDoSearch(), ScribusView::slotSetCurs(), ContentReader::startElement(), ScImgDataLoader::swapRGBA(), ScImage::swapRGBA(), FPoint::transformPoint(), FPointArray::translate(), UndoPalette::UndoItem::UndoItem(), ReformDoc::updateDocumentSettings(), PathFinderDialog::updatePartPreview(), PatternDialog::updatePatternList(), Cpalette::updatePatternList(), SMLineStyle::updatePreview(), PolygonWidget::UpdatePreView(), PathFinderDialog::updatePreview(), StoryEditor::updateStatus(), GlyphLayout::wide(), ScFlateEncodeFilter::writeData(), and Scribus134Format::writePrintOptions().

bool sign

char state

CodeTree* tree

Definition at line 82 of file fpoptimizer.cpp.

Referenced by FunctionParser::Optimize().

double value

Definition at line 123 of file fpoptimizer.cpp.

Referenced by LatexEditor::apply(), ScriXmlDoc::attrAsBool(), ScriXmlDoc::attrAsDbl(), ScriXmlDoc::attrAsInt(), ScASCII85EncodeFilter::closeFilter(), consoleOptionEnabled(), QString_from_python_str_or_unicode::construct(), LatexEditor::createNewItemsTab(), export_PageItem(), SMTabruler::firstDataChanged(), SMTabruler::firstValueChanged(), StyleStack::fontSize(), GuideManager::getAutoHorizontals(), GuideManager::getAutoVerticals(), ScImage::getOptimalKernelWidth(), getRotationFromMatrix(), ScColorShade::getShadedColor(), ScrSpinBox::getValue(), ScrSpinBox::getValues(), MSpinBox::getValues(), ImageExport_saveAs(), initscribus(), SMTabruler::leftDataChanged(), SMTabruler::leftValueChanged(), ScImage::LoadPicture(), AspellPluginImpl::on_flistDicts_activated(), StyleFlag::operator StyleFlagValue(), StyleFlag::operator=(), SVGPlug::parseFontSize(), LatexConfigParser::parseTab(), SVGPlug::parseUnit(), StencilReader::parseUnit(), OODPlug::parseUnit(), Scribus134Format::PasteItem(), PDFLibCore::PDF_Begin_Doc(), ScText_Shared::replaceCharStyleContextInParagraph(), SMTabruler::rightDataChanged(), SMTabruler::rightValueChanged(), scribus_valdialog(), GuidesDelegate::setEditorData(), Tabruler::setFirstLine(), Tabruler::setFirstLineData(), MSpinBox::setFPConstants(), Tabruler::setLeftIndent(), Tabruler::setLeftIndentData(), GuidesDelegate::setModelData(), ScrSpinBox::setNewUnit(), Tabruler::setRightIndent(), Tabruler::setRightIndentData(), SMCharacterStyle::slotBaselineOffset(), SMParagraphStyle::slotBaselineOffset(), SMParagraphStyle::slotDropCapOffset(), SMParagraphStyle::slotFirstLine(), SMCharacterStyle::slotFontSize(), SMParagraphStyle::slotFontSize(), SMParagraphStyle::slotLeftIndent(), SMParagraphStyle::slotLineSpacing(), SMParagraphStyle::slotRightIndent(), SMCharacterStyle::slotScaleH(), SMParagraphStyle::slotScaleH(), SMCharacterStyle::slotScaleV(), SMParagraphStyle::slotScaleV(), SMParagraphStyle::slotSpaceAbove(), SMParagraphStyle::slotSpaceBelow(), SMCharacterStyle::slotTracking(), SMParagraphStyle::slotTracking(), PrefsReader::startElement(), MSpinBox::stepDown(), StyleFlag::StyleFlag(), MovePages::toChanged(), DelPages::toChanged(), XmlDoubleSpinBox::toString(), XmlSpinBox::toString(), ScPageOutput::translateImageModeToRequest(), LatexEditor::updateConfigFile(), MSpinBox::value(), ScrSpinBox::valueFromText(), ScPainterEx_Ps2::writeCMYKImageToStream_Ascii85(), ScASCII85EncodeFilter::writeData(), ScPainterEx_Ps2::writeRGBImageToStream_Ascii85(), XmlComboBox::XmlComboBox(), and ActionManager::~ActionManager().

unsigned var

Definition at line 124 of file fpoptimizer.cpp.

double voidvalue

Definition at line 301 of file fpoptimizer.cpp.

Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.