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
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 struct {
46 float r;
47 float g;
48 float b;
49 float a;
50} GXColor;
51
52typedef uint32_t GXColorValue;
53
54#define GXColorValueGetA(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 24) & 0xFF) / 255.f)
55#define GXColorValueGetR(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 16) & 0xFF) / 255.f)
56#define GXColorValueGetG(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 8) & 0xFF) / 255.f)
57#define GXColorValueGetB(argb) (static_cast<uint8_t>((static_cast<GXColorValue>(argb) >> 0) & 0xFF) / 255.f)
58
81
92
93typedef struct {
94 void* pixels;
95 unsigned int rowLength;
96 int stride;
98
109
117typedef enum {
125} GXFillRule;
126
163
184
197
198typedef struct {
199 PDRectF bound;
200 float opacity;
201 bool isolated;
202 bool knockout;
204
220
232
238enum { kGXDashPatternMaxSize = 15 };
240typedef struct {
241 float phase;
242 float pattern[kGXDashPatternMaxSize];
243 size_t patternLen;
245
246typedef struct {
247 GXLineJoin lineJoin;
248 GXLineCap lineCap;
249 float miterLimit;
250 GXDashPattern dashes;
252
253typedef struct {
254 PDSizeI size;
255 GXPixelFormat format;
256 float dpiX;
257 float dpiY;
259
261 float position;
262 GXColorValue argb;
263};
264
265typedef struct {
266 const GXGradientStop* stops;
267 size_t numStops;
268 PDPointF startPoint;
269 PDPointF endPoint;
270 bool extendStart;
271 bool extendEnd;
272 GXColorValue bgColor;
274
275typedef struct {
276 const GXGradientStop* stops;
277 size_t numStops;
278 PDPointF startPoint;
279 float startRadius;
280 PDPointF endPoint;
281 float endRadius;
282 bool extendStart;
283 bool extendEnd;
284 GXColorValue bgColor;
286
287typedef struct {
288 PDPointF position;
289 GXColorValue color;
291
304
305typedef struct {
306 GXInterpolationMode interpolationMode;
307 GXExtendMode extendModeX;
308 GXExtendMode extendModeY;
310
322
323typedef struct {
324 PDRectI bbox;
325 int16_t unitsPerEm;
326 int16_t ascent;
327 int16_t descent;
328 int16_t stemV;
329 int16_t stemH;
330 int16_t capHeight;
331 int16_t xHeight;
332 int16_t lineGap;
333 int16_t italicAngle;
334 int16_t underlinePosition;
335 int16_t underlineThickness;
336 int16_t strikethroughPosition;
337 int16_t strikethroughThickness;
338 PDPointI superscriptPosition;
339 PDSizeI superscriptSize;
340 PDPointI subscriptPosition;
341 PDSizeI subscriptSize;
343
344typedef enum {
345 kGXFontFlagFixedPitch = 0x01,
346 kGXFontFlagSerif = 0x02,
347 kGXFontFlagScript = 0x04,
348} GXFontFlagsBits;
349
350typedef uint32_t GXFontFlags;
351
352typedef uint32_t GXUnicodeChar;
353
354typedef struct {
355 GXUnicodeChar first;
356 GXUnicodeChar last;
358
359typedef enum {
360 kGXSysFontQueryMatchFamily = 0x01,
361 kGXSysFontQueryMatchWeight = 0x02,
362 kGXSysFontQueryMatchCharset = 0x04,
363 kGXSysFontQueryMatchPitch = 0x08,
364 kGXSysFontQueryMatchSerifs = 0x10,
365 kGXSysFontQueryMatchScript = 0x20,
366 kGXSysFontQueryMatchItalic = 0x40,
367} GXSysFontQueryMatchFlagsBits;
368
369typedef unsigned int GXSysFontQueryMatchFlags;
370
371typedef struct {
372 GXSysFontQueryMatchFlags matchFlags;
373 const wchar_t* family;
374 GXFontStyle style;
375 GXUnicodeChar unicode;
376 bool fixedPitch;
377 bool serif;
378 bool script;
380
381typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontEnumProc)(void* userdata, GXSysFont sysfont);
382typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontCustomEnumProc)(void* userdata, void* fontData);
383
384typedef struct {
385 PDErrCode(PDFSDK_CALLCONV* enumFonts)(void* handlerData, GXSysFontCustomEnumProc proc, void* userdata);
386 PDErrCode(PDFSDK_CALLCONV* getFamilyName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
387 PDErrCode(PDFSDK_CALLCONV* getPostScriptName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
388 PDErrCode(PDFSDK_CALLCONV* getFontName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
389 PDErrCode(PDFSDK_CALLCONV* getStyle)(void* fontData, GXFontStyle* pStyle);
390 PDErrCode(PDFSDK_CALLCONV* getFontFlags)(void* fontData, GXFontFlags* pFlags);
391 PDErrCode(PDFSDK_CALLCONV* getUnicodeRanges)(void* fontData, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
392 PDErrCode(PDFSDK_CALLCONV* loadFontFace)(void* fontData, GXFontFace* pFontFace);
393 void(PDFSDK_CALLCONV* freeFontData)(void* fontData);
394 void(PDFSDK_CALLCONV* freeHandlerData)(void* handlerData);
396
397typedef PDErrCode(PDFSDK_CALLCONV* GXRegionRectEnumProc)(void* userdata, const PDRectI* rect);
398
399typedef unsigned int GXCacheEntryID;
400
404PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnableHWAccelerationForThread();
405
406PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectAcquire(GXObject object);
407PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectRelease(GXObject object);
408
412PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreatePalette(const GXColorValue* colors,
413 size_t num_colors,
414 GXPalette* ppalette);
415PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetNumColors(GXPalette palette, size_t* pnum_colors);
416PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColor(GXPalette palette,
417 size_t index,
418 GXColorValue* pcolor);
419PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColors(GXPalette palette,
420 const GXColorValue** pcolors);
421
425PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmap(const GXBitmapAttrs* attrs, GXBitmap* pbitmap);
426
427PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFile(const wchar_t* filename, GXBitmap* pbitmap);
428PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFileFrame(const wchar_t* filename,
429 uint32_t frame_index,
430 uint32_t* ptotal_frames,
431 GXBitmap* pbitmap);
432PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemory(const void* data,
433 size_t size,
434 GXBitmap* pbitmap);
435PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemoryFrame(const void* data,
436 size_t size,
437 uint32_t frame_index,
438 uint32_t* ptotal_frames,
439 GXBitmap* pbitmap);
440PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToFile(GXBitmap bitmap, const wchar_t* filename);
441#ifdef _WIN32
442PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromHBITMAP(void* hbitmap, GXBitmap* pbitmap);
443PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToHBITMAP(GXBitmap bitmap, void** phbitmap);
444#endif
445PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPixelFormat(GXBitmap bitmap, GXPixelFormat* pformat);
446PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetSize(GXBitmap bitmap, PDSizeI* psize);
447PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiX(GXBitmap bitmap, float* pdpix);
448PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiY(GXBitmap bitmap, float* pdpiy);
449PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetPalette(GXBitmap bitmap, GXPalette palette);
450PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPalette(GXBitmap bitmap, GXPalette* ppalette);
451PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapLock(GXBitmap bitmap,
452 const PDRectI* rect,
454 GXLockedData*);
455PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapUnlock(GXBitmap bitmap);
456PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromBitmap(GXBitmap bitmap,
457 const PDPointI* dest_point,
458 GXBitmap source,
459 const PDRectI* source_rect);
460PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromMemory(GXBitmap bitmap,
461 const PDRectI* dest_rect,
462 const GXLockedData* data);
463PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyToMemory(GXBitmap bitmap,
464 const PDRectI* source_rect,
465 const GXLockedData* data);
466PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapColorFill(GXBitmap bitmap,
467 const PDRectI* rect,
468 GXColorValue color);
469PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapNotifyChanged(GXBitmap bitmap);
470PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetOffscreenPainting(GXBitmap bitmap, bool offscreen);
471
475PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheSetMemoryQuota(size_t quota);
476PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryQuota(size_t* pquota);
477PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryInUse(size_t* pinuse);
478PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCachePut(GXBitmap bitmap, GXCacheEntryID* pid);
479PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGet(GXCacheEntryID id, GXBitmap* pbitmap);
480PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheRemove(GXCacheEntryID id);
481
485PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientLinear(const GXLinearGradientAttrs* attrs,
486 GXGradient* pgradient);
487PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientRadial(const GXRadialGradientAttrs* attrs,
488 GXGradient* pgradient);
489PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientTriMesh(const GXMeshVertex* vertices,
490 size_t num_vertices,
491 GXColorValue bgcolor,
492 GXGradient* pgradient);
493
497PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolid(const GXColor* color, GXBrush* pbrush);
498PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolidARGB(GXColorValue argb, GXBrush* pbrush);
499PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushBitmap(GXBitmap bitmap,
500 float opacity,
501 const GXBitmapBrushAttrs* attrs,
502 const PDMatrix* xform,
503 GXBrush* pbrush);
504PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushGradient(GXGradient gradient,
505 float opacity,
506 const PDMatrix* xform,
507 GXBrush* pbrush);
508
512PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnumSysFonts(GXSysFontEnumProc proc, void* userdata);
513PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFindSysFont(const GXSysFontQuery* query, GXSysFont* psysfont);
514PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFamilyName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
515PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetPostScriptName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
516PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
517PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetStyle(GXSysFont sysfont, GXFontStyle* pStyle);
518PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontFlags(GXSysFont sysfont, GXFontFlags* pFlags);
519PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetUnicodeRanges(GXSysFont sysfont, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
520PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetCustomSysFontsHandler(const GXSysFontsHandler* handler, void* handlerData);
521PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetDirectorySysFontsHandler(const wchar_t* directory);
522
526PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromSysFont(GXSysFont sysfont,
527 GXFontFace* pfontface);
528PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromFile(const wchar_t* filename,
529 uint32_t faceindex,
530 uint32_t* ptotalfaces,
531 GXFontFace* pfontface);
532PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromMemory(const void* data,
533 size_t size,
534 bool copyData,
535 uint32_t faceindex,
536 uint32_t* ptotalfaces,
537 GXFontFace* pfontface);
538PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFamilyName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
539PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetPostScriptName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
540PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
541PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetStyle(GXFontFace font, GXFontStyle* pStyle);
542PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontFlags(GXFontFace font, GXFontFlags* pFlags);
543PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetUnicodeRanges(GXFontFace font, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
544PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetMetrics(GXFontFace font, GXFontMetrics* pmetrics);
545PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetGlyphIndex(GXFontFace font, uint32_t unicode, uint32_t* pglyphindex);
546PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceOpenFontStream(GXFontFace font, uint32_t tableTag, PDReadStream* pstream);
547PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceCalculateTextBound(GXFontFace font, float fontSize, const wchar_t* text, PDRectF* pbound);
548
552PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGeometry(GXGeometry* pgeom);
553PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySetFillRule(GXGeometry geom, GXFillRule fillrule);
554PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFillRule(GXGeometry geom, GXFillRule* pfillrule);
555PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEmpty(GXGeometry geom, bool* pempty);
556PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryPointsEqual(GXGeometry geomA,
557 GXGeometry geomB,
558 bool* pequal);
559PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetCurrentPoint(GXGeometry geom, PDPointF* ppoint);
560PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetBound(GXGeometry geom,
561 const PDMatrix* xform,
562 PDRectF* pbound);
563PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryBeginFigure(GXGeometry geom, const PDPointF* point);
564PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigure(GXGeometry geom);
565PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigureClose(GXGeometry geom);
566PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryLineTo(GXGeometry geom, const PDPointF* to);
567PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryConicCurveTo(GXGeometry geom,
568 const PDPointF* c,
569 const PDPointF* to);
570PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCubicCurveTo(GXGeometry geom,
571 const PDPointF* c0,
572 const PDPointF* c1,
573 const PDPointF* to);
574PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRectangle(GXGeometry geom, const PDRectF* rect);
575PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEllipse(GXGeometry geom, const PDRectF* bound);
576PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRoundRectangle(GXGeometry geom,
577 const PDRectF* rect,
578 float xradii,
579 float yradii);
580PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCopy(GXGeometry geom, GXGeometry* pcopy);
581PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryTransform(GXGeometry geom,
582 const PDMatrix* xform,
583 GXGeometry* presult);
584PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryWiden(GXGeometry geom,
585 float width,
586 const GXStrokeParams* params,
587 float flatness,
588 GXGeometry* presult);
589PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCombine(GXGeometry geomA,
590 GXGeometry geomB,
591 const PDMatrix* xform,
592 GXCombineMode mode,
593 float flatness,
594 GXGeometry* presult);
595PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryHitTest(GXGeometry geom,
596 const PDPointF* point,
597 bool* phit);
598PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySimplify(GXGeometry geom,
599 float flatness,
600 GXGeometry* presult);
601PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsRectangle(GXGeometry geom,
602 const PDMatrix* xform,
603 bool* pisrectangle,
604 PDRectF* prectangle);
605PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetNumFigures(GXGeometry geom, size_t* pnumfigures);
606PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumSegments(GXGeometry geom, size_t figureindex, size_t* pnumsegs);
607PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumPoints(GXGeometry geom, size_t figureindex, size_t* pnumpoints);
608PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigurePointsPtr(GXGeometry geom, size_t figureindex, const PDPointF** ppoints);
609PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureSegmentCurve(GXGeometry geom, size_t figureindex, size_t segindex, bool* iscurve);
610PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureSegmentPointsIndex(GXGeometry geom, size_t figureindex, size_t segindex, size_t* ppointsindex);
611PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureClosed(GXGeometry geom, size_t figureindex, bool* pisclosed);
612
616PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegion(GXRegion* pregion);
617PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegionFromRect(const PDRectI* rect, GXRegion* pregion);
618PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionIsAreaEmpty(GXRegion region, bool* pempty);
619PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionGetBound(GXRegion region, PDRectI* pbound);
620PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsPoint(GXRegion region,
621 const PDPointI* point,
622 bool* pcontains);
623PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsRect(GXRegion region,
624 const PDRectI* rect,
625 bool* pcontains);
626PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContains(GXRegion region,
627 GXRegion that_region,
628 bool* pcontains);
629PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersection(GXRegion region,
630 GXRegion that_region,
631 bool* pisects);
632PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersectionWithRect(GXRegion region,
633 const PDRectI* rect,
634 bool* pisects);
635PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionOffset(GXRegion region, int x, int y);
636PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombine(GXRegion region,
637 GXRegion that_region,
638 GXCombineMode mode,
639 GXRegion* presult);
640PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombineRect(GXRegion region,
641 const PDRectI* rect,
642 GXCombineMode mode,
643 GXRegion* presult);
644PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionEnumRects(GXRegion region,
645 GXRegionRectEnumProc proc,
646 void* userdata);
647
651PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetBitmap(GXBitmap bitmap,
652 GXRenderTarget* ptarget);
653PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetExtBuf(void* pixels,
654 int stride,
655 const GXBitmapAttrs* attrs,
656 GXRenderTarget* ptarget);
657
658#ifdef _WIN32
659PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHWND(void* hwnd,
660 GXRuntimeMode mode,
661 GXRenderTarget* ptarget);
662PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetPrintDC(void* hdc, GXRenderTarget* ptarget);
663PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHDC(void* hdc,
664 const PDRectI* rect,
665 GXRenderTarget* ptarget);
666#endif // _WIN32
667
668#ifdef __APPLE__
669PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetNSView(void* nsview,
670 GXRuntimeMode mode,
671 GXRenderTarget* ptarget);
672#endif // __APPLE__
673
674PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetPixelFormat(GXRenderTarget target,
675 GXPixelFormat* pformat);
676PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetSize(GXRenderTarget target, PDSizeI* psize);
677PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClear(GXRenderTarget target,
678 GXColorValue clear_color);
679PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginPaint(GXRenderTarget target);
680PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndPaint(GXRenderTarget target);
681PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPushState(GXRenderTarget target);
682PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPopState(GXRenderTarget target);
683PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetCTM(GXRenderTarget target, PDMatrix* pctm);
684PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetCTM(GXRenderTarget target, const PDMatrix* ctm);
685PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetConcatCTM(GXRenderTarget target,
686 const PDMatrix* xform);
687PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetRotateCTM(GXRenderTarget target, float radians);
688PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetScaleCTM(GXRenderTarget target, float sx, float sy);
689PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetTranslateCTM(GXRenderTarget target,
690 float dx,
691 float dy);
692PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetBlendMode(GXRenderTarget target,
693 GXBlendMode mode);
694PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetStrokeAdjustment(GXRenderTarget target,
695 bool adjust);
696PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetStrokeAdjustment(GXRenderTarget target,
697 bool* padjust);
698PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetOpacityMask(GXRenderTarget target,
699 GXMaskMode mode,
700 GXBrush mask);
701PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetShapeMask(GXRenderTarget target,
702 GXMaskMode mode,
703 GXBrush mask);
704PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginLayer(GXRenderTarget target,
705 const GXLayerParams* params);
706PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndLayer(GXRenderTarget target);
707PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillGeometry(GXRenderTarget target,
708 GXGeometry geom,
709 GXBrush brush);
710PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillTextGeometry(GXRenderTarget target,
711 GXGeometry geom,
712 GXBrush brush);
713PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillRect(GXRenderTarget target,
714 const PDRectF* rect,
715 GXBrush brush);
716PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillEllipse(GXRenderTarget target,
717 const PDRectF* bound,
718 GXBrush brush);
719PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeGeometry(GXRenderTarget target,
720 GXGeometry geom,
721 GXBrush brush,
722 float width,
723 const GXStrokeParams* params);
724PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeLine(GXRenderTarget target,
725 const PDPointF* start,
726 const PDPointF* end,
727 GXBrush brush,
728 float width,
729 const GXStrokeParams* params);
730PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeRect(GXRenderTarget target,
731 const PDRectF* rect,
732 GXBrush brush,
733 float width,
734 const GXStrokeParams* params);
735PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeEllipse(GXRenderTarget target,
736 const PDRectF* bound,
737 GXBrush brush,
738 float width,
739 const GXStrokeParams* params);
740PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipGeometry(GXRenderTarget target, GXGeometry geom);
741PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipRect(GXRenderTarget target, const PDRectF* rect);
742PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipEllipse(GXRenderTarget target,
743 const PDRectF* bound);
744PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawBitmap(GXRenderTarget target,
745 GXBitmap bitmap,
746 float opacity,
747 GXInterpolationMode imode);
748PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStretchBitmap(GXRenderTarget target,
749 GXBitmap bitmap,
750 const PDRectF* target_rect,
751 float opacity,
752 GXInterpolationMode imode);
753PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawGradient(GXRenderTarget target,
754 GXGradient gradient,
755 float opacity);
756PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillMask(GXRenderTarget target,
757 GXBitmap mask,
758 GXBrush brush,
759 GXInterpolationMode imode);
760PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertRect(GXRenderTarget target,
761 const PDRectF* rect);
762PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertLine(GXRenderTarget target,
763 const PDPointI* start,
764 const PDPointI* end);
765PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillText(GXRenderTarget target,
766 GXFontFace font,
767 float fontSize,
768 const wchar_t* text,
769 GXBrush brush);
770PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDrawBounds(GXRenderTarget target, PDRectI* pbounds);
771PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiX(GXRenderTarget target, float* pdpix);
772PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiY(GXRenderTarget target, float* pdpiy);
773
774#ifdef __cplusplus
775} // extern "C"
776#endif
777
778#endif // PDFSDK_GRAPHICS_H_INCLUDED_
Error codes.
int32_t PDErrCode
Definition errors.h:44
GXLockMode
Defines the level of access and control over the graphics content.
Definition graphics.h:87
@ kGXLockModeWrite
Definition graphics.h:89
@ kGXLockModeRead
Definition graphics.h:88
@ kGXLockModeReadWrite
Definition graphics.h:90
GXLineCap
Determines the style used to finish the ends of lines in a graphics context.
Definition graphics.h:213
@ kGXLineCapRound
Definition graphics.h:216
@ kGXLineCapSquare
Definition graphics.h:217
@ kGXLineCapFlat
Definition graphics.h:214
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:117
@ kGXFillRuleNonZero
Definition graphics.h:118
@ kGXFillRuleEvenOdd
Definition graphics.h:122
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:104
@ kGXInterpolationModeNearestNeighbor
Definition graphics.h:105
@ kGXInterpolationModeAreaAverage
Definition graphics.h:107
@ kGXInterpolationModeLinear
Definition graphics.h:106
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:136
@ kGXBlendModeDifference
Definition graphics.h:152
@ kGXBlendModeSaturation
Definition graphics.h:156
@ kGXBlendModeNormal
Definition graphics.h:137
@ kGXBlendModeExclusion
Definition graphics.h:153
@ kGXBlendModeColor
Definition graphics.h:158
@ kGXBlendModeLighten
Definition graphics.h:145
@ kGXBlendModeSoftLight
Definition graphics.h:150
@ kGXBlendModeDarken
Definition graphics.h:144
@ kGXBlendModeMultiply
Definition graphics.h:138
@ kGXBlendModeOverlay
Definition graphics.h:142
@ kGXBlendModeColorBurn
Definition graphics.h:146
@ kGXBlendModeColorDodge
Definition graphics.h:147
@ kGXBlendModeHardLight
Definition graphics.h:148
@ kGXBlendModeHue
Definition graphics.h:154
@ kGXBlendModeScreen
Definition graphics.h:140
@ kGXBlendModeLuminosity
Definition graphics.h:160
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolid(const GXColor *color, GXBrush *pbrush)
GXCombineMode
Determines how the areas of different graphics interact with each other.
Definition graphics.h:190
@ kGXCombineModeComplement
Definition graphics.h:195
@ kGXCombineModeUnion
Definition graphics.h:192
@ kGXCombineModeExclude
Definition graphics.h:194
@ kGXCombineModeDifference
Definition graphics.h:193
@ kGXCombineModeIntersect
Definition graphics.h:191
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:316
@ kGXFontStyleRegular
Definition graphics.h:317
@ kGXFontStyleItalic
Definition graphics.h:318
@ kGXFontStyleBoldItalic
Definition graphics.h:320
@ kGXFontStyleBold
Definition graphics.h:319
GXMaskMode
Determines the type of mask used to control which parts of an image or graphical element are visible ...
Definition graphics.h:171
@ kGXMaskModeInverseAlpha
Definition graphics.h:175
@ kGXMaskModeLuminosity
Definition graphics.h:178
@ kGXMaskModeInverseLuminosity
Definition graphics.h:180
@ kGXMaskModeAlpha
Definition graphics.h:172
PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientLinear(const GXLinearGradientAttrs *attrs, GXGradient *pgradient)
GXPixelFormat
Defines the pixel format of the graphics application.
Definition graphics.h:64
@ kGXPixelFormatP8
Definition graphics.h:75
@ kGXPixelFormatA8
Definition graphics.h:74
@ kGXPixelFormatXRGB8
Definition graphics.h:72
@ kGXPixelFormatARGB8p
Definition graphics.h:67
@ kGXPixelFormatUnknown
Definition graphics.h:65
@ kGXPixelFormatL1
Definition graphics.h:79
@ kGXPixelFormatRGB8
Definition graphics.h:66
@ kGXPixelFormatA1
Definition graphics.h:77
@ kGXPixelFormatL8
Definition graphics.h:76
@ kGXPixelFormatP1
Definition graphics.h:78
@ kGXPixelFormatARGB8
Definition graphics.h:70
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:297
@ kGXExtendModeClamp
Definition graphics.h:298
@ kGXExtendModeWrap
Definition graphics.h:300
@ kGXExtendModeMirror
Definition graphics.h:301
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:227
@ kGXLineJoinRound
Definition graphics.h:229
@ kGXLineJoinBevel
Definition graphics.h:230
@ kGXLineJoinMiter
Definition graphics.h:228
Math types.
Streams API.
Definition graphics.h:253
Definition graphics.h:305
Definition graphics.h:45
Definition graphics.h:240
Definition graphics.h:323
Definition graphics.h:260
Definition graphics.h:198
Definition graphics.h:265
Definition graphics.h:93
Definition graphics.h:287
Definition graphics.h:275
Definition graphics.h:246
Definition graphics.h:371
Definition graphics.h:384
Definition graphics.h:354
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