mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-12 00:00:44 -04:00
Use binary search to find the right file size
This commit is contained in:
parent
c17a8e7d51
commit
f434e6559b
3 changed files with 47 additions and 22 deletions
|
@ -14,7 +14,7 @@ public:
|
|||
static void optimizeSize(QString &html, const QImage& original, QImage &optimized, int maxPixels = -1, int maxBytes = -1);
|
||||
|
||||
private:
|
||||
static bool checkSize(QString& embeddedImage, const QImage& img, int maxBytes = -1);
|
||||
static int checkSize(QString& embeddedImage, const QImage& img, int maxBytes = -1);
|
||||
static void quantization(const QImage& img, QVector<QRgb>& palette);
|
||||
static void quantization(QList<QRgb>::iterator begin, QList<QRgb>::iterator end, int depth, QVector<QRgb>& palette);
|
||||
static void avgbucket(QList<QRgb>::iterator begin, QList<QRgb>::iterator end, QVector<QRgb>& palette);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue