Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
atlas::images Namespace Reference

Namespaces

namespace  async
 
namespace  internal
 

Classes

struct  ImageLoader
 

Functions

std::string createBlurhash (const QPixmap &pixmap)
 
std::string createBlurhash (QImage image)
 
QPixmap decodeBlurhash (const std::string &hash, int width, int height)
 
QPixmap getBlurhash (const std::filesystem::path &path, const QSize size)
 
std::string createBlurhash (const std::filesystem::path &path)
 
void cleanOrphans ()
 Clears all images not found attached to any record.
 
QImage blurImage (const QImage &image, const qreal blur_radius, bool quality_blur, bool alpha_only, int transposed)
 
QPixmap blurPixmap (const QPixmap &pixmap, qreal blur_radius, bool quality_blur, bool alpha_only, int transposed)
 
void saveImage (const QByteArray &byteArray, const std::filesystem::path &dest)
 
void saveImage (const QImage &img, const std::filesystem::path &dest)
 
std::filesystem::path importImage (const std::filesystem::path &path, const RecordID game_id)
 
std::filesystem::path importPixmap (const QPixmap pixmap, const RecordID game_id)
 
std::filesystem::path importImageFromURL (const QString url, const RecordID record_id)
 
std::filesystem::path importPixmap (const QPixmap pixmap, const atlas::records::Game game)
 
const std::string pixmapKey (const QSize target_size, const SCALE_TYPE scale_type, const std::filesystem::path &path)
 
QPixmap scalePixmap (QPixmap img, const QSize target_size, const SCALE_TYPE scale_type)
 
QPixmap loadPixmap (const std::filesystem::path &path)
 
QPixmap loadScaledPixmap (const QSize target_size, const SCALE_TYPE scale_type, const std::filesystem::path &path)
 
QImage loadImage (const std::filesystem::path &path)
 
QSize thumbnailSize ()
 
std::filesystem::path createThumbnail (const std::filesystem::path &image_path)
 Creates a thumbnail for a given image.
 
std::filesystem::path thumbnailPath (const std::filesystem::path &image)
 Returns the thumbnail path for an image. Will return an empty path if no thumbnail is made.
 
QPixmap thumbnail (const std::filesystem::path &path)
 Returns the thumbnail for a path. Path must be a TRUE image. NOT the thumbnail path.
 
void verifyThumbnail (const std::filesystem::path &path)
 Verifies that the thumbnail is the proper resolution and fixes it if not.
 

Function Documentation

◆ blurImage()

QImage atlas::images::blurImage ( const QImage & image,
const qreal blur_radius,
bool quality_blur,
bool alpha_only,
int transposed )

◆ blurPixmap()

QPixmap atlas::images::blurPixmap ( const QPixmap & pixmap,
qreal blur_radius,
bool quality_blur,
bool alpha_only,
int transposed )

◆ cleanOrphans()

void atlas::images::cleanOrphans ( )

Clears all images not found attached to any record.

◆ createBlurhash() [1/3]

std::string atlas::images::createBlurhash ( const QPixmap & pixmap)

◆ createBlurhash() [2/3]

std::string atlas::images::createBlurhash ( const std::filesystem::path & path)

◆ createBlurhash() [3/3]

std::string atlas::images::createBlurhash ( QImage image)

◆ createThumbnail()

std::filesystem::path atlas::images::createThumbnail ( const std::filesystem::path & image_path)

Creates a thumbnail for a given image.

Will create a thumbnail next to the original image with a .thumb as it's extention

Parameters
image_pathpath to create a thumbnail for.

◆ decodeBlurhash()

QPixmap atlas::images::decodeBlurhash ( const std::string & hash,
int width,
int height )

◆ getBlurhash()

QPixmap atlas::images::getBlurhash ( const std::filesystem::path & path,
const QSize size )
nodiscard

◆ importImage()

std::filesystem::path atlas::images::importImage ( const std::filesystem::path & path,
const RecordID game_id )
nodiscard

◆ importImageFromURL()

std::filesystem::path atlas::images::importImageFromURL ( const QString url,
const RecordID record_id )

◆ importPixmap() [1/2]

std::filesystem::path atlas::images::importPixmap ( const QPixmap pixmap,
const atlas::records::Game game )
inlinenodiscard

◆ importPixmap() [2/2]

std::filesystem::path atlas::images::importPixmap ( const QPixmap pixmap,
const RecordID game_id )
nodiscard

◆ loadImage()

QImage atlas::images::loadImage ( const std::filesystem::path & path)
nodiscard

◆ loadPixmap()

QPixmap atlas::images::loadPixmap ( const std::filesystem::path & path)
nodiscard

◆ loadScaledPixmap()

QPixmap atlas::images::loadScaledPixmap ( const QSize target_size,
const SCALE_TYPE scale_type,
const std::filesystem::path & path )
nodiscard

◆ pixmapKey()

const std::string atlas::images::pixmapKey ( const QSize target_size,
const SCALE_TYPE scale_type,
const std::filesystem::path & path )

◆ saveImage() [1/2]

void atlas::images::saveImage ( const QByteArray & byteArray,
const std::filesystem::path & dest )
Parameters
sourceSource path of the image. Used for logging purposes.
byteArray
dest

◆ saveImage() [2/2]

void atlas::images::saveImage ( const QImage & img,
const std::filesystem::path & dest )

◆ scalePixmap()

QPixmap atlas::images::scalePixmap ( QPixmap img,
const QSize target_size,
const SCALE_TYPE scale_type )
nodiscard

◆ thumbnail()

QPixmap atlas::images::thumbnail ( const std::filesystem::path & path)

Returns the thumbnail for a path. Path must be a TRUE image. NOT the thumbnail path.

Parameters
pathPath of the SOURCE image. NOT thumbnail
Returns

◆ thumbnailPath()

std::filesystem::path atlas::images::thumbnailPath ( const std::filesystem::path & image)

Returns the thumbnail path for an image. Will return an empty path if no thumbnail is made.

◆ thumbnailSize()

QSize atlas::images::thumbnailSize ( )

◆ verifyThumbnail()

void atlas::images::verifyThumbnail ( const std::filesystem::path & path)

Verifies that the thumbnail is the proper resolution and fixes it if not.