17 #define TB_INVALID_DIMENSION -5555
35 void SetDPI(
int src_dpi,
int dst_dpi);
79 #endif // TB_DIMENSION_H
int GetPxFromValue(TBValue *value, int def_value) const
Get a pixel value from TBValue.
Definition: tb_dimension.cpp:79
int GetPxFromString(const TBStr &str, int def_value) const
Get a pixel value from string in any of the following formats: str may be nullptr.
Definition: tb_dimension.cpp:63
int DpToPx(int dp) const
Convert device independant point to pixel.
Definition: tb_dimension.cpp:39
void SetDPI(int src_dpi, int dst_dpi)
Set the source and destination DPI that will affect the conversion.
Definition: tb_dimension.cpp:18
int GetSrcDPI() const
Get the source DPI.
Definition: tb_dimension.h:38
void GetDstDPIFilename(const char *filename, TBTempBuffer *tempbuf) const
Get the file name with destination DPI suffix (F.ex "foo.png" becomes "foo@192.png").
Definition: tb_dimension.cpp:27
TBDimensionConverter converts device independant points to pixels, based on two DPI values...
Definition: tb_dimension.h:26
int MmToPx(int mm) const
Convert millimeter to pixel.
Definition: tb_dimension.cpp:55
TBStr is a simple string class.
Definition: tb_str.h:62
TBValue holds value of a specific type.
Definition: tb_value.h:59
const TBStr & GetDstDPIStr() const
Get the file name suffix that should be used to load bitmaps in the destination DPI.
Definition: tb_dimension.h:45
int GetDstDPI() const
Get the destination DPI.
Definition: tb_dimension.h:41
bool NeedConversion() const
Return true if the source and destinatin DPI are different.
Definition: tb_dimension.h:52
TBTempBuffer manages a buffer that will be deleted on destruction.
Definition: tb_tempbuffer.h:18