PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
graphics.h
Go to the documentation of this file.
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_GRAPHICS_H_INCLUDED_
4#define PDFSDK_GRAPHICS_H_INCLUDED_
5
10
11#include <pdfsdk/core/api_macro.h>
12#include <pdfsdk/core/streams.h>
13#include <pdfsdk/errors.h>
14#include <pdfsdk/math_types.h>
15#include <stddef.h>
16#include <stdint.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22typedef void* GXObject;
23typedef struct GXBitmapRec_* GXBitmap;
24typedef struct GXBrushRec_* GXBrush;
25typedef struct GXFontFaceRec_* GXFontFace;
26typedef struct GXGeometryRec_* GXGeometry;
27typedef struct GXGradientRec_* GXGradient;
28typedef struct GXPaletteRec_* GXPalette;
29typedef struct GXRegionRec_* GXRegion;
30typedef struct GXRenderTargetRec_* GXRenderTarget;
31typedef struct GXHwContextRec_* GXHwContext;
32typedef struct GXSysFontRec_* GXSysFont;
33
44
45typedef uint32_t GXColorValue;
46
47#define GXColorValueFromARGBBytes(a, r, g, b) \
48 (static_cast<GXColorValue>( \
49 ((static_cast<uint32_t>(a) & 0xFF) << 24) | \
50 ((static_cast<uint32_t>(r) & 0xFF) << 16) | \
51 ((static_cast<uint32_t>(g) & 0xFF) << 8) | \
52 ((static_cast<uint32_t>(b) & 0xFF) << 0)))
53
54#define GXColorValueFromARGB(a, r, g, b) \
55 (GXColorValueFromARGBBytes( \
56 static_cast<uint8_t>(a * 255.f), \
57 static_cast<uint8_t>(r * 255.f), \
58 static_cast<uint8_t>(g * 255.f), \
59 static_cast<uint8_t>(b * 255.f)))
60
61#define GXColorValueGetByteA(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 24) & 0xFF))
62#define GXColorValueGetByteR(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 16) & 0xFF))
63#define GXColorValueGetByteG(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 8) & 0xFF))
64#define GXColorValueGetByteB(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 0) & 0xFF))
65
66#define GXColorValueGetA(argb) (GXColorValueGetByteA(argb) / 255.f)
67#define GXColorValueGetR(argb) (GXColorValueGetByteR(argb) / 255.f)
68#define GXColorValueGetG(argb) (GXColorValueGetByteG(argb) / 255.f)
69#define GXColorValueGetB(argb) (GXColorValueGetByteB(argb) / 255.f)
70
93
104
105typedef struct {
106 void* pixels;
107 unsigned int rowLength;
108 int stride;
110
121
138
175
196
209
210typedef struct {
211 PDRectF bound;
212 float opacity;
213 bool isolated;
214 bool knockout;
216
232
244
250enum { kGXDashPatternMaxSize = 15 };
251
252typedef struct {
253 float phase;
254 float pattern[kGXDashPatternMaxSize];
255 size_t patternLen;
257
258typedef struct {
259 GXLineJoin lineJoin;
260 GXLineCap lineCap;
261 float miterLimit;
262 GXDashPattern dashes;
264
265typedef struct {
266 PDSizeI size;
267 GXPixelFormat format;
268 float dpiX;
269 float dpiY;
271
273 float position;
274 GXColorValue argb;
275};
276
277typedef struct {
278 const GXGradientStop* stops;
279 size_t numStops;
280 PDPointF startPoint;
281 PDPointF endPoint;
282 bool extendStart;
283 bool extendEnd;
284 GXColorValue bgColor;
286
287typedef struct {
288 const GXGradientStop* stops;
289 size_t numStops;
290 PDPointF startPoint;
291 float startRadius;
292 PDPointF endPoint;
293 float endRadius;
294 bool extendStart;
295 bool extendEnd;
296 GXColorValue bgColor;
298
299typedef struct {
300 PDPointF position;
301 GXColorValue color;
303
316
317typedef struct {
318 GXInterpolationMode interpolationMode;
319 GXExtendMode extendModeX;
320 GXExtendMode extendModeY;
322
334
335typedef struct {
336 PDRectI bbox;
337 int16_t unitsPerEm;
338 int16_t ascent;
339 int16_t descent;
340 int16_t stemV;
341 int16_t stemH;
342 int16_t capHeight;
343 int16_t xHeight;
344 int16_t lineGap;
345 int16_t italicAngle;
346 int16_t underlinePosition;
347 int16_t underlineThickness;
348 int16_t strikethroughPosition;
349 int16_t strikethroughThickness;
350 PDPointI superscriptPosition;
351 PDSizeI superscriptSize;
352 PDPointI subscriptPosition;
353 PDSizeI subscriptSize;
355
356typedef enum {
357 kGXFontFlagFixedPitch = 0x01,
358 kGXFontFlagSerif = 0x02,
359 kGXFontFlagScript = 0x04,
360} GXFontFlagsBits;
361
362typedef uint32_t GXFontFlags;
363
364typedef uint32_t GXUnicodeChar;
365
366typedef struct {
367 GXUnicodeChar first;
368 GXUnicodeChar last;
370
371typedef struct {
372 uint32_t tag;
373 float value;
375
376typedef struct {
377 uint32_t tag;
378 float minValue;
379 float defaultValue;
380 float maxValue;
382
383typedef enum {
384 kGXSysFontQueryMatchFamily = 0x01,
385 kGXSysFontQueryMatchWeight = 0x02,
386 kGXSysFontQueryMatchCharset = 0x04,
387 kGXSysFontQueryMatchPitch = 0x08,
388 kGXSysFontQueryMatchSerifs = 0x10,
389 kGXSysFontQueryMatchScript = 0x20,
390 kGXSysFontQueryMatchItalic = 0x40,
391} GXSysFontQueryMatchFlagsBits;
392
393typedef unsigned int GXSysFontQueryMatchFlags;
394
395typedef struct {
396 GXSysFontQueryMatchFlags matchFlags;
397 const wchar_t* family;
398 GXFontStyle style;
399 GXUnicodeChar unicode;
400 bool fixedPitch;
401 bool serif;
402 bool script;
404
405typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontEnumProc)(void* userdata, GXSysFont sysfont);
406
407typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontCustomEnumProc)(void* userdata, void* fontData);
408
409typedef struct {
410 PDErrCode(PDFSDK_CALLCONV* enumFonts)(void* handlerData, GXSysFontCustomEnumProc proc, void* userdata);
411 PDErrCode(PDFSDK_CALLCONV* getFamilyName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
412 PDErrCode(PDFSDK_CALLCONV* getPostScriptName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
413 PDErrCode(PDFSDK_CALLCONV* getFontName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
414 PDErrCode(PDFSDK_CALLCONV* getStyle)(void* fontData, GXFontStyle* pStyle);
415 PDErrCode(PDFSDK_CALLCONV* getFontFlags)(void* fontData, GXFontFlags* pFlags);
416 PDErrCode(PDFSDK_CALLCONV* getUnicodeRanges)(void* fontData, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
417 PDErrCode(PDFSDK_CALLCONV* loadFontFace)(void* fontData, GXFontFace* pFontFace);
418 void(PDFSDK_CALLCONV* freeFontData)(void* fontData);
419 void(PDFSDK_CALLCONV* freeHandlerData)(void* handlerData);
421
422typedef uint32_t GXSysFontsHandlerID;
423
424typedef PDErrCode(PDFSDK_CALLCONV* GXRegionRectEnumProc)(void* userdata, const PDRectI* rect);
425
426typedef unsigned int GXCacheEntryID;
427
431PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnableHWAccelerationForThread();
432
433PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectAcquire(GXObject object);
434PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectRelease(GXObject object);
435
439PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreatePalette(const GXColorValue* colors,
440 size_t num_colors,
441 GXPalette* ppalette);
442PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetNumColors(GXPalette palette, size_t* pnum_colors);
443PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColor(GXPalette palette,
444 size_t index,
445 GXColorValue* pcolor);
446PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColors(GXPalette palette,
447 const GXColorValue** pcolors);
448
452PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmap(const GXBitmapAttrs* attrs, GXBitmap* pbitmap);
453
454PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFile(const wchar_t* filename, GXBitmap* pbitmap);
455PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFileFrame(const wchar_t* filename,
456 uint32_t frame_index,
457 uint32_t* ptotal_frames,
458 GXBitmap* pbitmap);
459PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemory(const void* data,
460 size_t size,
461 GXBitmap* pbitmap);
462PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemoryFrame(const void* data,
463 size_t size,
464 uint32_t frame_index,
465 uint32_t* ptotal_frames,
466 GXBitmap* pbitmap);
467PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToFile(GXBitmap bitmap, const wchar_t* filename);
468#ifdef _WIN32
469PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromHBITMAP(void* hbitmap, GXBitmap* pbitmap);
470PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToHBITMAP(GXBitmap bitmap, void** phbitmap);
471#endif
472PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPixelFormat(GXBitmap bitmap, GXPixelFormat* pformat);
473PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetSize(GXBitmap bitmap, PDSizeI* psize);
474PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiX(GXBitmap bitmap, float* pdpix);
475PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiY(GXBitmap bitmap, float* pdpiy);
476PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetPalette(GXBitmap bitmap, GXPalette palette);
477PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPalette(GXBitmap bitmap, GXPalette* ppalette);
478PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapLock(GXBitmap bitmap,
479 const PDRectI* rect,
481 GXLockedData*);
482PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapUnlock(GXBitmap bitmap);
483PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromBitmap(GXBitmap bitmap,
484 const PDPointI* dest_point,
485 GXBitmap source,
486 const PDRectI* source_rect);
487PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromMemory(GXBitmap bitmap,
488 const PDRectI* dest_rect,
489 const GXLockedData* data);
490PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyToMemory(GXBitmap bitmap,
491 const PDRectI* source_rect,
492 const GXLockedData* data);
493PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapColorFill(GXBitmap bitmap,
494 const PDRectI* rect,
495 GXColorValue color);
496PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapNotifyChanged(GXBitmap bitmap);
497PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetOffscreenPainting(GXBitmap bitmap, bool offscreen);
498
502PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheSetMemoryQuota(size_t quota);
503PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryQuota(size_t* pquota);
504PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryInUse(size_t* pinuse);
505PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCachePut(GXBitmap bitmap, GXCacheEntryID* pid);
506PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGet(GXCacheEntryID id, GXBitmap* pbitmap);
507PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheRemove(GXCacheEntryID id);
508
512PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientLinear(const GXLinearGradientAttrs* attrs,
513 GXGradient* pgradient);
514PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientRadial(const GXRadialGradientAttrs* attrs,
515 GXGradient* pgradient);
516PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientTriMesh(const GXMeshVertex* vertices,
517 size_t num_vertices,
518 GXColorValue bgcolor,
519 GXGradient* pgradient);
520
524PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolidARGB(GXColorValue argb, GXBrush* pbrush);
525PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushBitmap(GXBitmap bitmap,
526 float opacity,
527 const GXBitmapBrushAttrs* attrs,
528 const PDMatrix* xform,
529 GXBrush* pbrush);
530PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushGradient(GXGradient gradient,
531 float opacity,
532 const PDMatrix* xform,
533 GXBrush* pbrush);
534
538PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnumSysFonts(GXSysFontEnumProc proc, void* userdata);
539PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFindSysFont(const GXSysFontQuery* query, GXSysFont* psysfont);
540PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFamilyName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
541PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetPostScriptName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
542PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
543PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetStyle(GXSysFont sysfont, GXFontStyle* pStyle);
544PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontFlags(GXSysFont sysfont, GXFontFlags* pFlags);
545PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetUnicodeRanges(GXSysFont sysfont, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
546
547PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetCustomSysFontsHandler(const GXSysFontsHandler* handler, void* handlerData);
548PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetDirectorySysFontsHandler(const wchar_t* directory);
549PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXAddCustomSysFontsHandler(const GXSysFontsHandler* handler, void* handlerData, GXSysFontsHandlerID* phandlerId);
550PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXAddDirectorySysFontsHandler(const wchar_t* directory, GXSysFontsHandlerID* phandlerId);
551PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRemoveSysFontsHandler(GXSysFontsHandlerID handlerId);
552PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXResetSysFontsHandlers(void);
553
557PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromSysFont(GXSysFont sysfont, GXFontFace* pfontface);
558PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromFile(const wchar_t* filename,
559 uint32_t faceindex,
560 uint32_t* ptotalfaces,
561 GXFontFace* pfontface);
562PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromMemory(const void* data,
563 size_t size,
564 bool copyData,
565 uint32_t faceindex,
566 uint32_t* ptotalfaces,
567 GXFontFace* pfontface);
568PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFamilyName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
569PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetPostScriptName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
570PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
571PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetStyle(GXFontFace font, GXFontStyle* pStyle);
572PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontFlags(GXFontFace font, GXFontFlags* pFlags);
573PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetUnicodeRanges(GXFontFace font, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
574PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetMetrics(GXFontFace font, GXFontMetrics* pmetrics);
575PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetGlyphIndex(GXFontFace font, uint32_t unicode, uint32_t* pglyphindex);
576PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetGlyphAdvance(GXFontFace font, uint32_t glyphIndex, uint32_t* padvance);
577PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceRenderGlyphOutline(GXFontFace font, uint32_t glyphIndex, const PDMatrix* transform, GXGeometry geom);
578PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceOpenFontStream(GXFontFace font, uint32_t tableTag, PDReadStream* pstream);
579PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceHasCharmap(GXFontFace font, uint16_t platformId, uint16_t encodingId, bool* pResult);
580
581PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetNumVariationAxes(GXFontFace font, size_t* pcount);
582PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetVariationAxis(GXFontFace font, size_t index, GXFontVariationAxisInfo* pinfo);
583PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetVariationAxisName(GXFontFace font, uint32_t tag, wchar_t* buffer, size_t bufsize, size_t* psize);
584PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetNumVariationInstances(GXFontFace font, size_t* pcount);
585PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetVariationInstanceName(GXFontFace font, size_t index, wchar_t* buffer, size_t bufsize, size_t* psize);
586PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetVariationInstanceAxisValues(GXFontFace font, size_t index, GXFontVariationAxisValue* buffer, size_t bufsize, size_t* pcount);
587PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetVariation(GXFontFace font, GXFontVariationAxisValue* buffer, size_t bufsize, size_t* pcount);
588PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceSetVariation(GXFontFace font, const GXFontVariationAxisValue* axisValues, size_t count);
589
593PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGeometry(GXGeometry* pgeom);
594PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySetFillRule(GXGeometry geom, GXFillRule fillrule);
595PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFillRule(GXGeometry geom, GXFillRule* pfillrule);
596PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEmpty(GXGeometry geom, bool* pempty);
597PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryPointsEqual(GXGeometry geomA,
598 GXGeometry geomB,
599 bool* pequal);
600PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetCurrentPoint(GXGeometry geom, PDPointF* ppoint);
601PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetBound(GXGeometry geom,
602 const PDMatrix* xform,
603 PDRectF* pbound);
604PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryBeginFigure(GXGeometry geom, const PDPointF* point);
605PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigure(GXGeometry geom);
606PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigureClose(GXGeometry geom);
607PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryLineTo(GXGeometry geom, const PDPointF* to);
608PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryConicCurveTo(GXGeometry geom,
609 const PDPointF* c,
610 const PDPointF* to);
611PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCubicCurveTo(GXGeometry geom,
612 const PDPointF* c0,
613 const PDPointF* c1,
614 const PDPointF* to);
615PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRectangle(GXGeometry geom, const PDRectF* rect);
616PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEllipse(GXGeometry geom, const PDRectF* bound);
617PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRoundRectangle(GXGeometry geom,
618 const PDRectF* rect,
619 float xradii,
620 float yradii);
621PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCopy(GXGeometry geom, GXGeometry* pcopy);
622PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryTransform(GXGeometry geom,
623 const PDMatrix* xform,
624 GXGeometry* presult);
625PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryWiden(GXGeometry geom,
626 float width,
627 const GXStrokeParams* params,
628 float flatness,
629 GXGeometry* presult);
630PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCombine(GXGeometry geomA,
631 GXGeometry geomB,
632 const PDMatrix* xform,
633 GXCombineMode mode,
634 float flatness,
635 GXGeometry* presult);
636PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryHitTest(GXGeometry geom,
637 const PDPointF* point,
638 bool* phit);
639PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySimplify(GXGeometry geom,
640 float flatness,
641 GXGeometry* presult);
642PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsRectangle(GXGeometry geom,
643 const PDMatrix* xform,
644 bool* pisrectangle,
645 PDRectF* prectangle);
646PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetNumFigures(GXGeometry geom, size_t* pnumfigures);
647PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumSegments(GXGeometry geom, size_t figureindex, size_t* pnumsegs);
648PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumPoints(GXGeometry geom, size_t figureindex, size_t* pnumpoints);
649PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigurePointsPtr(GXGeometry geom, size_t figureindex, const PDPointF** ppoints);
650PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureSegmentCurve(GXGeometry geom, size_t figureindex, size_t segindex, bool* iscurve);
651PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureSegmentPointsIndex(GXGeometry geom, size_t figureindex, size_t segindex, size_t* ppointsindex);
652PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureClosed(GXGeometry geom, size_t figureindex, bool* pisclosed);
653
657PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegion(GXRegion* pregion);
658PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegionFromRect(const PDRectI* rect, GXRegion* pregion);
659PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionIsAreaEmpty(GXRegion region, bool* pempty);
660PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionGetBound(GXRegion region, PDRectI* pbound);
661PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsPoint(GXRegion region,
662 const PDPointI* point,
663 bool* pcontains);
664PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsRect(GXRegion region,
665 const PDRectI* rect,
666 bool* pcontains);
667PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContains(GXRegion region,
668 GXRegion that_region,
669 bool* pcontains);
670PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersection(GXRegion region,
671 GXRegion that_region,
672 bool* pisects);
673PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersectionWithRect(GXRegion region,
674 const PDRectI* rect,
675 bool* pisects);
676PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionOffset(GXRegion region, int x, int y);
677PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombine(GXRegion region,
678 GXRegion that_region,
679 GXCombineMode mode,
680 GXRegion* presult);
681PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombineRect(GXRegion region,
682 const PDRectI* rect,
683 GXCombineMode mode,
684 GXRegion* presult);
685PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionEnumRects(GXRegion region,
686 GXRegionRectEnumProc proc,
687 void* userdata);
688
692PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetBitmap(GXBitmap bitmap,
693 GXRenderTarget* ptarget);
694PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetExtBuf(void* pixels,
695 int stride,
696 const GXBitmapAttrs* attrs,
697 GXRenderTarget* ptarget);
698
699#ifdef _WIN32
700PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHWND(void* hwnd,
701 GXRuntimeMode mode,
702 GXRenderTarget* ptarget);
703PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetPrintDC(void* hdc, GXRenderTarget* ptarget);
704PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHDC(void* hdc,
705 const PDRectI* rect,
706 GXRenderTarget* ptarget);
707#endif // _WIN32
708
709PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetPixelFormat(GXRenderTarget target,
710 GXPixelFormat* pformat);
711PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetSize(GXRenderTarget target, PDSizeI* psize);
712PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClear(GXRenderTarget target,
713 GXColorValue clear_color);
714PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginPaint(GXRenderTarget target);
715PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndPaint(GXRenderTarget target);
716PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPushState(GXRenderTarget target);
717PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPopState(GXRenderTarget target);
718PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetCTM(GXRenderTarget target, PDMatrix* pctm);
719PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetCTM(GXRenderTarget target, const PDMatrix* ctm);
720PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetConcatCTM(GXRenderTarget target,
721 const PDMatrix* xform);
722PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetRotateCTM(GXRenderTarget target, float radians);
723PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetScaleCTM(GXRenderTarget target, float sx, float sy);
724PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetTranslateCTM(GXRenderTarget target,
725 float dx,
726 float dy);
727PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetBlendMode(GXRenderTarget target,
728 GXBlendMode mode);
729PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetStrokeAdjustment(GXRenderTarget target,
730 bool adjust);
731PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetStrokeAdjustment(GXRenderTarget target,
732 bool* padjust);
733PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetOpacityMask(GXRenderTarget target,
734 GXMaskMode mode,
735 GXBrush mask);
736PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetShapeMask(GXRenderTarget target,
737 GXMaskMode mode,
738 GXBrush mask);
739PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginLayer(GXRenderTarget target,
740 const GXLayerParams* params);
741PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndLayer(GXRenderTarget target);
742PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillGeometry(GXRenderTarget target,
743 GXGeometry geom,
744 GXBrush brush);
745PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillTextGeometry(GXRenderTarget target,
746 GXGeometry geom,
747 GXBrush brush);
748PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillRect(GXRenderTarget target,
749 const PDRectF* rect,
750 GXBrush brush);
751PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillEllipse(GXRenderTarget target,
752 const PDRectF* bound,
753 GXBrush brush);
754PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeGeometry(GXRenderTarget target,
755 GXGeometry geom,
756 GXBrush brush,
757 float width,
758 const GXStrokeParams* params);
759PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeLine(GXRenderTarget target,
760 const PDPointF* start,
761 const PDPointF* end,
762 GXBrush brush,
763 float width,
764 const GXStrokeParams* params);
765PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeRect(GXRenderTarget target,
766 const PDRectF* rect,
767 GXBrush brush,
768 float width,
769 const GXStrokeParams* params);
770PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeEllipse(GXRenderTarget target,
771 const PDRectF* bound,
772 GXBrush brush,
773 float width,
774 const GXStrokeParams* params);
775PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipGeometry(GXRenderTarget target, GXGeometry geom);
776PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipRect(GXRenderTarget target, const PDRectF* rect);
777PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipEllipse(GXRenderTarget target,
778 const PDRectF* bound);
779PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawBitmap(GXRenderTarget target,
780 GXBitmap bitmap,
781 float opacity,
782 GXInterpolationMode imode);
783PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStretchBitmap(GXRenderTarget target,
784 GXBitmap bitmap,
785 const PDRectF* target_rect,
786 float opacity,
787 GXInterpolationMode imode);
788PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawGradient(GXRenderTarget target,
789 GXGradient gradient,
790 float opacity);
791PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillMask(GXRenderTarget target,
792 GXBitmap mask,
793 GXBrush brush,
794 GXInterpolationMode imode);
795PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertRect(GXRenderTarget target,
796 const PDRectF* rect);
797PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertLine(GXRenderTarget target,
798 const PDPointI* start,
799 const PDPointI* end);
800PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillText(GXRenderTarget target,
801 GXFontFace font,
802 float fontSize,
803 const wchar_t* text,
804 GXBrush brush);
805PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDrawBounds(GXRenderTarget target, PDRectI* pbounds);
806PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiX(GXRenderTarget target, float* pdpix);
807PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiY(GXRenderTarget target, float* pdpiy);
808
809#ifdef __cplusplus
810} // extern "C"
811#endif
812
813#endif // PDFSDK_GRAPHICS_H_INCLUDED_
Error codes.
int32_t PDErrCode
Definition errors.h:44
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolidARGB(GXColorValue argb, GXBrush *pbrush)
GXLockMode
Defines the level of access and control over the graphics content.
Definition graphics.h:99
@ kGXLockModeWrite
Definition graphics.h:101
@ kGXLockModeRead
Definition graphics.h:100
@ kGXLockModeReadWrite
Definition graphics.h:102
GXLineCap
Determines the style used to finish the ends of lines in a graphics context.
Definition graphics.h:225
@ kGXLineCapRound
Definition graphics.h:228
@ kGXLineCapSquare
Definition graphics.h:229
@ kGXLineCapFlat
Definition graphics.h:226
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetBitmap(GXBitmap bitmap, GXRenderTarget *ptarget)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmap(const GXBitmapAttrs *attrs, GXBitmap *pbitmap)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromSysFont(GXSysFont sysfont, GXFontFace *pfontface)
GXFillRule
Determines how a path (a series or points that define a shape) is filled with color.
Definition graphics.h:129
@ kGXFillRuleNonZero
Definition graphics.h:130
@ kGXFillRuleEvenOdd
Definition graphics.h:134
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheSetMemoryQuota(size_t quota)
GXInterpolationMode
Defines the way through which pixel values are estimated or interpolated.
Definition graphics.h:116
@ kGXInterpolationModeNearestNeighbor
Definition graphics.h:117
@ kGXInterpolationModeAreaAverage
Definition graphics.h:119
@ kGXInterpolationModeLinear
Definition graphics.h:118
GXRuntimeMode
Defines the runtime modes for the Graphics application.
Definition graphics.h:39
@ kGXRuntimeModePrint
Definition graphics.h:42
@ kGXRuntimeModeSoftware
Definition graphics.h:41
@ kGXRuntimeModeHardware
Definition graphics.h:40
GXBlendMode
Determines the way in which colors of overlapping objects are combined.
Definition graphics.h:148
@ kGXBlendModeDifference
Definition graphics.h:164
@ kGXBlendModeSaturation
Definition graphics.h:168
@ kGXBlendModeNormal
Definition graphics.h:149
@ kGXBlendModeExclusion
Definition graphics.h:165
@ kGXBlendModeColor
Definition graphics.h:170
@ kGXBlendModeLighten
Definition graphics.h:157
@ kGXBlendModeSoftLight
Definition graphics.h:162
@ kGXBlendModeDarken
Definition graphics.h:156
@ kGXBlendModeMultiply
Definition graphics.h:150
@ kGXBlendModeOverlay
Definition graphics.h:154
@ kGXBlendModeColorBurn
Definition graphics.h:158
@ kGXBlendModeColorDodge
Definition graphics.h:159
@ kGXBlendModeHardLight
Definition graphics.h:160
@ kGXBlendModeHue
Definition graphics.h:166
@ kGXBlendModeScreen
Definition graphics.h:152
@ kGXBlendModeLuminosity
Definition graphics.h:172
GXCombineMode
Determines how the areas of different graphics interact with each other.
Definition graphics.h:202
@ kGXCombineModeComplement
Definition graphics.h:207
@ kGXCombineModeUnion
Definition graphics.h:204
@ kGXCombineModeExclude
Definition graphics.h:206
@ kGXCombineModeDifference
Definition graphics.h:205
@ kGXCombineModeIntersect
Definition graphics.h:203
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnumSysFonts(GXSysFontEnumProc proc, void *userdata)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreatePalette(const GXColorValue *colors, size_t num_colors, GXPalette *ppalette)
GXFontStyle
Defines the various styles that can be applied to text within a PDF document.
Definition graphics.h:328
@ kGXFontStyleRegular
Definition graphics.h:329
@ kGXFontStyleItalic
Definition graphics.h:330
@ kGXFontStyleBoldItalic
Definition graphics.h:332
@ kGXFontStyleBold
Definition graphics.h:331
GXMaskMode
Determines the type of mask used to control which parts of an image or graphical element are visible ...
Definition graphics.h:183
@ kGXMaskModeInverseAlpha
Definition graphics.h:187
@ kGXMaskModeLuminosity
Definition graphics.h:190
@ kGXMaskModeInverseLuminosity
Definition graphics.h:192
@ kGXMaskModeAlpha
Definition graphics.h:184
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientLinear(const GXLinearGradientAttrs *attrs, GXGradient *pgradient)
GXPixelFormat
Defines the pixel format of the graphics application.
Definition graphics.h:76
@ kGXPixelFormatP8
Definition graphics.h:87
@ kGXPixelFormatA8
Definition graphics.h:86
@ kGXPixelFormatXRGB8
Definition graphics.h:84
@ kGXPixelFormatARGB8p
Definition graphics.h:79
@ kGXPixelFormatUnknown
Definition graphics.h:77
@ kGXPixelFormatL1
Definition graphics.h:91
@ kGXPixelFormatRGB8
Definition graphics.h:78
@ kGXPixelFormatA1
Definition graphics.h:89
@ kGXPixelFormatL8
Definition graphics.h:88
@ kGXPixelFormatP1
Definition graphics.h:90
@ kGXPixelFormatARGB8
Definition graphics.h:82
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegion(GXRegion *pregion)
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnableHWAccelerationForThread()
GXExtendMode
Defines the way embedded images or patterns within a PDF file are handled.
Definition graphics.h:309
@ kGXExtendModeClamp
Definition graphics.h:310
@ kGXExtendModeWrap
Definition graphics.h:312
@ kGXExtendModeMirror
Definition graphics.h:313
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGeometry(GXGeometry *pgeom)
GXLineJoin
Determines the shape that is used to connect the endpoints of two line segments that meet at a corner...
Definition graphics.h:239
@ kGXLineJoinRound
Definition graphics.h:241
@ kGXLineJoinBevel
Definition graphics.h:242
@ kGXLineJoinMiter
Definition graphics.h:240
Math types.
Streams API.
Definition graphics.h:265
Definition graphics.h:317
Definition graphics.h:252
Definition graphics.h:335
Definition graphics.h:376
Definition graphics.h:371
Definition graphics.h:272
Definition graphics.h:210
Definition graphics.h:277
Definition graphics.h:105
Definition graphics.h:299
Definition graphics.h:287
Definition graphics.h:258
Definition graphics.h:395
Definition graphics.h:409
Definition graphics.h:366
Definition math_types.h:60
Definition math_types.h:12
Definition math_types.h:18
Definition math_types.h:30
Definition math_types.h:44
Definition math_types.h:38