namespace UglyToad.PdfPig.Graphics
{
using PdfPig.Core;
using System.Collections.Generic;
using Tokens;
using Util.JetBrains.Annotations;
///
/// The current graphics state context when running a PDF content stream.
///
public interface IOperationContext
{
///
/// The current path being drawn if applicable.
///
[CanBeNull]
PdfPath CurrentPath { get; }
///
/// The active colorspaces for this content stream.
///
IColorSpaceContext ColorSpaceContext { get; }
///
/// The current position.
///
PdfPoint CurrentPosition { get; set; }
///
/// Get the currently active . States are stored on a stack structure.
///
/// The currently active graphics state.
CurrentGraphicsState GetCurrentState();
///
/// The matrices for the current text state.
///
TextMatrices TextMatrices { get; }
///
/// The current transformation matrix
///
TransformationMatrix CurrentTransformationMatrix { get; }
///
/// The number of graphics states on the stack.
///
int StackSize { get; }
///
/// Sets the current graphics state to the state from the top of the stack.
///
void PopState();
///
/// Saves a copy of the current graphics state on the stack.
///
void PushState();
///
/// Shows the text represented by the provided bytes using the current graphics state.
///
/// The bytes of the text.
void ShowText(IInputBytes bytes);
///
/// Interprets the tokens to draw text at positions.
///
/// The tokens to show.
void ShowPositionedText(IReadOnlyList tokens);
///
/// Retrieves the named XObject and applies it to the current state.
///
/// The name of the XObject.
void ApplyXObject(NameToken xObjectName);
///
/// Start a new sub-path.
///
void BeginSubpath();
///
/// Stroke the current path.
///
/// Whether to also close the path.
void StrokePath(bool close);
///
/// Fill the current path.
///
/// Whether to also close the path.
void FillPath(bool close);
///
/// Close the current path.
///
void ClosePath();
///
/// Indicate that a marked content region is started.
///
void BeginMarkedContent(NameToken name, NameToken propertyDictionaryName, DictionaryToken properties);
///
/// Indicates that the current marked content region is complete.
///
void EndMarkedContent();
///
/// Update the graphics state to apply the state from the named ExtGState dictionary.
///
/// The name of the state to apply.
void SetNamedGraphicsState(NameToken stateName);
///
/// Indicate that an inline image is being defined.
///
void BeginInlineImage();
///
/// Define the properties of the inline image currently being drawn.
///
void SetInlineImageProperties(IReadOnlyDictionary properties);
///
/// Indicates that the current inline image is complete.
///
void EndInlineImage(IReadOnlyList bytes);
}
}