Revision: 28643
http://sourceforge.net/p/bibdesk/svn/28643
Author: hofman
Date: 2024-01-21 23:46:15 +0000 (Sun, 21 Jan 2024)
Log Message:
-----------
remove functions for very old system workarounds
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGColorSpaceDescription.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.h
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGColorSpaceDescription.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGColorSpaceDescription.m
2024-01-21 23:42:15 UTC (rev 28642)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGColorSpaceDescription.m
2024-01-21 23:46:15 UTC (rev 28643)
@@ -52,7 +52,7 @@
self = [super init];
if (self) {
_components = CGColorSpaceGetNumberOfComponents(colorSpace);
- _colorSpaceModel = __FVGetColorSpaceModelOfColorSpace(colorSpace);
+ _colorSpaceModel = CGColorSpaceGetModel(colorSpace);
// init to zero for pre-10.5 and for non-indexed spaces
_baseColorSpaceComponents = 0;
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.h
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.h
2024-01-21 23:42:15 UTC (rev 28642)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.h
2024-01-21 23:46:15 UTC (rev 28643)
@@ -82,13 +82,6 @@
@param image The image whose bitmap data you want to release. */
FV_PRIVATE_EXTERN const void __FVCGImageReleaseBytePtr(CGImageRef image);
-/** @internal @brief Get the CGColorSpaceModel of a color space.
-
- @warning This is a hack on 10.4 and earlier.
- @param colorSpace The color space to query.
- @return A CGColorspaceModel value. May be kCGColorSpaceModelUnknown. */
-FV_PRIVATE_EXTERN CGColorSpaceModel
__FVGetColorSpaceModelOfColorSpace(CGColorSpaceRef colorSpace);
-
/** @internal @brief List of tile rects.
The ImageShear test project uses this to draw tiles for diagnostic purposes.
It has no other useful function.
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
2024-01-21 23:42:15 UTC (rev 28642)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
2024-01-21 23:46:15 UTC (rev 28643)
@@ -791,7 +791,7 @@
}
- const bool isIndexedImage = (kCGColorSpaceModelIndexed ==
__FVGetColorSpaceModelOfColorSpace(CGImageGetColorSpace(image)));
+ const bool isIndexedImage = (kCGColorSpaceModelIndexed ==
CGColorSpaceGetModel(CGImageGetColorSpace(image)));
/*
Check this as needed to avoid NULL pointer dereference and other errors;
anything that causes
@@ -1057,29 +1057,9 @@
return __FVCopyImageUsingCacheColorspace(image, desiredSize);
}
-// always returns false on 10.4
-static inline bool __FVCanUseIndexedColorSpaces()
-{
- return (NULL != &CGColorSpaceGetColorTable && NULL !=
&CGColorSpaceGetColorTableCount && NULL != &CGColorSpaceGetBaseColorSpace);
-}
-
-// CGColorSpaceGetColorSpaceModel is in 10.4 and 10.5 CoreGraphics framework;
not sure what it does, since it returns 1 for an indexed colorspace
-
-CGColorSpaceModel __FVGetColorSpaceModelOfColorSpace(CGColorSpaceRef
colorSpace)
-{
- if (NULL != &CGColorSpaceGetModel) return CGColorSpaceGetModel(colorSpace);
- CGColorSpaceRef devRGB = CGColorSpaceCreateDeviceRGB();
- // if not RGB, return unknown so we can punt by redrawing into a new
bitmap context
- CGColorSpaceModel model = kCGColorSpaceModelUnknown;
- // hack; basically relies on CG returning a cached instance for the device
RGB space
- if (CFEqual(devRGB, colorSpace)) model = kCGColorSpaceModelRGB;
- CGColorSpaceRelease(devRGB);
- return model;
-}
-
CGImageRef FVCreateResampledImageOfSize(CGImageRef image, const NSSize
desiredSize)
{
- CGColorSpaceModel colorModel =
__FVGetColorSpaceModelOfColorSpace(CGImageGetColorSpace(image));
+ CGColorSpaceModel colorModel =
CGColorSpaceGetModel(CGImageGetColorSpace(image));
if (FVImageIsIncompatible(image) || __FVBitmapInfoIsIncompatible(image) ||
kCGColorSpaceModelUnknown == colorModel) {
// let CG handle the scaling if we're redrawing anyway (avoids
duplicating huge images, also)
@@ -1088,7 +1068,7 @@
if (kCGColorSpaceModelIndexed == colorModel) {
// indexed spaces with alpha are tricky, and 10.4 doesn't support the
necessary calls
- if (CGImageGetAlphaInfo(image) != kCGImageAlphaNone || false ==
__FVCanUseIndexedColorSpaces())
+ if (CGImageGetAlphaInfo(image) != kCGImageAlphaNone)
return __FVCopyImageUsingCacheColorspace(image, desiredSize);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit