libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
Art::Paperback::Graphics::Canvas Class Reference

Represents the drawable canvas of a page. More...

#include <art/paperback/graphics/canvas.hxx>

Classes

class  Begin_text
 
struct  Clear
 
struct  Internal
 Holds internal canvas data. More...
 
class  Path
 Path construction class. More...
 
class  Save
 Saves graphics state. More...
 
class  Set_font
 

Public Member Functions

 Canvas (Clear const &, Page &)
 Constructor.
 
 ~Canvas ()
 Destructor.
 
Pagepage ()
 Access the parent page.
 
Page const & page () const
 Access the parent page.
 
Carousel::Streamcontent ()
 Access the content stream.
 
Carousel::Stream const & content () const
 Access the content stream.
 
void set_stroke (double)
 Set stroke greyscale value.
 
void set_fill (double)
 Set fill greyscale value.
 
void set_stroke (Color_RGB const &)
 Set stroke RGB color.
 
void set_fill (Color_RGB const &)
 Set fill RGB color.
 
double get_text_width (string const &) const
 Compute text width.
 

Public Attributes

friend Save
 
friend Path
 
friend Begin_text
 
friend Set_font
 

Static Public Attributes

static constexpr Clear const clear {}
 Dispatch-tag used to clear a canvas.
 

Private Member Functions

 Canvas (Canvas const &)=delete
 
 Canvas (Canvas &&)=delete
 
Canvasoperator= (Canvas const &)=delete
 
Canvasoperator= (Canvas &&)=delete
 

Private Attributes

unique_ptr< Internalinternal
 

Detailed Description

Represents the drawable canvas of a page.

Constructor & Destructor Documentation

◆ Canvas()

Art::Paperback::Graphics::Canvas::Canvas ( Clear const & ,
Page & page )

Constructor.

Parameters
pageThe parent page of this canvas.

◆ ~Canvas()

Art::Paperback::Graphics::Canvas::~Canvas ( )

Destructor.

Member Function Documentation

◆ page() [1/2]

Page & Art::Paperback::Graphics::Canvas::page ( )

Access the parent page.

◆ page() [2/2]

Page const & Art::Paperback::Graphics::Canvas::page ( ) const

Access the parent page.

◆ content() [1/2]

Carousel::Stream & Art::Paperback::Graphics::Canvas::content ( )

Access the content stream.

◆ content() [2/2]

Carousel::Stream const & Art::Paperback::Graphics::Canvas::content ( ) const

Access the content stream.

◆ set_stroke() [1/2]

void Art::Paperback::Graphics::Canvas::set_stroke ( double grey_level)

Set stroke greyscale value.

Parameters
grey_levelThe new grey level.

◆ set_fill() [1/2]

void Art::Paperback::Graphics::Canvas::set_fill ( double grey_level)

Set fill greyscale value.

Parameters
grey_levelThe new grey level.

◆ set_stroke() [2/2]

void Art::Paperback::Graphics::Canvas::set_stroke ( Color_RGB const & color)

Set stroke RGB color.

Parameters
colorThe new RGB color.

◆ set_fill() [2/2]

void Art::Paperback::Graphics::Canvas::set_fill ( Color_RGB const & color)

Set fill RGB color.

Parameters
colorThe new RGB color.

◆ get_text_width()

double Art::Paperback::Graphics::Canvas::get_text_width ( string const & text) const

Compute text width.

Parameters
textThe text for which to compute the width.

Member Data Documentation

◆ clear

Clear const Art::Paperback::Graphics::Canvas::clear {}
staticconstexpr

Dispatch-tag used to clear a canvas.