Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
hdi::core::annotate Namespace Reference

Organizes all annotation drawing functions into one namespace, each of which will only perform their drawing task(s) if called from within an Annotator callback. More...

Classes

struct  TextConfig
 

Typedefs

typedef std::vector< PointPointVector
 
typedef std::vector< SegPointSegPointVector
 

Enumerations

enum  FontType {
  DefaultFont , DialogFont , BoldDialogFont , ItalicDialogFont ,
  BoldItalicDialogFont , PanelFont , BoldPanelFont , ItalicPanelFont ,
  BoldItalicPanelFont
}
 Describes the type of font to use when annotating text; see also setFontType()
 

Functions

bool line (const Point &start_, const Point &end_)
 Draws a line with the given end points.
 
bool dashedLine (const Point &start_, const Point &end_, const double dash_, const double gap_)
 Draws a dashed line with the given end points and dash specs.
 
bool rect (const Rect &rect_, const bool fill_=false)
 Draws a rectangle with the given coordinates and fill.
 
bool ellipse (const Rect &bounds_, const bool fill_=false)
 Draws an ellipse within the given rectangular bounds.
 
bool polygon (const PointVector &points_, const bool fill_=false)
 Draws a polygon constructed of the given points.
 
bool bezier (const SegPointVector &segPts_, const bool fill_=false)
 Draws a bezier from the given segment points.
 
bool image (const int16_t imgID_, const Point &pt_)
 Draws an image at the given point.
 
bool image (const byte *const png_, const uint32_t pngSize_, const Point &pt_)
 Draws an image from its raw PNG data at the given point, scaled to the document DPI.
 
bool imageUnscaled (const byte *const png_, const uint32_t pngSize_, const Point &pt_)
 Draws an image from its raw PNG data at the given point, unscaled.
 
bool text (const std::string &text_, const Point &pt_, const TextConfig &config_=TextConfig())
 Draws text with the current font and left justification.
 
Color color ()
 Gets the current annotation color.
 
void setColor (const Color &color_)
 Sets the current annotation color.
 
double lineWidth ()
 Gets the line width used when drawing paths or unfilled objects.
 
void setLineWidth (const double width_)
 Sets the line width used when drawing paths or unfilled objects.
 
void setFont (const Font &font_)
 Sets the current font for annotation text art.
 
void setFontSize (const double size_)
 Sets the current font size for annotation text art.
 
std::unique_ptr< Fontfont ()
 Gets the current font for annotation text art.
 
double fontSize ()
 Gets the current font size for annotation text art.
 
void setFontType (const FontType font_)
 Sets the current font for annotation text art.
 
Size textSize (const std::string &text_, const TextConfig &config_=TextConfig())
 Gets the bounds for the given text at the origin.
 
void invalidateAll ()
 Loops through all views of the current document and invalidates their annotations.
 

Detailed Description

Organizes all annotation drawing functions into one namespace, each of which will only perform their drawing task(s) if called from within an Annotator callback.

Function Documentation

◆ bezier()

bool hdi::core::annotate::bezier ( const SegPointVector &  segPts_,
const bool  fill_ = false 
)

Draws a bezier from the given segment points.

Author
GW
Date
07/2014
Parameters
segPts_Segment points of the bezier path
fill_Whether to fill it with the current color
Returns
true if the bezier was drawn, false otherwise

◆ color()

Color hdi::core::annotate::color ( )

Gets the current annotation color.

Author
GW
Date
08/2013
Returns
Color for the current annotation context

◆ dashedLine()

bool hdi::core::annotate::dashedLine ( const Point start_,
const Point end_,
const double  dash_,
const double  gap_ 
)

Draws a dashed line with the given end points and dash specs.

Author
GW
Date
03/2017
Parameters
start_Start point for the line
end_End point for the line
dash_Length of the dash components
gap_Length of the gap components (empty space between dashes)
Returns
true if the dashed line was drawn, false otherwise

◆ ellipse()

bool hdi::core::annotate::ellipse ( const Rect bounds_,
const bool  fill_ = false 
)

Draws an ellipse within the given rectangular bounds.

Author
GW
Date
08/2013
Parameters
bounds_Rectangle in which the ellipse fits
fill_Whether to fill it with the current color
Returns
true if the line was drawn, false otherwise

◆ font()

std::unique_ptr< Font > hdi::core::annotate::font ( )

Gets the current font for annotation text art.

Author
GW
Date
08/2013
Returns
Font for the current annotation context

◆ fontSize()

double hdi::core::annotate::fontSize ( )

Gets the current font size for annotation text art.

Author
GW
Date
02/2014
Returns
The font size for the current annotation context

◆ image() [1/2]

bool hdi::core::annotate::image ( const byte *const  png_,
const uint32_t  pngSize_,
const Point pt_ 
)

Draws an image from its raw PNG data at the given point, scaled to the document DPI.

Author
GW
Date
12/2020
Parameters
png_Raw bytes of PNG data to be drawn
pngSize_Length of the buffer passed in png_ argument
pt_Point at which to draw the image
Returns
true if the image was drawn, false otherwise

◆ image() [2/2]

bool hdi::core::annotate::image ( const int16_t  imgID_,
const Point pt_ 
)

Draws an image at the given point.

Author
GW
Date
08/2013
Parameters
imgID_Resource ID of the image to draw
pt_Point at which to draw the image
Returns
true if the image was drawn, false otherwise
Note
At the moment, only PNGI resources are supported

◆ imageUnscaled()

bool hdi::core::annotate::imageUnscaled ( const byte *const  png_,
const uint32_t  pngSize_,
const Point pt_ 
)

Draws an image from its raw PNG data at the given point, unscaled.

Author
GW
Date
12/2020
Parameters
png_Raw bytes of PNG data to be drawn
pngSize_Length of the buffer passed in png_ argument
pt_Point at which to draw the image
Returns
true if the image was drawn, false otherwise

◆ invalidateAll()

void hdi::core::annotate::invalidateAll ( )

Loops through all views of the current document and invalidates their annotations.

Author
GW
Date
08/2013

◆ line()

bool hdi::core::annotate::line ( const Point start_,
const Point end_ 
)

Draws a line with the given end points.

Author
GW
Date
08/2013
Parameters
start_Start point for the line
end_End point for the line
Returns
true if the line was drawn, false otherwise

◆ lineWidth()

double hdi::core::annotate::lineWidth ( )

Gets the line width used when drawing paths or unfilled objects.

Author
GW
Date
07/2014
Returns
The line width in document view points

◆ polygon()

bool hdi::core::annotate::polygon ( const PointVector &  points_,
const bool  fill_ = false 
)

Draws a polygon constructed of the given points.

Author
GW
Date
08/2013
Parameters
points_Vertex points of the polygon
fill_Whether to fill it with the current color
Returns
true if the polygon was drawn, false otherwise

◆ rect()

bool hdi::core::annotate::rect ( const Rect rect_,
const bool  fill_ = false 
)

Draws a rectangle with the given coordinates and fill.

Author
GW
Date
08/2013
Parameters
rect_Rectangle to draw
fill_Whether to fill it with the current color
Returns
true if the rectangle was drawn, false otherwise

◆ setColor()

void hdi::core::annotate::setColor ( const Color color_)

Sets the current annotation color.

Author
GW
Date
08/2013
Parameters
color_New color for annotation art

◆ setFont()

void hdi::core::annotate::setFont ( const Font font_)

Sets the current font for annotation text art.

Author
GW
Date
08/2013
Parameters
font_New font for annotating

◆ setFontSize()

void hdi::core::annotate::setFontSize ( const double  size_)

Sets the current font size for annotation text art.

Author
GW
Date
02/2014
Parameters
size_New font size for the current annotation context

◆ setFontType()

void hdi::core::annotate::setFontType ( const FontType  font_)

Sets the current font for annotation text art.

Author
GW
Date
08/2013
Parameters
font_New font for annotating

◆ setLineWidth()

void hdi::core::annotate::setLineWidth ( const double  width_)

Sets the line width used when drawing paths or unfilled objects.

Author
GW
Date
07/2014
Parameters
width_The line width in document view points

◆ text()

bool hdi::core::annotate::text ( const std::string &  text_,
const Point pt_,
const TextConfig config_ = TextConfig() 
)

Draws text with the current font and left justification.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text to draw
pt_Top-left point at which to draw the text (before any of config_ arg is applied)
config_The configuration for other/advanced drawing options; pass in a default- constructed object to draw without any options applied
Returns
true if the text was drawn, false otherwise

◆ textSize()

Size hdi::core::annotate::textSize ( const std::string &  text_,
const TextConfig config_ = TextConfig() 
)

Gets the bounds for the given text at the origin.

Author
GW
Date
08/2013
Parameters
text_UTF-8 text for which bounds are needed
config_The configuration for other/advanced drawing options; pass in a default-constructed object to calculate without any options applied