aboutsummaryrefslogtreecommitdiff
path: root/src/platform/graphics/quartz/ImageFactory.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-10-17 08:37:30 +0800
committerYuqian Yang <crupest@crupest.life>2025-10-17 08:37:30 +0800
commit3c8d5c8f732239a8b50418be27464e30b9dddeae (patch)
tree8ffb46c18e48c8463c1fb16fcacf216f296b8a1f /src/platform/graphics/quartz/ImageFactory.cpp
parent37943858b3b260589b5dc222bb5184d2846fb6dc (diff)
downloadcru-3c8d5c8f732239a8b50418be27464e30b9dddeae.tar.gz
cru-3c8d5c8f732239a8b50418be27464e30b9dddeae.tar.bz2
cru-3c8d5c8f732239a8b50418be27464e30b9dddeae.zip
Exception remove string.
Diffstat (limited to 'src/platform/graphics/quartz/ImageFactory.cpp')
-rw-r--r--src/platform/graphics/quartz/ImageFactory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/platform/graphics/quartz/ImageFactory.cpp b/src/platform/graphics/quartz/ImageFactory.cpp
index 93e452e1..62229bcb 100644
--- a/src/platform/graphics/quartz/ImageFactory.cpp
+++ b/src/platform/graphics/quartz/ImageFactory.cpp
@@ -39,17 +39,17 @@ static String GetImageFormatUniformTypeIdentifier(ImageFormat format) {
case ImageFormat::Gif:
return u"com.compuserve.gif";
default:
- throw Exception(u"Unknown image format.");
+ throw Exception("Unknown image format.");
}
}
void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream,
ImageFormat format, float quality) {
if (quality <= 0 || quality > 1) {
- throw Exception(u"Invalid quality value.");
+ throw Exception("Invalid quality value.");
}
- auto quartz_image = CheckPlatform<QuartzImage>(image, GetPlatformId());
+ auto quartz_image = CheckPlatform<QuartzImage>(image, GetPlatformIdUtf8());
auto cg_image = quartz_image->GetCGImage();
auto uti = ToCFString(GetImageFormatUniformTypeIdentifier(format));
@@ -67,7 +67,7 @@ void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream,
CGImageDestinationAddImage(destination, cg_image, properties);
if (!CGImageDestinationFinalize(destination)) {
- throw Exception(u"Failed to finalize image destination.");
+ throw Exception("Failed to finalize image destination.");
}
CFRelease(quality_wrap);
@@ -78,8 +78,8 @@ void QuartzImageFactory::EncodeToStream(IImage* image, io::Stream* stream,
std::unique_ptr<IImage> QuartzImageFactory::CreateBitmap(int width,
int height) {
- if (width <= 0) throw Exception(u"Image width should be greater than 0.");
- if (height <= 0) throw Exception(u"Image height should be greater than 0.");
+ if (width <= 0) throw Exception("Image width should be greater than 0.");
+ if (height <= 0) throw Exception("Image height should be greater than 0.");
CGColorSpaceRef color_space = CGColorSpaceCreateDeviceRGB();