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 enum {
372 kGXSysFontQueryMatchFamily = 0x01,
373 kGXSysFontQueryMatchWeight = 0x02,
374 kGXSysFontQueryMatchCharset = 0x04,
375 kGXSysFontQueryMatchPitch = 0x08,
376 kGXSysFontQueryMatchSerifs = 0x10,
377 kGXSysFontQueryMatchScript = 0x20,
378 kGXSysFontQueryMatchItalic = 0x40,
379} GXSysFontQueryMatchFlagsBits;
380
381typedef unsigned int GXSysFontQueryMatchFlags;
382
383typedef struct {
384 GXSysFontQueryMatchFlags matchFlags;
385 const wchar_t* family;
386 GXFontStyle style;
387 GXUnicodeChar unicode;
388 bool fixedPitch;
389 bool serif;
390 bool script;
392
393typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontEnumProc)(void* userdata, GXSysFont sysfont);
394typedef PDErrCode(PDFSDK_CALLCONV* GXSysFontCustomEnumProc)(void* userdata, void* fontData);
395
396typedef struct {
397 PDErrCode(PDFSDK_CALLCONV* enumFonts)(void* handlerData, GXSysFontCustomEnumProc proc, void* userdata);
398 PDErrCode(PDFSDK_CALLCONV* getFamilyName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
399 PDErrCode(PDFSDK_CALLCONV* getPostScriptName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
400 PDErrCode(PDFSDK_CALLCONV* getFontName)(void* fontData, wchar_t* buffer, size_t bufsize, size_t* psize);
401 PDErrCode(PDFSDK_CALLCONV* getStyle)(void* fontData, GXFontStyle* pStyle);
402 PDErrCode(PDFSDK_CALLCONV* getFontFlags)(void* fontData, GXFontFlags* pFlags);
403 PDErrCode(PDFSDK_CALLCONV* getUnicodeRanges)(void* fontData, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
404 PDErrCode(PDFSDK_CALLCONV* loadFontFace)(void* fontData, GXFontFace* pFontFace);
405 void(PDFSDK_CALLCONV* freeFontData)(void* fontData);
406 void(PDFSDK_CALLCONV* freeHandlerData)(void* handlerData);
408
409typedef PDErrCode(PDFSDK_CALLCONV* GXRegionRectEnumProc)(void* userdata, const PDRectI* rect);
410
411typedef unsigned int GXCacheEntryID;
412
416PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnableHWAccelerationForThread();
417
418PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectAcquire(GXObject object);
419PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXObjectRelease(GXObject object);
420
424PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreatePalette(const GXColorValue* colors,
425 size_t num_colors,
426 GXPalette* ppalette);
427PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetNumColors(GXPalette palette, size_t* pnum_colors);
428PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColor(GXPalette palette,
429 size_t index,
430 GXColorValue* pcolor);
431PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXPaletteGetColors(GXPalette palette,
432 const GXColorValue** pcolors);
433
437PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmap(const GXBitmapAttrs* attrs, GXBitmap* pbitmap);
438
439PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFile(const wchar_t* filename, GXBitmap* pbitmap);
440PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromFileFrame(const wchar_t* filename,
441 uint32_t frame_index,
442 uint32_t* ptotal_frames,
443 GXBitmap* pbitmap);
444PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemory(const void* data,
445 size_t size,
446 GXBitmap* pbitmap);
447PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromMemoryFrame(const void* data,
448 size_t size,
449 uint32_t frame_index,
450 uint32_t* ptotal_frames,
451 GXBitmap* pbitmap);
452PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToFile(GXBitmap bitmap, const wchar_t* filename);
453#ifdef _WIN32
454PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBitmapFromHBITMAP(void* hbitmap, GXBitmap* pbitmap);
455PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSaveToHBITMAP(GXBitmap bitmap, void** phbitmap);
456#endif
457PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPixelFormat(GXBitmap bitmap, GXPixelFormat* pformat);
458PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetSize(GXBitmap bitmap, PDSizeI* psize);
459PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiX(GXBitmap bitmap, float* pdpix);
460PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetDpiY(GXBitmap bitmap, float* pdpiy);
461PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetPalette(GXBitmap bitmap, GXPalette palette);
462PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapGetPalette(GXBitmap bitmap, GXPalette* ppalette);
463PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapLock(GXBitmap bitmap,
464 const PDRectI* rect,
466 GXLockedData*);
467PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapUnlock(GXBitmap bitmap);
468PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromBitmap(GXBitmap bitmap,
469 const PDPointI* dest_point,
470 GXBitmap source,
471 const PDRectI* source_rect);
472PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyFromMemory(GXBitmap bitmap,
473 const PDRectI* dest_rect,
474 const GXLockedData* data);
475PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCopyToMemory(GXBitmap bitmap,
476 const PDRectI* source_rect,
477 const GXLockedData* data);
478PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapColorFill(GXBitmap bitmap,
479 const PDRectI* rect,
480 GXColorValue color);
481PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapNotifyChanged(GXBitmap bitmap);
482PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapSetOffscreenPainting(GXBitmap bitmap, bool offscreen);
483
487PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheSetMemoryQuota(size_t quota);
488PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryQuota(size_t* pquota);
489PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGetMemoryInUse(size_t* pinuse);
490PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCachePut(GXBitmap bitmap, GXCacheEntryID* pid);
491PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheGet(GXCacheEntryID id, GXBitmap* pbitmap);
492PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXBitmapCacheRemove(GXCacheEntryID id);
493
497PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientLinear(const GXLinearGradientAttrs* attrs,
498 GXGradient* pgradient);
499PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientRadial(const GXRadialGradientAttrs* attrs,
500 GXGradient* pgradient);
501PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGradientTriMesh(const GXMeshVertex* vertices,
502 size_t num_vertices,
503 GXColorValue bgcolor,
504 GXGradient* pgradient);
505
509PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushSolidARGB(GXColorValue argb, GXBrush* pbrush);
510PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushBitmap(GXBitmap bitmap,
511 float opacity,
512 const GXBitmapBrushAttrs* attrs,
513 const PDMatrix* xform,
514 GXBrush* pbrush);
515PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateBrushGradient(GXGradient gradient,
516 float opacity,
517 const PDMatrix* xform,
518 GXBrush* pbrush);
519
523PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXEnumSysFonts(GXSysFontEnumProc proc, void* userdata);
524PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFindSysFont(const GXSysFontQuery* query, GXSysFont* psysfont);
525PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFamilyName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
526PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetPostScriptName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
527PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontName(GXSysFont sysfont, wchar_t* buffer, size_t bufsize, size_t* psize);
528PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetStyle(GXSysFont sysfont, GXFontStyle* pStyle);
529PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetFontFlags(GXSysFont sysfont, GXFontFlags* pFlags);
530PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSysFontGetUnicodeRanges(GXSysFont sysfont, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
531PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetCustomSysFontsHandler(const GXSysFontsHandler* handler, void* handlerData);
532PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXSetDirectorySysFontsHandler(const wchar_t* directory);
533
537PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromSysFont(GXSysFont sysfont,
538 GXFontFace* pfontface);
539PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromFile(const wchar_t* filename,
540 uint32_t faceindex,
541 uint32_t* ptotalfaces,
542 GXFontFace* pfontface);
543PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateFontFaceFromMemory(const void* data,
544 size_t size,
545 bool copyData,
546 uint32_t faceindex,
547 uint32_t* ptotalfaces,
548 GXFontFace* pfontface);
549PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFamilyName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
550PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetPostScriptName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
551PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontName(GXFontFace font, wchar_t* buffer, size_t bufsize, size_t* psize);
552PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetStyle(GXFontFace font, GXFontStyle* pStyle);
553PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetFontFlags(GXFontFace font, GXFontFlags* pFlags);
554PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetUnicodeRanges(GXFontFace font, GXUnicodeRange* buffer, size_t bufsize, size_t* psize);
555PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetMetrics(GXFontFace font, GXFontMetrics* pmetrics);
556PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetGlyphIndex(GXFontFace font, uint32_t unicode, uint32_t* pglyphindex);
557PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceGetGlyphAdvance(GXFontFace font, uint32_t glyphIndex, uint32_t* padvance);
558PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceOpenFontStream(GXFontFace font, uint32_t tableTag, PDReadStream* pstream);
559PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXFontFaceHasCharmap(GXFontFace font, uint16_t platformId, uint16_t encodingId, bool* pResult);
560
564PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateGeometry(GXGeometry* pgeom);
565PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySetFillRule(GXGeometry geom, GXFillRule fillrule);
566PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFillRule(GXGeometry geom, GXFillRule* pfillrule);
567PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEmpty(GXGeometry geom, bool* pempty);
568PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryPointsEqual(GXGeometry geomA,
569 GXGeometry geomB,
570 bool* pequal);
571PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetCurrentPoint(GXGeometry geom, PDPointF* ppoint);
572PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetBound(GXGeometry geom,
573 const PDMatrix* xform,
574 PDRectF* pbound);
575PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryBeginFigure(GXGeometry geom, const PDPointF* point);
576PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigure(GXGeometry geom);
577PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEndFigureClose(GXGeometry geom);
578PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryLineTo(GXGeometry geom, const PDPointF* to);
579PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryConicCurveTo(GXGeometry geom,
580 const PDPointF* c,
581 const PDPointF* to);
582PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCubicCurveTo(GXGeometry geom,
583 const PDPointF* c0,
584 const PDPointF* c1,
585 const PDPointF* to);
586PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRectangle(GXGeometry geom, const PDRectF* rect);
587PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryEllipse(GXGeometry geom, const PDRectF* bound);
588PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryRoundRectangle(GXGeometry geom,
589 const PDRectF* rect,
590 float xradii,
591 float yradii);
592PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCopy(GXGeometry geom, GXGeometry* pcopy);
593PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryTransform(GXGeometry geom,
594 const PDMatrix* xform,
595 GXGeometry* presult);
596PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryWiden(GXGeometry geom,
597 float width,
598 const GXStrokeParams* params,
599 float flatness,
600 GXGeometry* presult);
601PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryCombine(GXGeometry geomA,
602 GXGeometry geomB,
603 const PDMatrix* xform,
604 GXCombineMode mode,
605 float flatness,
606 GXGeometry* presult);
607PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryHitTest(GXGeometry geom,
608 const PDPointF* point,
609 bool* phit);
610PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometrySimplify(GXGeometry geom,
611 float flatness,
612 GXGeometry* presult);
613PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsRectangle(GXGeometry geom,
614 const PDMatrix* xform,
615 bool* pisrectangle,
616 PDRectF* prectangle);
617PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetNumFigures(GXGeometry geom, size_t* pnumfigures);
618PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumSegments(GXGeometry geom, size_t figureindex, size_t* pnumsegs);
619PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureNumPoints(GXGeometry geom, size_t figureindex, size_t* pnumpoints);
620PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigurePointsPtr(GXGeometry geom, size_t figureindex, const PDPointF** ppoints);
621PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureSegmentCurve(GXGeometry geom, size_t figureindex, size_t segindex, bool* iscurve);
622PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryGetFigureSegmentPointsIndex(GXGeometry geom, size_t figureindex, size_t segindex, size_t* ppointsindex);
623PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXGeometryIsFigureClosed(GXGeometry geom, size_t figureindex, bool* pisclosed);
624
628PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegion(GXRegion* pregion);
629PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRegionFromRect(const PDRectI* rect, GXRegion* pregion);
630PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionIsAreaEmpty(GXRegion region, bool* pempty);
631PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionGetBound(GXRegion region, PDRectI* pbound);
632PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsPoint(GXRegion region,
633 const PDPointI* point,
634 bool* pcontains);
635PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContainsRect(GXRegion region,
636 const PDRectI* rect,
637 bool* pcontains);
638PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionContains(GXRegion region,
639 GXRegion that_region,
640 bool* pcontains);
641PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersection(GXRegion region,
642 GXRegion that_region,
643 bool* pisects);
644PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionHasIntersectionWithRect(GXRegion region,
645 const PDRectI* rect,
646 bool* pisects);
647PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionOffset(GXRegion region, int x, int y);
648PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombine(GXRegion region,
649 GXRegion that_region,
650 GXCombineMode mode,
651 GXRegion* presult);
652PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionCombineRect(GXRegion region,
653 const PDRectI* rect,
654 GXCombineMode mode,
655 GXRegion* presult);
656PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRegionEnumRects(GXRegion region,
657 GXRegionRectEnumProc proc,
658 void* userdata);
659
663PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetBitmap(GXBitmap bitmap,
664 GXRenderTarget* ptarget);
665PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetExtBuf(void* pixels,
666 int stride,
667 const GXBitmapAttrs* attrs,
668 GXRenderTarget* ptarget);
669
670#ifdef _WIN32
671PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHWND(void* hwnd,
672 GXRuntimeMode mode,
673 GXRenderTarget* ptarget);
674PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetPrintDC(void* hdc, GXRenderTarget* ptarget);
675PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXCreateRenderTargetHDC(void* hdc,
676 const PDRectI* rect,
677 GXRenderTarget* ptarget);
678#endif // _WIN32
679
680PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetPixelFormat(GXRenderTarget target,
681 GXPixelFormat* pformat);
682PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetSize(GXRenderTarget target, PDSizeI* psize);
683PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClear(GXRenderTarget target,
684 GXColorValue clear_color);
685PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginPaint(GXRenderTarget target);
686PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndPaint(GXRenderTarget target);
687PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPushState(GXRenderTarget target);
688PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetPopState(GXRenderTarget target);
689PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetCTM(GXRenderTarget target, PDMatrix* pctm);
690PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetCTM(GXRenderTarget target, const PDMatrix* ctm);
691PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetConcatCTM(GXRenderTarget target,
692 const PDMatrix* xform);
693PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetRotateCTM(GXRenderTarget target, float radians);
694PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetScaleCTM(GXRenderTarget target, float sx, float sy);
695PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetTranslateCTM(GXRenderTarget target,
696 float dx,
697 float dy);
698PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetBlendMode(GXRenderTarget target,
699 GXBlendMode mode);
700PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetStrokeAdjustment(GXRenderTarget target,
701 bool adjust);
702PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetStrokeAdjustment(GXRenderTarget target,
703 bool* padjust);
704PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetOpacityMask(GXRenderTarget target,
705 GXMaskMode mode,
706 GXBrush mask);
707PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetSetShapeMask(GXRenderTarget target,
708 GXMaskMode mode,
709 GXBrush mask);
710PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetBeginLayer(GXRenderTarget target,
711 const GXLayerParams* params);
712PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetEndLayer(GXRenderTarget target);
713PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillGeometry(GXRenderTarget target,
714 GXGeometry geom,
715 GXBrush brush);
716PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillTextGeometry(GXRenderTarget target,
717 GXGeometry geom,
718 GXBrush brush);
719PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillRect(GXRenderTarget target,
720 const PDRectF* rect,
721 GXBrush brush);
722PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillEllipse(GXRenderTarget target,
723 const PDRectF* bound,
724 GXBrush brush);
725PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeGeometry(GXRenderTarget target,
726 GXGeometry geom,
727 GXBrush brush,
728 float width,
729 const GXStrokeParams* params);
730PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeLine(GXRenderTarget target,
731 const PDPointF* start,
732 const PDPointF* end,
733 GXBrush brush,
734 float width,
735 const GXStrokeParams* params);
736PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeRect(GXRenderTarget target,
737 const PDRectF* rect,
738 GXBrush brush,
739 float width,
740 const GXStrokeParams* params);
741PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStrokeEllipse(GXRenderTarget target,
742 const PDRectF* bound,
743 GXBrush brush,
744 float width,
745 const GXStrokeParams* params);
746PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipGeometry(GXRenderTarget target, GXGeometry geom);
747PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipRect(GXRenderTarget target, const PDRectF* rect);
748PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetClipEllipse(GXRenderTarget target,
749 const PDRectF* bound);
750PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawBitmap(GXRenderTarget target,
751 GXBitmap bitmap,
752 float opacity,
753 GXInterpolationMode imode);
754PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetStretchBitmap(GXRenderTarget target,
755 GXBitmap bitmap,
756 const PDRectF* target_rect,
757 float opacity,
758 GXInterpolationMode imode);
759PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetDrawGradient(GXRenderTarget target,
760 GXGradient gradient,
761 float opacity);
762PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillMask(GXRenderTarget target,
763 GXBitmap mask,
764 GXBrush brush,
765 GXInterpolationMode imode);
766PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertRect(GXRenderTarget target,
767 const PDRectF* rect);
768PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetInvertLine(GXRenderTarget target,
769 const PDPointI* start,
770 const PDPointI* end);
771PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetFillText(GXRenderTarget target,
772 GXFontFace font,
773 float fontSize,
774 const wchar_t* text,
775 GXBrush brush);
776PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDrawBounds(GXRenderTarget target, PDRectI* pbounds);
777PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiX(GXRenderTarget target, float* pdpix);
778PDF_CORE_API PDErrCode PDFSDK_CALLCONV GXRenderTargetGetDpiY(GXRenderTarget target, float* pdpiy);
779
780#ifdef __cplusplus
781} // extern "C"
782#endif
783
784#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: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:383
Definition graphics.h:396
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