SDWebImageSVGKitDefine.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // SDWebImageSVGKitDefine.h
  3. // SDWebImageSVGPlugin
  4. //
  5. // Created by DreamPiggy on 2018/10/11.
  6. //
  7. #if __has_include(<SDWebImage/SDWebImage.h>)
  8. #import <SDWebImage/SDWebImage.h>
  9. #else
  10. @import SDWebImage;
  11. #endif
  12. @class SVGKImage;
  13. #if SD_UIKIT
  14. /**
  15. Adjust `SVGKImage`'s viewPort && viewBox to match the specify `contentMode` of view size.
  16. @note Though this util method can be used outside this framework. For simple SVG image loading, it's recommaned to use `sd_adjustContentMode` property on `SVGKImageView+WebCache`.
  17. @param image `SVGKImage` instance, should not be nil.
  18. @param contentMode The contentMode to be applied. All possible contentMode are supported.
  19. @param viewSize Target view size, typically specify the `view.bounds.size`.
  20. */
  21. FOUNDATION_EXPORT void SDAdjustSVGContentMode(SVGKImage * __nonnull image, UIViewContentMode contentMode, CGSize viewSize);
  22. #endif
  23. /**
  24. A CGSize raw value which specify the desired SVG image size during image loading. Because vector image like SVG format, may not contains a fixed size, or you want to get a larger size bitmap representation UIImage. (NSValue)
  25. If you don't provide this value, use viewBox size of SVG for default value;
  26. */
  27. FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextSVGKImageSize __attribute__((deprecated("Use the new context option (for WebCache category), or coder option (for SDImageCoder protocol) instead", "SDWebImageContextImageThumbnailPixelSize")));
  28. /**
  29. A BOOL value which specify the whether SVG image should keep aspect ratio during image loading. Because when you specify image size via `SDWebImageContextSVGKImageSize`, we need to know whether to keep aspect ratio or not when image size aspect ratio is not equal to SVG viewBox size aspect ratio. (NSNumber)
  30. If you don't provide this value, use YES for default value.
  31. */
  32. FOUNDATION_EXPORT SDWebImageContextOption _Nonnull const SDWebImageContextSVGKImagePreserveAspectRatio __attribute__((deprecated("Use the new context option (for WebCache category), or coder option (for SDImageCoder protocol) instead", "SDWebImageContextImagePreserveAspectRatio")));