Go to the source code of this file.
|
static char * | get_resource_name (char dst[kMaxResourceNameLength], SkPDFResourceType type, int key) |
|
void | SkPDFWriteResourceName (SkWStream *dst, SkPDFResourceType type, int key) |
|
static const char * | resource_name (SkPDFResourceType type) |
|
static SkString | resource (SkPDFResourceType type, int index) |
|
static void | add_subdict (const std::vector< SkPDFIndirectReference > &resourceList, SkPDFResourceType type, SkPDFDict *dst) |
|
static std::unique_ptr< SkPDFArray > | make_proc_set () |
|
std::unique_ptr< SkPDFDict > | SkPDFMakeResourceDict (const std::vector< SkPDFIndirectReference > &graphicStateResources, const std::vector< SkPDFIndirectReference > &shaderResources, const std::vector< SkPDFIndirectReference > &xObjectResources, const std::vector< SkPDFIndirectReference > &fontResources) |
|
◆ add_subdict()
Definition at line 62 of file SkPDFResourceDict.cpp.
64 {
65 if (!resourceList.empty()) {
69 }
71 }
72}
static SkString resource(SkPDFResourceType type, int index)
static const char * resource_name(SkPDFResourceType type)
static std::unique_ptr< SkPDFDict > SkPDFMakeDict(const char *type=nullptr)
◆ get_resource_name()
static char * get_resource_name |
( |
char |
dst[kMaxResourceNameLength], |
|
|
SkPDFResourceType |
type, |
|
|
int |
key |
|
) |
| |
|
static |
Definition at line 25 of file SkPDFResourceDict.cpp.
25 {
26 static const char kResourceTypePrefixes[] = {
27 'G',
28 'P',
29 'X',
30 'F'
31 };
32 SkASSERT((
unsigned)
type < std::size(kResourceTypePrefixes));
33 dst[0] = kResourceTypePrefixes[(unsigned)
type];
35}
char * SkStrAppendS32(char buffer[], int32_t)
◆ make_proc_set()
static std::unique_ptr< SkPDFArray > make_proc_set |
( |
| ) |
|
|
static |
Definition at line 74 of file SkPDFResourceDict.cpp.
74 {
76 static const char kProcs[][7] = { "PDF", "Text", "ImageB", "ImageC", "ImageI"};
77 procSets->reserve(std::size(kProcs));
78 for (const char* proc : kProcs) {
79 procSets->appendName(proc);
80 }
81 return procSets;
82}
static std::unique_ptr< SkPDFArray > SkPDFMakeArray(Args... args)
◆ resource()
Definition at line 56 of file SkPDFResourceDict.cpp.
56 {
60}
constexpr size_t kMaxResourceNameLength
static char * get_resource_name(char dst[kMaxResourceNameLength], SkPDFResourceType type, int key)
static const uint8_t buffer[]
◆ resource_name()
Definition at line 45 of file SkPDFResourceDict.cpp.
45 {
46 static const char* kResourceTypeNames[] = {
47 "ExtGState",
48 "Pattern",
49 "XObject",
50 "Font"
51 };
52 SkASSERT((
unsigned)
type < std::size(kResourceTypeNames));
53 return kResourceTypeNames[(unsigned)
type];
54}
◆ SkPDFMakeResourceDict()
Create a PDF resource dictionary. The full set of ProcSet entries is automatically created for backwards compatibility, as recommended by the PDF spec.
Any arguments can be nullptr.
Definition at line 84 of file SkPDFResourceDict.cpp.
88 {
95 return dict;
96}
static void add_subdict(const std::vector< SkPDFIndirectReference > &resourceList, SkPDFResourceType type, SkPDFDict *dst)
static std::unique_ptr< SkPDFArray > make_proc_set()
◆ SkPDFWriteResourceName()
Writes the name for the resource that will be generated by the resource dict.
- Parameters
-
type | The type of resource being entered |
key | The resource key, should be unique within its type. |
Definition at line 37 of file SkPDFResourceDict.cpp.
◆ kMaxResourceNameLength