struct CCL::Internal::IGraphicsHelper

Overview

Helper methods for public graphics class implementation. More…

#include <igraphicshelper.h>

struct IGraphicsHelper: public CCL::IUnknown
{
    // enums

    enum ColorFormatFlags;

    // methods

    virtual tbool CCL_API Color_fromCString (Color& This, CStringPtr cString) = 0;

    virtual tbool CCL_API Color_toCString (
        const Color& This,
        char* cString,
        int cStringSize,
        int flags
    ) = 0;

    virtual const Font&CCL_API Font_getDefaultFont () = 0;

    virtual void CCL_API Font_measureString (
        Rect& size,
        StringRef text,
        const Font& font,
        int flags
    ) = 0;

    virtual void CCL_API Font_measureString (
        RectF& size,
        StringRef text,
        const Font& font,
        int flags
    ) = 0;

    virtual void CCL_API Font_measureStringImage (
        RectF& size,
        StringRef text,
        const Font& font,
        tbool shiftToBaseline
    ) = 0;

    virtual void CCL_API Font_measureText (
        Rect& size,
        Coord lineWidth,
        StringRef text,
        const Font& font,
        TextFormatRef format
    ) = 0;

    virtual void CCL_API Font_measureText (
        RectF& size,
        CoordF lineWidth,
        StringRef text,
        const Font& font,
        TextFormatRef format
    ) = 0;

    virtual void CCL_API Font_collapseString (
        String& string,
        CoordF maxWidth,
        const Font& font,
        int trimMode,
        tbool exact = false
    ) = 0;

    virtual IFontTable*CCL_API Font_collectFonts (int flags) = 0;
    virtual int CCL_API Factory_getNumImageFormats () = 0;
    virtual const FileType*CCL_API Factory_getImageFormat (int index) = 0;
    virtual IImage*CCL_API Factory_loadImageFile (UrlRef path) = 0;

    virtual tbool CCL_API Factory_saveImageFile (
        UrlRef path,
        IImage* image,
        const IAttributeList* encoderOptions = nullptr
    ) = 0;

    virtual IImage*CCL_API Factory_loadImageStream (
        IStream& stream,
        const FileType& format
    ) = 0;

    virtual tbool CCL_API Factory_saveImageStream (
        IStream& stream,
        IImage* image,
        const FileType& format,
        const IAttributeList* encoderOptions = nullptr
    ) = 0;

    virtual IImage*CCL_API Factory_createBitmap (
        int width,
        int height,
        IBitmap::PixelFormat format = IBitmap::kRGB,
        float scaleFactor = 1.f
    ) = 0;

    virtual IGraphics*CCL_API Factory_createBitmapGraphics (IImage* bitmap) = 0;
    virtual IBitmapFilter*CCL_API Factory_createBitmapFilter (StringID which) = 0;
    virtual IGraphicsPath*CCL_API Factory_createPath (IGraphicsPath::TypeHint type) = 0;
    virtual IGradient*CCL_API Factory_createGradient (IGradient::TypeHint type) = 0;
    virtual IImage*CCL_API Factory_createShapeImage () = 0;
    virtual IGraphics*CCL_API Factory_createShapeBuilder (IImage* shapeImage) = 0;
    virtual ITextLayout*CCL_API Factory_createTextLayout () = 0;
    virtual IGraphicsLayer*CCL_API Factory_createGraphicsLayer (UIDRef cid) = 0;
    virtual IUIValue*CCL_API Factory_createValue () = 0;

    virtual IImage*CCL_API Factory_createFilmstrip (
        IImage* sourceImage,
        StringID frames
    ) = 0;

    virtual IImage*CCL_API Factory_createImagePart (
        IImage* sourceImage,
        RectRef partRect
    ) = 0;

    virtual IImage*CCL_API Factory_createMultiImage (
        IImage* images [],
        CString frameNames [],
        int count
    ) = 0;

    virtual IImage*CCL_API Factory_createMultiResolutionBitmap (
        IImage* bitmaps [],
        float scaleFactors [],
        int count
    ) = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

Helper methods for public graphics class implementation.

Do not use this interface directly.