PoDoFo 0.9.20
Classes | Enumerations | Functions
utls Namespace Reference

Classes

class  FormatHelper
 
class  RecursionGuard
 

Enumerations

enum class  XMPListType { LangAlt , Seq , Bag }
 

Functions

void FetchImageRGB (PoDoFo::OutputStream &stream, unsigned width, unsigned heigth, PoDoFo::PdfPixelFormat format, const unsigned char *imageData, const PoDoFo::charbuff &smaskData, PoDoFo::charbuff &scanLine)
 
void FetchImageGrayScale (PoDoFo::OutputStream &stream, unsigned width, unsigned heigth, PoDoFo::PdfPixelFormat format, const unsigned char *imageData, const PoDoFo::charbuff &smaskData, PoDoFo::charbuff &scanLine)
 
void FetchImageBW (PoDoFo::OutputStream &stream, unsigned width, unsigned heigth, PoDoFo::PdfPixelFormat format, fxcodec::ScanlineDecoder &decoder, const PoDoFo::charbuff &smaskData, PoDoFo::charbuff &scanLine)
 
bool DoesMultiplicationOverflow (size_t op1, size_t op2)
 
const char * TypeNameForIndex (unsigned index, const char **types, unsigned len)
 
int TypeNameToIndex (const char *type, const char **types, unsigned len, int unknownValue)
 
size_t ReadBuffer (std::istream &stream, char *buffer, size_t size, bool &eof)
 
bool ReadChar (std::istream &stream, char &ch)
 

Detailed Description

SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om SPDX-License-Identifier: LGPL-2.0-or-later SPDX-License-Identifier: MPL-2.0

Namespace for private utilities and common functions

Enumeration Type Documentation

◆ XMPListType

enum class utls::XMPListType
strong
Enumerator
LangAlt 

ISO 16684-1:2019 "8.2.2.4 Language alternative".

Function Documentation

◆ DoesMultiplicationOverflow()

bool utls::DoesMultiplicationOverflow ( size_t  op1,
size_t  op2 
)

Check if multiplying two numbers will overflow. This is crucial when calculating buffer sizes that are the product of two numbers/

Returns
true if multiplication will overflow

◆ FetchImageBW()

void utls::FetchImageBW ( PoDoFo::OutputStream stream,
unsigned  width,
unsigned  heigth,
PoDoFo::PdfPixelFormat  format,
fxcodec::ScanlineDecoder &  decoder,
const PoDoFo::charbuff smaskData,
PoDoFo::charbuff scanLine 
)

Fetch a black and white image and write it to the stream

◆ FetchImageGrayScale()

void utls::FetchImageGrayScale ( PoDoFo::OutputStream stream,
unsigned  width,
unsigned  heigth,
PoDoFo::PdfPixelFormat  format,
const unsigned char *  imageData,
const PoDoFo::charbuff smaskData,
PoDoFo::charbuff scanLine 
)

Fetch a GrayScale image and write it to the stream

◆ FetchImageRGB()

void utls::FetchImageRGB ( PoDoFo::OutputStream stream,
unsigned  width,
unsigned  heigth,
PoDoFo::PdfPixelFormat  format,
const unsigned char *  imageData,
const PoDoFo::charbuff smaskData,
PoDoFo::charbuff scanLine 
)

Fetch a RGB image and write it to the stream

◆ ReadBuffer()

size_t utls::ReadBuffer ( std::istream &  stream,
char *  buffer,
size_t  size,
bool &  eof 
)
Returns
number or read bytes
Parameters
eoftrue if the stream reached EOF during read

◆ ReadChar()

bool utls::ReadChar ( std::istream &  stream,
char &  ch 
)
Returns
true if success, false if eof

◆ TypeNameForIndex()

const char * utls::TypeNameForIndex ( unsigned  index,
const char **  types,
unsigned  len 
)

Convert an enum or index to its string representation which can be written to the PDF file.

This is a helper function for various classes that need strings and enums for their SubTypes keys.

Parameters
indexthe index or enum value
typesan array of strings containing the string mapping of the index
lenthe length of the string array
Returns
the string representation or nullptr for values out of range

◆ TypeNameToIndex()

int utls::TypeNameToIndex ( const char *  type,
const char **  types,
unsigned  len,
int  unknownValue 
)

Convert a string type to an array index or enum.

This is a helper function for various classes that need strings and enums for their SubTypes keys.

Parameters
typethe type as string
typesan array of strings containing the string mapping of the index
lenthe length of the string array
unknownValuethe value that is returned when the type is unknown
Returns
the index of the string in the array