Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
idomshape.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2009-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
5#include <edl/edlnamespaces.h>
6#include <edl/smartptr.h>
7#include <edl/idomhashable.h>
8
9#ifndef EDLIDOMSHAPE_H
10#define EDLIDOMSHAPE_H
11
12
13// Forward declarations
15class IDOMShape;
18
19
20#include <edl/edltypes.h>
21#include <edl/edlgeom.h>
22#include <edl/iedlobject.h>
23#include <edl/isession.h>
24#include <edl/idombrush.h>
26
27
29
47
48class IDOMShape : public IEDLObject, public IDOMHashable
49{
50public:
51#define IDOMShapeClassID 0x57F23317, 0xA8BF49B1, 0x8EE836DD, 0x0233DC32
56 static const CClassID &classID()
57 {
58 static CClassID id(IDOMShapeClassID);
59 return id;
60 }
61
66 class Data : public CClassParams
67 {
68 public:
69 Data() : resolution(96.0f), privateData(NULL)
70 {}
72 void *privateData; /* EDL Private Shape Data */
73 };
74
82 static EDL_API IDOMShapePtr createRect(IEDLClassFactory *pFactory, float resolution, const FRect &rect);
83
92 static EDL_API IDOMShapePtr createRectPixels(IEDLClassFactory *pFactory, float resolution, const IntRect &rect);
93
100 static EDL_API IDOMShapePtr createEmpty(IEDLClassFactory *pFactory, float resolution);
101
120 virtual IDOMImagePtr getAsImage(const ISessionPtr &session,
121 bool bUseTempFileForImage) const = 0;
122
136 virtual IDOMPathGeometryPtr getAsGeometry(IEDLClassFactory *factory) const = 0;
137
143 virtual FRect getBounds() const = 0;
144
149 virtual IntRect getIntBounds() const = 0;
150
155 virtual float getResolution() const = 0;
156
161 virtual bool getIsEmpty() const = 0;
162
167 virtual bool getIsRect() const = 0;
168
174 virtual bool isEqualTo(const IDOMShapePtr &ptrShape) const = 0;
175
180 virtual void unite(const IDOMShapePtr &ptrShape) = 0;
181
186 virtual void intersect(const IDOMShapePtr &ptrShape) = 0;
187
192 virtual void difference(const IDOMShapePtr &ptrShape) = 0;
193
199 virtual void offset(int32 offsetX, int32 offsetY) = 0;
200
206 virtual bool intersects(const IDOMShapePtr &ptrShape) const = 0;
207
213 virtual bool completelyContainsShape(const IDOMShapePtr &ptrShape) const = 0;
214
223 {
224 public:
229 typedef struct
230 {
234 } CSpan;
237 };
238
243 virtual CShapeDetails getShapeDetails() const = 0;
244};
245
246#define edlobj2IDOMShape(src) edl_cast((IDOMShape *)NULL, src)
247
249
250#endif /* EDLIDOMSHAPE_H */
An object to represent a 128-bit globally unique ID.
Definition objclassid.h:29
EDL Object Interface.
Definition iedlobject.h:31
Abstract interface for objects that can be hashed.
Definition idomhashable.h:28
Provides a view into the regions that comprise the shape. A region consists of a series of spans,...
Definition idomshape.h:223
uint32 numSpans
The number of spans. The last span is used solely to indicate the y endpoint of the penultimate span.
Definition idomshape.h:235
CSpan * spans
The spans as an array. The memory is owned by the IDOMShape. Do not free.
Definition idomshape.h:236
void * privateData
Definition idomshape.h:72
Data()
Definition idomshape.h:69
float resolution
Definition idomshape.h:71
Interface to an IDOMShape.
Definition idomshape.h:49
virtual bool intersects(const IDOMShapePtr &ptrShape) const =0
Detect if this shape intersects with another.
virtual FRect getBounds() const =0
Get the bounds (in pixels) of the shape. The bounds is always integral.
virtual float getResolution() const =0
Get the resolution of the shape.
virtual bool getIsEmpty() const =0
Detect an empty shape.
virtual IDOMImagePtr getAsImage(const ISessionPtr &session, bool bUseTempFileForImage) const =0
Generate a 1-bit-per-pixel DeviceGray image representation of this shape.
virtual bool getIsRect() const =0
Detect if a shape is a rectangle.
virtual void intersect(const IDOMShapePtr &ptrShape)=0
Reduce this shape to its intersection with another shape.
static EDL_API IDOMShapePtr createEmpty(IEDLClassFactory *pFactory, float resolution)
Create an empty shape with the given resolution.
virtual bool isEqualTo(const IDOMShapePtr &ptrShape) const =0
Check this shape for equality to another shape.
static EDL_API IDOMShapePtr createRect(IEDLClassFactory *pFactory, float resolution, const FRect &rect)
Create a rectangular shape.
virtual CShapeDetails getShapeDetails() const =0
Fetch the regions that comprise the shape.
virtual void offset(int32 offsetX, int32 offsetY)=0
Offset the shape by the given numbers of pixels.
static const CClassID & classID()
Retrieves class id of IDOMShape.
Definition idomshape.h:56
virtual void difference(const IDOMShapePtr &ptrShape)=0
Reduce this shape by subtracting another shape.
virtual void unite(const IDOMShapePtr &ptrShape)=0
Unite this shape with another.
virtual IDOMPathGeometryPtr getAsGeometry(IEDLClassFactory *factory) const =0
Get the shape as path geometry.
static EDL_API IDOMShapePtr createRectPixels(IEDLClassFactory *pFactory, float resolution, const IntRect &rect)
As per createRect(), but the rectangle is pixels. The shape will be tagged with the given resolution,...
virtual bool completelyContainsShape(const IDOMShapePtr &ptrShape) const =0
Detect if another shape fits completely inside this shape.
virtual IntRect getIntBounds() const =0
Get the bounds (in pixels) of the shape as an integer rect.
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
IEDLObject is an abstract base class that is used by all classes that are intended to be created via ...
Definition iedlobject.h:53
RectTmpl< double > FRect
Definition edlgeom.h:338
RectTmpl< int32 > IntRect
Definition edlgeom.h:339
EDL C++ namespace(s)
#define _END_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:110
#define _BEGIN_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:109
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned int uint32
Definition edltypes.h:34
#define EDL_API
Definition edltypes.h:86
signed int int32
Definition edltypes.h:29
#define IDOMShapeClassID
Definition idomshape.h:51
EDL smart pointers which, in conjunction with the IRCOject class, provide reference-counted and autom...
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211
Representation of a series of rectangles sharing the same y span.
Definition idomshape.h:230
int32 * xVals
Points representing the start (inclusive) and end (exclusive) in x of the rectangles comprising the s...
Definition idomshape.h:233
int32 length
The number of x points in xVals. Always a multiple of two.
Definition idomshape.h:232
int32 y
The y point of the top of this span (inclusive). The ending y coordinate of the span is the y entry i...
Definition idomshape.h:231