├── .gitattributes
├── News_coretText.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── dengweihao.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ └── dengweihao.xcuserdatad
│ └── xcschemes
│ └── xcschememanagement.plist
├── News_coretText.xcworkspace
├── contents.xcworkspacedata
└── xcuserdata
│ └── dengweihao.xcuserdatad
│ ├── UserInterfaceState.xcuserstate
│ └── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
├── News_coretText
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
├── LBAnalysis.h
├── LBAnalysis.m
├── LBLabel.h
├── LBLabel.m
├── LBScrollView.h
├── LBScrollView.m
├── UIImage+LBDecoder.h
├── UIImage+LBDecoder.m
├── ViewController.h
├── ViewController.m
├── cat.jpg
├── lb.txt
└── main.m
├── Podfile
├── Podfile.lock
├── Pods
├── Headers
│ ├── Private
│ │ ├── SDWebImage
│ │ │ ├── NSData+ImageContentType.h
│ │ │ ├── NSImage+WebCache.h
│ │ │ ├── SDImageCache.h
│ │ │ ├── SDImageCacheConfig.h
│ │ │ ├── SDWebImageCoder.h
│ │ │ ├── SDWebImageCoderHelper.h
│ │ │ ├── SDWebImageCodersManager.h
│ │ │ ├── SDWebImageCompat.h
│ │ │ ├── SDWebImageDownloader.h
│ │ │ ├── SDWebImageDownloaderOperation.h
│ │ │ ├── SDWebImageFrame.h
│ │ │ ├── SDWebImageGIFCoder.h
│ │ │ ├── SDWebImageImageIOCoder.h
│ │ │ ├── SDWebImageManager.h
│ │ │ ├── SDWebImageOperation.h
│ │ │ ├── SDWebImagePrefetcher.h
│ │ │ ├── SDWebImageWebPCoder.h
│ │ │ ├── UIButton+WebCache.h
│ │ │ ├── UIImage+ForceDecode.h
│ │ │ ├── UIImage+GIF.h
│ │ │ ├── UIImage+MultiFormat.h
│ │ │ ├── UIImage+WebP.h
│ │ │ ├── UIImageView+HighlightedWebCache.h
│ │ │ ├── UIImageView+WebCache.h
│ │ │ ├── UIView+WebCache.h
│ │ │ └── UIView+WebCacheOperation.h
│ │ └── libwebp
│ │ │ ├── alphai_dec.h
│ │ │ ├── animi.h
│ │ │ ├── backward_references_enc.h
│ │ │ ├── bit_reader_inl_utils.h
│ │ │ ├── bit_reader_utils.h
│ │ │ ├── bit_writer_utils.h
│ │ │ ├── color_cache_utils.h
│ │ │ ├── common_dec.h
│ │ │ ├── common_sse2.h
│ │ │ ├── cost_enc.h
│ │ │ ├── delta_palettization_enc.h
│ │ │ ├── dsp.h
│ │ │ ├── endian_inl_utils.h
│ │ │ ├── filters_utils.h
│ │ │ ├── histogram_enc.h
│ │ │ ├── huffman_encode_utils.h
│ │ │ ├── huffman_utils.h
│ │ │ ├── lossless.h
│ │ │ ├── lossless_common.h
│ │ │ ├── mips_macro.h
│ │ │ ├── msa_macro.h
│ │ │ ├── muxi.h
│ │ │ ├── neon.h
│ │ │ ├── quant_levels_dec_utils.h
│ │ │ ├── quant_levels_utils.h
│ │ │ ├── random_utils.h
│ │ │ ├── rescaler_utils.h
│ │ │ ├── thread_utils.h
│ │ │ ├── utils.h
│ │ │ ├── vp8_dec.h
│ │ │ ├── vp8i_dec.h
│ │ │ ├── vp8i_enc.h
│ │ │ ├── vp8li_dec.h
│ │ │ ├── vp8li_enc.h
│ │ │ ├── webp
│ │ │ ├── decode.h
│ │ │ ├── demux.h
│ │ │ ├── encode.h
│ │ │ ├── format_constants.h
│ │ │ ├── mux.h
│ │ │ ├── mux_types.h
│ │ │ └── types.h
│ │ │ ├── webpi_dec.h
│ │ │ └── yuv.h
│ └── Public
│ │ ├── SDWebImage
│ │ ├── NSData+ImageContentType.h
│ │ ├── NSImage+WebCache.h
│ │ ├── SDImageCache.h
│ │ ├── SDImageCacheConfig.h
│ │ ├── SDWebImageCoder.h
│ │ ├── SDWebImageCoderHelper.h
│ │ ├── SDWebImageCodersManager.h
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── SDWebImageFrame.h
│ │ ├── SDWebImageGIFCoder.h
│ │ ├── SDWebImageImageIOCoder.h
│ │ ├── SDWebImageManager.h
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── SDWebImageWebPCoder.h
│ │ ├── UIButton+WebCache.h
│ │ ├── UIImage+ForceDecode.h
│ │ ├── UIImage+GIF.h
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImage+WebP.h
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── UIImageView+WebCache.h
│ │ ├── UIView+WebCache.h
│ │ └── UIView+WebCacheOperation.h
│ │ └── libwebp
│ │ ├── alphai_dec.h
│ │ ├── animi.h
│ │ ├── backward_references_enc.h
│ │ ├── bit_reader_inl_utils.h
│ │ ├── bit_reader_utils.h
│ │ ├── bit_writer_utils.h
│ │ ├── color_cache_utils.h
│ │ ├── common_dec.h
│ │ ├── common_sse2.h
│ │ ├── cost_enc.h
│ │ ├── delta_palettization_enc.h
│ │ ├── dsp.h
│ │ ├── endian_inl_utils.h
│ │ ├── filters_utils.h
│ │ ├── histogram_enc.h
│ │ ├── huffman_encode_utils.h
│ │ ├── huffman_utils.h
│ │ ├── lossless.h
│ │ ├── lossless_common.h
│ │ ├── mips_macro.h
│ │ ├── msa_macro.h
│ │ ├── muxi.h
│ │ ├── neon.h
│ │ ├── quant_levels_dec_utils.h
│ │ ├── quant_levels_utils.h
│ │ ├── random_utils.h
│ │ ├── rescaler_utils.h
│ │ ├── thread_utils.h
│ │ ├── utils.h
│ │ ├── vp8_dec.h
│ │ ├── vp8i_dec.h
│ │ ├── vp8i_enc.h
│ │ ├── vp8li_dec.h
│ │ ├── vp8li_enc.h
│ │ ├── webp
│ │ ├── decode.h
│ │ ├── demux.h
│ │ ├── encode.h
│ │ ├── format_constants.h
│ │ ├── mux.h
│ │ ├── mux_types.h
│ │ └── types.h
│ │ ├── webpi_dec.h
│ │ └── yuv.h
├── Manifest.lock
├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── dengweihao.xcuserdatad
│ │ └── xcschemes
│ │ ├── Pods-News_coretText.xcscheme
│ │ ├── SDWebImage.xcscheme
│ │ ├── libwebp.xcscheme
│ │ └── xcschememanagement.plist
├── SDWebImage
│ ├── LICENSE
│ ├── README.md
│ └── SDWebImage
│ │ ├── NSData+ImageContentType.h
│ │ ├── NSData+ImageContentType.m
│ │ ├── NSImage+WebCache.h
│ │ ├── NSImage+WebCache.m
│ │ ├── SDImageCache.h
│ │ ├── SDImageCache.m
│ │ ├── SDImageCacheConfig.h
│ │ ├── SDImageCacheConfig.m
│ │ ├── SDWebImageCoder.h
│ │ ├── SDWebImageCoder.m
│ │ ├── SDWebImageCoderHelper.h
│ │ ├── SDWebImageCoderHelper.m
│ │ ├── SDWebImageCodersManager.h
│ │ ├── SDWebImageCodersManager.m
│ │ ├── SDWebImageCompat.h
│ │ ├── SDWebImageCompat.m
│ │ ├── SDWebImageDownloader.h
│ │ ├── SDWebImageDownloader.m
│ │ ├── SDWebImageDownloaderOperation.h
│ │ ├── SDWebImageDownloaderOperation.m
│ │ ├── SDWebImageFrame.h
│ │ ├── SDWebImageFrame.m
│ │ ├── SDWebImageGIFCoder.h
│ │ ├── SDWebImageGIFCoder.m
│ │ ├── SDWebImageImageIOCoder.h
│ │ ├── SDWebImageImageIOCoder.m
│ │ ├── SDWebImageManager.h
│ │ ├── SDWebImageManager.m
│ │ ├── SDWebImageOperation.h
│ │ ├── SDWebImagePrefetcher.h
│ │ ├── SDWebImagePrefetcher.m
│ │ ├── SDWebImageWebPCoder.h
│ │ ├── SDWebImageWebPCoder.m
│ │ ├── UIButton+WebCache.h
│ │ ├── UIButton+WebCache.m
│ │ ├── UIImage+ForceDecode.h
│ │ ├── UIImage+ForceDecode.m
│ │ ├── UIImage+GIF.h
│ │ ├── UIImage+GIF.m
│ │ ├── UIImage+MultiFormat.h
│ │ ├── UIImage+MultiFormat.m
│ │ ├── UIImage+WebP.h
│ │ ├── UIImage+WebP.m
│ │ ├── UIImageView+HighlightedWebCache.h
│ │ ├── UIImageView+HighlightedWebCache.m
│ │ ├── UIImageView+WebCache.h
│ │ ├── UIImageView+WebCache.m
│ │ ├── UIView+WebCache.h
│ │ ├── UIView+WebCache.m
│ │ ├── UIView+WebCacheOperation.h
│ │ └── UIView+WebCacheOperation.m
├── Target Support Files
│ ├── Pods-News_coretText
│ │ ├── Pods-News_coretText-acknowledgements.markdown
│ │ ├── Pods-News_coretText-acknowledgements.plist
│ │ ├── Pods-News_coretText-dummy.m
│ │ ├── Pods-News_coretText-frameworks.sh
│ │ ├── Pods-News_coretText-resources.sh
│ │ ├── Pods-News_coretText.debug.xcconfig
│ │ └── Pods-News_coretText.release.xcconfig
│ ├── SDWebImage
│ │ ├── SDWebImage-dummy.m
│ │ ├── SDWebImage-prefix.pch
│ │ └── SDWebImage.xcconfig
│ └── libwebp
│ │ ├── libwebp-dummy.m
│ │ ├── libwebp-prefix.pch
│ │ └── libwebp.xcconfig
└── libwebp
│ ├── COPYING
│ ├── README
│ ├── README.mux
│ └── src
│ ├── dec
│ ├── alpha_dec.c
│ ├── alphai_dec.h
│ ├── buffer_dec.c
│ ├── common_dec.h
│ ├── frame_dec.c
│ ├── idec_dec.c
│ ├── io_dec.c
│ ├── quant_dec.c
│ ├── tree_dec.c
│ ├── vp8_dec.c
│ ├── vp8_dec.h
│ ├── vp8i_dec.h
│ ├── vp8l_dec.c
│ ├── vp8li_dec.h
│ ├── webp_dec.c
│ └── webpi_dec.h
│ ├── demux
│ ├── anim_decode.c
│ └── demux.c
│ ├── dsp
│ ├── alpha_processing.c
│ ├── alpha_processing_mips_dsp_r2.c
│ ├── alpha_processing_neon.c
│ ├── alpha_processing_sse2.c
│ ├── alpha_processing_sse41.c
│ ├── argb.c
│ ├── argb_mips_dsp_r2.c
│ ├── argb_sse2.c
│ ├── common_sse2.h
│ ├── cost.c
│ ├── cost_mips32.c
│ ├── cost_mips_dsp_r2.c
│ ├── cost_sse2.c
│ ├── cpu.c
│ ├── dec.c
│ ├── dec_clip_tables.c
│ ├── dec_mips32.c
│ ├── dec_mips_dsp_r2.c
│ ├── dec_msa.c
│ ├── dec_neon.c
│ ├── dec_sse2.c
│ ├── dec_sse41.c
│ ├── dsp.h
│ ├── enc.c
│ ├── enc_avx2.c
│ ├── enc_mips32.c
│ ├── enc_mips_dsp_r2.c
│ ├── enc_msa.c
│ ├── enc_neon.c
│ ├── enc_sse2.c
│ ├── enc_sse41.c
│ ├── filters.c
│ ├── filters_mips_dsp_r2.c
│ ├── filters_msa.c
│ ├── filters_neon.c
│ ├── filters_sse2.c
│ ├── lossless.c
│ ├── lossless.h
│ ├── lossless_common.h
│ ├── lossless_enc.c
│ ├── lossless_enc_mips32.c
│ ├── lossless_enc_mips_dsp_r2.c
│ ├── lossless_enc_msa.c
│ ├── lossless_enc_neon.c
│ ├── lossless_enc_sse2.c
│ ├── lossless_enc_sse41.c
│ ├── lossless_mips_dsp_r2.c
│ ├── lossless_msa.c
│ ├── lossless_neon.c
│ ├── lossless_sse2.c
│ ├── mips_macro.h
│ ├── msa_macro.h
│ ├── neon.h
│ ├── rescaler.c
│ ├── rescaler_mips32.c
│ ├── rescaler_mips_dsp_r2.c
│ ├── rescaler_msa.c
│ ├── rescaler_neon.c
│ ├── rescaler_sse2.c
│ ├── upsampling.c
│ ├── upsampling_mips_dsp_r2.c
│ ├── upsampling_msa.c
│ ├── upsampling_neon.c
│ ├── upsampling_sse2.c
│ ├── yuv.c
│ ├── yuv.h
│ ├── yuv_mips32.c
│ ├── yuv_mips_dsp_r2.c
│ └── yuv_sse2.c
│ ├── enc
│ ├── alpha_enc.c
│ ├── analysis_enc.c
│ ├── backward_references_enc.c
│ ├── backward_references_enc.h
│ ├── config_enc.c
│ ├── cost_enc.c
│ ├── cost_enc.h
│ ├── delta_palettization_enc.c
│ ├── delta_palettization_enc.h
│ ├── filter_enc.c
│ ├── frame_enc.c
│ ├── histogram_enc.c
│ ├── histogram_enc.h
│ ├── iterator_enc.c
│ ├── near_lossless_enc.c
│ ├── picture_csp_enc.c
│ ├── picture_enc.c
│ ├── picture_psnr_enc.c
│ ├── picture_rescale_enc.c
│ ├── picture_tools_enc.c
│ ├── predictor_enc.c
│ ├── quant_enc.c
│ ├── syntax_enc.c
│ ├── token_enc.c
│ ├── tree_enc.c
│ ├── vp8i_enc.h
│ ├── vp8l_enc.c
│ ├── vp8li_enc.h
│ └── webp_enc.c
│ ├── mux
│ ├── anim_encode.c
│ ├── animi.h
│ ├── muxedit.c
│ ├── muxi.h
│ ├── muxinternal.c
│ └── muxread.c
│ ├── utils
│ ├── bit_reader_inl_utils.h
│ ├── bit_reader_utils.c
│ ├── bit_reader_utils.h
│ ├── bit_writer_utils.c
│ ├── bit_writer_utils.h
│ ├── color_cache_utils.c
│ ├── color_cache_utils.h
│ ├── endian_inl_utils.h
│ ├── filters_utils.c
│ ├── filters_utils.h
│ ├── huffman_encode_utils.c
│ ├── huffman_encode_utils.h
│ ├── huffman_utils.c
│ ├── huffman_utils.h
│ ├── quant_levels_dec_utils.c
│ ├── quant_levels_dec_utils.h
│ ├── quant_levels_utils.c
│ ├── quant_levels_utils.h
│ ├── random_utils.c
│ ├── random_utils.h
│ ├── rescaler_utils.c
│ ├── rescaler_utils.h
│ ├── thread_utils.c
│ ├── thread_utils.h
│ ├── utils.c
│ └── utils.h
│ └── webp
│ ├── decode.h
│ ├── demux.h
│ ├── encode.h
│ ├── format_constants.h
│ ├── mux.h
│ ├── mux_types.h
│ └── types.h
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/News_coretText.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/News_coretText.xcodeproj/project.xcworkspace/xcuserdata/dengweihao.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianliangyihou/News_coretText/e6ed4bfd93329b03003e9f618477daca3ef095d9/News_coretText.xcodeproj/project.xcworkspace/xcuserdata/dengweihao.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/News_coretText.xcodeproj/xcuserdata/dengweihao.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | News_coretText.xcscheme
8 |
9 | orderHint
10 | 3
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/News_coretText.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/News_coretText.xcworkspace/xcuserdata/dengweihao.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianliangyihou/News_coretText/e6ed4bfd93329b03003e9f618477daca3ef095d9/News_coretText.xcworkspace/xcuserdata/dengweihao.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/News_coretText.xcworkspace/xcuserdata/dengweihao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/News_coretText/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/News_coretText/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
22 |
23 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
39 |
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/News_coretText/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/News_coretText/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/News_coretText/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/News_coretText/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | NSAppTransportSecurity
45 |
46 | NSAllowsArbitraryLoads
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/News_coretText/LBAnalysis.h:
--------------------------------------------------------------------------------
1 | //
2 | // LBAnalysis.h
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface LBDrawModel :NSObject
12 | @property (nonatomic , assign)CGRect rect;
13 | @property (nonatomic , copy)NSString *name;
14 | @property (nonatomic , strong)UIView *view;
15 |
16 | @end
17 |
18 | @interface LBModel :NSObject
19 | @property (nonatomic , assign)CGFloat width;
20 | @property (nonatomic , assign)CGFloat ascent;
21 | @property (nonatomic , assign)CGFloat descent;
22 | @property (nonatomic , assign)CGFloat location;
23 | @property (nonatomic , assign)CGFloat height;
24 |
25 | @property (nonatomic , copy)NSString *name;
26 | @property (nonatomic , strong)UIView *view;
27 | @property (nonatomic , copy)NSString *urlString;
28 |
29 |
30 | @end
31 |
32 | @interface LBAnalysis : NSObject
33 | @property (nonatomic , copy)NSString *text;
34 | @property (nonatomic , strong,readonly)NSMutableAttributedString *muAttributeStr;
35 | @property (nonatomic , strong)NSMutableArray *models;
36 | @property (nonatomic , copy) void(^adjustFontBlock)(LBAnalysis *analysis,NSMutableAttributedString *muAttributeStr,NSMutableArray *models);
37 |
38 | - (void)adjustFontToLargeSize;
39 | - (void)adjustFontToMiddleSize;
40 | - (void)adjustFontToSmallSize;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/News_coretText/LBLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // LBLabel.h
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "LBAnalysis.h"
12 |
13 | @interface LBLabel : UIView
14 | @property (nonatomic , strong)NSMutableArray *drawModes;
15 | @property (nonatomic , assign)CTFrameRef ctFrame;
16 | @property (nonatomic , assign)CGFloat contentHeight;
17 |
18 | - (instancetype)initWithctFrame:(CTFrameRef)frame contentHeight:(CGFloat)contentHeight;
19 | @end
20 |
--------------------------------------------------------------------------------
/News_coretText/LBLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // LBLabel.m
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import "LBLabel.h"
10 |
11 | @implementation LBLabel
12 |
13 | - (instancetype)init
14 | {
15 | self = [super init];
16 | if (self) {
17 | self.drawModes = [[NSMutableArray alloc]init];
18 | }
19 | return self;
20 | }
21 |
22 | - (instancetype)initWithctFrame:(CTFrameRef)frame contentHeight:(CGFloat)contentHeight
23 | {
24 | LBLabel *label = [[LBLabel alloc]init];
25 | label.ctFrame = frame;
26 | label.contentHeight = contentHeight;
27 | return label;
28 | }
29 | - (void)drawRect:(CGRect)rect {
30 | CGContextRef context = UIGraphicsGetCurrentContext();
31 | CGContextSetTextMatrix(context, CGAffineTransformIdentity);
32 | CGContextTranslateCTM(context, 0,rect.size.height);
33 | CGContextScaleCTM(context, 1.0, -1.0);
34 | CTFrameDraw(self.ctFrame, context);
35 |
36 | for (LBDrawModel *model in self.drawModes) {
37 | CGAffineTransform transform = CGAffineTransformScale(CGAffineTransformMakeTranslation(0, self.contentHeight), 1.f, -1.f);
38 | rect = CGRectApplyAffineTransform(model.rect, transform);
39 | model.view.frame = rect;
40 | if ([model.view isKindOfClass:[UIButton class]]) model.view.backgroundColor = self.backgroundColor;
41 | [self addSubview:model.view];
42 | }
43 | }
44 | @end
45 |
--------------------------------------------------------------------------------
/News_coretText/LBScrollView.h:
--------------------------------------------------------------------------------
1 | //
2 | // LBScrollView.h
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LBAnalysis.h"
11 | #import "LBLabel.h"
12 | @interface LBScrollView : UIScrollView
13 | @property (nonatomic , weak)LBLabel *label;
14 |
15 | - (void)buildFramesWithAttributeString:(NSAttributedString *)attr andModels:(NSArray *)models;
16 | - (void)resetScrollView;
17 | @end
18 |
--------------------------------------------------------------------------------
/News_coretText/UIImage+LBDecoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Decoder.h
3 | // test
4 | //
5 | // Created by dengweihao on 2017/8/23.
6 | // Copyright © 2017年 llb. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIImage (LBDecoder)
12 |
13 | + (UIImage *)sdOverdue_animatedGIFWithData:(NSData *)data;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/News_coretText/UIImage+LBDecoder.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+Decoder.m
3 | // test
4 | //
5 | // Created by dengweihao on 2017/8/23.
6 | // Copyright © 2017年 dengweihao. All rights reserved.
7 | //
8 |
9 | #import "UIImage+LBDecoder.h"
10 | #import
11 |
12 |
13 |
14 | @implementation UIImage (LBDecoder)
15 |
16 | // 高内存 低cpu --> 对较大的gif图片来说 内存会很大
17 | + (UIImage *)sdOverdue_animatedGIFWithData:(NSData *)data {
18 | if (!data) {
19 | return nil;
20 | }
21 |
22 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
23 |
24 | size_t count = CGImageSourceGetCount(source);
25 |
26 | UIImage *animatedImage;
27 |
28 | if (count <= 1) {
29 | animatedImage = [[UIImage alloc] initWithData:data];
30 | }
31 | else {
32 | NSMutableArray *images = [NSMutableArray array];
33 |
34 | NSTimeInterval duration = 0.0f;
35 |
36 | for (size_t i = 0; i < count; i++) {
37 | CGImageRef image = CGImageSourceCreateImageAtIndex(source, i, NULL);
38 |
39 | duration += [self sdOverdue_frameDurationAtIndex:i source:source];
40 |
41 | [images addObject:[UIImage imageWithCGImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]];
42 |
43 | CGImageRelease(image);
44 | }
45 |
46 | if (!duration) {
47 | duration = (1.0f / 10.0f) * count;
48 | }
49 |
50 | animatedImage = [UIImage animatedImageWithImages:images duration:duration];
51 | }
52 |
53 | CFRelease(source);
54 |
55 | return animatedImage;
56 | }
57 |
58 | + (float)sdOverdue_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
59 | float frameDuration = 0.1f;
60 | CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
61 | NSDictionary *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
62 | NSDictionary *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
63 |
64 | NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
65 | if (delayTimeUnclampedProp) {
66 | frameDuration = [delayTimeUnclampedProp floatValue];
67 | }
68 | else {
69 |
70 | NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
71 | if (delayTimeProp) {
72 | frameDuration = [delayTimeProp floatValue];
73 | }
74 | }
75 |
76 | if (frameDuration < 0.011f) {
77 | frameDuration = 0.100f;
78 | }
79 | CFRelease(cfFrameProperties);
80 |
81 | return frameDuration;
82 | }
83 |
84 | @end
85 |
--------------------------------------------------------------------------------
/News_coretText/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/News_coretText/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "LBScrollView.h"
11 | #import "LBAnalysis.h"
12 | @interface ViewController ()
13 |
14 | @property (nonatomic , strong)LBAnalysis *ay;
15 | @property (nonatomic , weak)UIScrollView *sc;
16 |
17 | @end
18 |
19 | @implementation ViewController
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 | self.title = @"CoreText";
24 | self.automaticallyAdjustsScrollViewInsets = NO;
25 | CGRect screenBounds = [UIScreen mainScreen].bounds;
26 | LBScrollView *sc = [[LBScrollView alloc]initWithFrame:CGRectMake(0, 64, screenBounds.size.width, screenBounds.size.height - 64)];
27 | [self.view addSubview:sc];
28 |
29 | NSString *path = [[NSBundle mainBundle]pathForResource:@"lb.txt" ofType:nil];
30 | NSString *resource = [[NSString alloc]initWithContentsOfFile:path encoding:4 error:nil];
31 | LBAnalysis *ay = [[LBAnalysis alloc]init];
32 | ay.text = resource;
33 | _ay = ay;
34 | [ay setAdjustFontBlock:^(LBAnalysis *analysis, NSMutableAttributedString *muAttributeStr, NSMutableArray *models) {
35 | [sc resetScrollView];
36 | [sc buildFramesWithAttributeString:muAttributeStr andModels:models];
37 | }];
38 | [sc buildFramesWithAttributeString:ay.muAttributeStr andModels:ay.models];
39 | sc.tag = 0;
40 | _sc = sc;
41 | }
42 |
43 |
44 | - (IBAction)btnClick:(UIBarButtonItem *)sender {
45 | _sc.tag = _sc.tag == 0? 1 : 0;
46 | UIColor *color = [UIColor colorWithRed:0.6 green:0.81 blue:0.86 alpha:1.0];
47 | if (_sc.tag == 0) {
48 | color = [UIColor whiteColor];
49 | }
50 | _sc.backgroundColor = color;
51 | for (UIView *view in _sc.subviews) {
52 | if ([view isKindOfClass:[LBLabel class]]) {
53 | view.backgroundColor = color;
54 | }
55 | }
56 | }
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/News_coretText/cat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tianliangyihou/News_coretText/e6ed4bfd93329b03003e9f618477daca3ef095d9/News_coretText/cat.jpg
--------------------------------------------------------------------------------
/News_coretText/lb.txt:
--------------------------------------------------------------------------------
1 | 关于你,我有太多东西关于你
2 |
3 | 作者:碎叶写给他的英雄 来源:文章阅读网
4 |
5 | 时间:2017-09-22 16:17 阅读:43048 字体大小: [小] [中] [大]
6 |
7 | 关于你
8 |
9 | 关于你,我有太多东西关于你。
10 |
11 | 清醒的时候放不下矜持,不敢说我喜欢你,只有在某个夜晚多愁善感又萦绕在心头,或是朋友聚会上的大醉,才敢借着情绪说,我喜欢你,喜欢了好久好久。
12 |
13 | 关于你,2012年的九月,那是我们认识的季节,在四十多平米的教室里,我认识了你。我们是同学,彼此都还不熟悉的同学。那一句个子还高嘛,是我关注你的开始,有意无意的从四组向一组瞟你,小心翼翼的眼神怕你发现,却又怕你不明白,一点点的喜欢不敢声张。后来的打过来骂过去,后来聊天的默契,互道的晚安,才明白原来就是喜欢,没有其他。确定是喜欢,可是还是不敢声张。只因当初在人群中你说了一句,从此,你便住在了心里。不敢轻易靠近打扰,是怕自己扰了你的生活步调;不敢轻易对你开口言爱,是怕那样做是一种冒犯,是一种伤害我们关系的因素。http://p3.pstatp.com/large/w960/532100012cafac577bf6
14 | 关于你。就是因为我的害怕,我亲眼看你走向她。我喜欢你是事实,你有女朋友也是事实。我以为我不说出口就会保持这样的朋友关系,却还是她赶了个巧,那应该是个寒假,你有女朋友了,我还是听说,我那么爱,却还是无果。于是我和她之间就莫名其妙的就多少有了敌人的感觉,或许就是别人口中的那样,世界上完全不相干的两个女人,会因为一个男人要么很友好,要么是仇恨。关于她我做不到友好,但也不是仇恨,只是你选择了她,我就希望她好好爱你,照顾你,连我的份也一起爱了。自爱上你的那天起,思念便成了戒不掉的瘾。你的一言一笑,一颦一蹙,无不牵动我的心,百千尘思,唯念一缕;万千红颜,唯恋一人。我愿意一生漂泊浪迹在你的故事里,甘愿为你鞍前马后,马首是瞻,即使你从未给我一句承诺,即使你从未给我半分爱情,依然无悔无怨。
15 |
16 | 关于你。一场高考,考散了我们,毕业了会不会就是终生最后一见,很高兴,我们不是。各奔东西了,你们继续上了大学,值得欣慰的是,你们也是异地,这样不能算是我心机,只能说是恰巧,你们的安排恰合我意。后来也有听说,她从她的城市去看你,而那时的我能说什么呢。她是真心爱你,这是事实。http://p7.pstatp.com/large/w960/532300012072044452cb我也曾和闺蜜说过,一生至少该有一次,为了某个人而忘了自己,不求有结果,不求同行,不求曾经拥有,甚至不求你爱我,只求在我最美的年华里,遇到你。今生遇见你,我觉得是幸福的,尽管这幸福交杂着万般痛苦。我也曾幻想着悄悄地去到你的学校,在某个阳光明媚的下午,在你去教室的路上和你来场偶遇,精心准备的偶遇,。可是我还来不及去和你偶遇,你们就毕了业。爱是种很玄的东西,说不清,道不明,剪不断,理还乱。世上,有种爱明知没有结果,却依然坚守原地,不舍离去,哪怕握不住你的一丝余温,依然选择默默为你守候。一路来去,心门只为你独开,山城只为你独驻,白天只为你旖旎,黑夜只为你流连。因为爱你,哪怕心入住荒岛,还是会以最深情的眼神,看着你幸福。
17 |
18 | 关于你。一次聊天,我说我要回家了,你说你也要回家了,我没有想过在这个季节,我们会同在我们的城市,可是即使我们在同一个城市又怎样,最远的距离就是,我们在同一个城市却感觉离得如此遥远。突然听说你们分手了,我心里的感觉就连我自己也说不出来,我本应该高兴,可我却高兴不起来,四年,你们一路走来有分有和,算是真爱,为什么我会高兴不起来,大概是已经习惯了默默地喜欢着你,不求结果。我们也有说过要约,那晚终于约了,见面第一眼,真的此时的心情,我是很激动的,有欢喜的成分,也有些担心,担心的是我怕我不能把我最好的状态展现给你,更多的还是感动,能和你并肩走着,是上学时我想都不敢想的事情。如果我是风中的叶子,便希望能以最美的姿态落下,因为不想让你看到我的忧伤,也许是这世上的美,都有些苍凉,缘是云水深处无言的守候,是一纸素笺的暖,是光阴写意最美的诗行。我们围着公园绕了一圈,原以为会尴尬,会词穷,可是你一句我一句,我们沐浴在晚风中,我是享受这样的感觉,直到你送我到楼下,你要离开,多想给你一个拥抱,把我有多爱你告诉你。可是我还是没有,只是默默看着你离开的背影,在黑夜慢慢远去直到消失在拐角处。我多么希望,你能懂我沉默,懂我无声,懂我的欲言又止。有时你看不见我,是因为我悄悄藏在了你身后;有时你听不见我,是因为我偷偷用静默伪装了自己。其实我害怕寂寞,但却因为你会让自己陷进很深的寂寞;其实也害怕孤独,但因为你山高水远,而我又无能为力。纵然你有万事牵绊,只要你需要,我一定会义无反顾。
19 |
20 | 关于你。你说你要去当兵了,其实心里是一些欢喜,因为在部队,你可能不会喜欢上别人,而我就想抱着这种侥幸的心理等你,脱开了别人的束缚,不知道这次我算不算迟到,告诉你,我喜欢你,告诉你,我会等你,等你回来。你走的时候我可能不会去送你,但是你要告诉我你在哪个城市,我会去看你。
21 |
22 | 人生,有多少别离,就会有多少相逢,喧嚣的尘世,总有一些孤独的灵魂,走在寂寞的路上,爱你,便是一缕暗香,穿过茫茫人海,幽幽而来,如花间清露,润人心田。它静静地流淌在光阴中,让相见或不见,天涯或咫尺,都变成一场欣喜和期待。因为爱你,岁月,将不再写意迷茫;因为爱你,人生将不再枯燥;因为爱你,所有的千回百转都是值得。
23 |
24 | 关于你,我的岁月都关于你,从前是,现在是,以后是。
25 |
--------------------------------------------------------------------------------
/News_coretText/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // News_coretText
4 | //
5 | // Created by dengweihao on 2018/2/6.
6 | // Copyright © 2018年 vcyber. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment the next line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | target 'News_coretText' do
5 | pod 'SDWebImage'
6 | pod 'SDWebImage/WebP'
7 |
8 | end
9 |
--------------------------------------------------------------------------------
/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - libwebp (0.6.0):
3 | - libwebp/core (= 0.6.0)
4 | - libwebp/dec (= 0.6.0)
5 | - libwebp/demux (= 0.6.0)
6 | - libwebp/dsp (= 0.6.0)
7 | - libwebp/enc (= 0.6.0)
8 | - libwebp/mux (= 0.6.0)
9 | - libwebp/utils (= 0.6.0)
10 | - libwebp/webp (= 0.6.0)
11 | - libwebp/core (0.6.0):
12 | - libwebp/webp
13 | - libwebp/dec (0.6.0):
14 | - libwebp/core
15 | - libwebp/demux (0.6.0):
16 | - libwebp/core
17 | - libwebp/dsp (0.6.0):
18 | - libwebp/core
19 | - libwebp/enc (0.6.0):
20 | - libwebp/core
21 | - libwebp/mux (0.6.0):
22 | - libwebp/core
23 | - libwebp/utils (0.6.0):
24 | - libwebp/core
25 | - libwebp/webp (0.6.0)
26 | - SDWebImage (4.2.2):
27 | - SDWebImage/Core (= 4.2.2)
28 | - SDWebImage/Core (4.2.2)
29 | - SDWebImage/WebP (4.2.2):
30 | - libwebp
31 | - SDWebImage/Core
32 |
33 | DEPENDENCIES:
34 | - SDWebImage
35 | - SDWebImage/WebP
36 |
37 | SPEC CHECKSUMS:
38 | libwebp: 1d5a07c2eb97f9c31bd5f154bb82efc0ea67c6a2
39 | SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198
40 |
41 | PODFILE CHECKSUM: cd685b910c5e569e1492c724abc4c086bfc7b842
42 |
43 | COCOAPODS: 1.3.1
44 |
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageCoderHelper.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageCodersManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageFrame.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageGIFCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageImageIOCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/SDWebImageWebPCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageWebPCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImage+ForceDecode.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImage+WebP.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+WebP.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/alphai_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/alphai_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/animi.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/mux/animi.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/backward_references_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/backward_references_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/bit_reader_inl_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_reader_inl_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/bit_reader_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_reader_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/bit_writer_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_writer_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/color_cache_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/color_cache_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/common_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/common_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/common_sse2.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/common_sse2.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/cost_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/cost_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/delta_palettization_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/delta_palettization_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/dsp.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/dsp.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/endian_inl_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/endian_inl_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/filters_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/filters_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/histogram_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/histogram_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/huffman_encode_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/huffman_encode_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/huffman_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/huffman_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/lossless.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/lossless.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/lossless_common.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/lossless_common.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/mips_macro.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/mips_macro.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/msa_macro.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/msa_macro.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/muxi.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/mux/muxi.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/neon.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/neon.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/quant_levels_dec_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/quant_levels_dec_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/quant_levels_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/quant_levels_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/random_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/random_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/rescaler_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/rescaler_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/thread_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/thread_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/vp8_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/vp8i_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8i_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/vp8i_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/vp8i_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/vp8li_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8li_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/vp8li_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/vp8li_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/decode.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/decode.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/demux.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/demux.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/encode.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/encode.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/format_constants.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/format_constants.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/mux.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/mux.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/mux_types.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/mux_types.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webp/types.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/types.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/webpi_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/webpi_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Private/libwebp/yuv.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/yuv.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDImageCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageCoderHelper.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageCodersManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageFrame.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageGIFCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageImageIOCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageManager.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/SDWebImageWebPCoder.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/SDWebImageWebPCoder.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImage+ForceDecode.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImage+WebP.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImage+WebP.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIView+WebCache.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/alphai_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/alphai_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/animi.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/mux/animi.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/backward_references_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/backward_references_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/bit_reader_inl_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_reader_inl_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/bit_reader_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_reader_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/bit_writer_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/bit_writer_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/color_cache_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/color_cache_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/common_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/common_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/common_sse2.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/common_sse2.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/cost_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/cost_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/delta_palettization_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/delta_palettization_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/dsp.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/dsp.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/endian_inl_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/endian_inl_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/filters_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/filters_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/histogram_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/histogram_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/huffman_encode_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/huffman_encode_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/huffman_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/huffman_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/lossless.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/lossless.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/lossless_common.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/lossless_common.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/mips_macro.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/mips_macro.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/msa_macro.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/msa_macro.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/muxi.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/mux/muxi.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/neon.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/neon.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/quant_levels_dec_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/quant_levels_dec_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/quant_levels_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/quant_levels_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/random_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/random_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/rescaler_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/rescaler_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/thread_utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/thread_utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/utils.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/utils/utils.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/vp8_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/vp8i_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8i_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/vp8i_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/vp8i_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/vp8li_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/vp8li_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/vp8li_enc.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/enc/vp8li_enc.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/decode.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/decode.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/demux.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/demux.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/encode.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/encode.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/format_constants.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/format_constants.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/mux.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/mux.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/mux_types.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/mux_types.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webp/types.h:
--------------------------------------------------------------------------------
1 | ../../../../libwebp/src/webp/types.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/webpi_dec.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dec/webpi_dec.h
--------------------------------------------------------------------------------
/Pods/Headers/Public/libwebp/yuv.h:
--------------------------------------------------------------------------------
1 | ../../../libwebp/src/dsp/yuv.h
--------------------------------------------------------------------------------
/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - libwebp (0.6.0):
3 | - libwebp/core (= 0.6.0)
4 | - libwebp/dec (= 0.6.0)
5 | - libwebp/demux (= 0.6.0)
6 | - libwebp/dsp (= 0.6.0)
7 | - libwebp/enc (= 0.6.0)
8 | - libwebp/mux (= 0.6.0)
9 | - libwebp/utils (= 0.6.0)
10 | - libwebp/webp (= 0.6.0)
11 | - libwebp/core (0.6.0):
12 | - libwebp/webp
13 | - libwebp/dec (0.6.0):
14 | - libwebp/core
15 | - libwebp/demux (0.6.0):
16 | - libwebp/core
17 | - libwebp/dsp (0.6.0):
18 | - libwebp/core
19 | - libwebp/enc (0.6.0):
20 | - libwebp/core
21 | - libwebp/mux (0.6.0):
22 | - libwebp/core
23 | - libwebp/utils (0.6.0):
24 | - libwebp/core
25 | - libwebp/webp (0.6.0)
26 | - SDWebImage (4.2.2):
27 | - SDWebImage/Core (= 4.2.2)
28 | - SDWebImage/Core (4.2.2)
29 | - SDWebImage/WebP (4.2.2):
30 | - libwebp
31 | - SDWebImage/Core
32 |
33 | DEPENDENCIES:
34 | - SDWebImage
35 | - SDWebImage/WebP
36 |
37 | SPEC CHECKSUMS:
38 | libwebp: 1d5a07c2eb97f9c31bd5f154bb82efc0ea67c6a2
39 | SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198
40 |
41 | PODFILE CHECKSUM: cd685b910c5e569e1492c724abc4c086bfc7b842
42 |
43 | COCOAPODS: 1.3.1
44 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/dengweihao.xcuserdatad/xcschemes/Pods-News_coretText.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/dengweihao.xcuserdatad/xcschemes/SDWebImage.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/dengweihao.xcuserdatad/xcschemes/libwebp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Pods/Pods.xcodeproj/xcuserdata/dengweihao.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Pods-News_coretText.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 1
13 |
14 | SDWebImage.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 2
20 |
21 | libwebp.xcscheme
22 |
23 | isShown
24 |
25 | orderHint
26 | 0
27 |
28 |
29 | SuppressBuildableAutocreation
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is furnished
8 | to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Fabrice Aneche
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 | #import "SDWebImageCompat.h"
12 |
13 | typedef NS_ENUM(NSInteger, SDImageFormat) {
14 | SDImageFormatUndefined = -1,
15 | SDImageFormatJPEG = 0,
16 | SDImageFormatPNG,
17 | SDImageFormatGIF,
18 | SDImageFormatTIFF,
19 | SDImageFormatWebP,
20 | SDImageFormatHEIC
21 | };
22 |
23 | @interface NSData (ImageContentType)
24 |
25 | /**
26 | * Return image format
27 | *
28 | * @param data the input image data
29 | *
30 | * @return the image format as `SDImageFormat` (enum)
31 | */
32 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data;
33 |
34 | /**
35 | Convert SDImageFormat to UTType
36 |
37 | @param format Format as SDImageFormat
38 | @return The UTType as CFStringRef
39 | */
40 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Fabrice Aneche
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "NSData+ImageContentType.h"
11 | #if SD_MAC
12 | #import
13 | #else
14 | #import
15 | #endif
16 |
17 | // Currently Image/IO does not support WebP
18 | #define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp")
19 | // AVFileTypeHEIC is defined in AVFoundation via iOS 11, we use this without import AVFoundation
20 | #define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic")
21 |
22 | @implementation NSData (ImageContentType)
23 |
24 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data {
25 | if (!data) {
26 | return SDImageFormatUndefined;
27 | }
28 |
29 | // File signatures table: http://www.garykessler.net/library/file_sigs.html
30 | uint8_t c;
31 | [data getBytes:&c length:1];
32 | switch (c) {
33 | case 0xFF:
34 | return SDImageFormatJPEG;
35 | case 0x89:
36 | return SDImageFormatPNG;
37 | case 0x47:
38 | return SDImageFormatGIF;
39 | case 0x49:
40 | case 0x4D:
41 | return SDImageFormatTIFF;
42 | case 0x52: {
43 | if (data.length >= 12) {
44 | //RIFF....WEBP
45 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
46 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
47 | return SDImageFormatWebP;
48 | }
49 | }
50 | break;
51 | }
52 | case 0x00: {
53 | if (data.length >= 12) {
54 | //....ftypheic ....ftypheix ....ftyphevc ....ftyphevx
55 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(4, 8)] encoding:NSASCIIStringEncoding];
56 | if ([testString isEqualToString:@"ftypheic"]
57 | || [testString isEqualToString:@"ftypheix"]
58 | || [testString isEqualToString:@"ftyphevc"]
59 | || [testString isEqualToString:@"ftyphevx"]) {
60 | return SDImageFormatHEIC;
61 | }
62 | }
63 | break;
64 | }
65 | }
66 | return SDImageFormatUndefined;
67 | }
68 |
69 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format {
70 | CFStringRef UTType;
71 | switch (format) {
72 | case SDImageFormatJPEG:
73 | UTType = kUTTypeJPEG;
74 | break;
75 | case SDImageFormatPNG:
76 | UTType = kUTTypePNG;
77 | break;
78 | case SDImageFormatGIF:
79 | UTType = kUTTypeGIF;
80 | break;
81 | case SDImageFormatTIFF:
82 | UTType = kUTTypeTIFF;
83 | break;
84 | case SDImageFormatWebP:
85 | UTType = kSDUTTypeWebP;
86 | break;
87 | case SDImageFormatHEIC:
88 | UTType = kSDUTTypeHEIC;
89 | break;
90 | default:
91 | // default is kUTTypePNG
92 | UTType = kUTTypePNG;
93 | break;
94 | }
95 | return UTType;
96 | }
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if SD_MAC
12 |
13 | #import
14 |
15 | @interface NSImage (WebCache)
16 |
17 | - (CGImageRef)CGImage;
18 | - (NSArray *)images;
19 | - (BOOL)isGIF;
20 |
21 | @end
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "NSImage+WebCache.h"
10 |
11 | #if SD_MAC
12 |
13 | @implementation NSImage (WebCache)
14 |
15 | - (CGImageRef)CGImage {
16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height);
17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil];
18 | return cgImage;
19 | }
20 |
21 | - (NSArray *)images {
22 | return nil;
23 | }
24 |
25 | - (BOOL)isGIF {
26 | BOOL isGIF = NO;
27 | for (NSImageRep *rep in self.representations) {
28 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) {
29 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep;
30 | NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue];
31 | isGIF = frameCount > 1 ? YES : NO;
32 | break;
33 | }
34 | }
35 | return isGIF;
36 | }
37 |
38 | @end
39 |
40 | #endif
41 |
42 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 |
12 | @interface SDImageCacheConfig : NSObject
13 |
14 | /**
15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory.
16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption.
17 | */
18 | @property (assign, nonatomic) BOOL shouldDecompressImages;
19 |
20 | /**
21 | * disable iCloud backup [defaults to YES]
22 | */
23 | @property (assign, nonatomic) BOOL shouldDisableiCloud;
24 |
25 | /**
26 | * use memory cache [defaults to YES]
27 | */
28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory;
29 |
30 | /**
31 | * The reading options while reading cache from disk.
32 | * Defaults to 0. You can set this to mapped file to improve performance.
33 | */
34 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions;
35 |
36 | /**
37 | * The maximum length of time to keep an image in the cache, in seconds.
38 | */
39 | @property (assign, nonatomic) NSInteger maxCacheAge;
40 |
41 | /**
42 | * The maximum size of the cache, in bytes.
43 | */
44 | @property (assign, nonatomic) NSUInteger maxCacheSize;
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDImageCacheConfig.h"
10 |
11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
12 |
13 | @implementation SDImageCacheConfig
14 |
15 | - (instancetype)init {
16 | if (self = [super init]) {
17 | _shouldDecompressImages = YES;
18 | _shouldDisableiCloud = YES;
19 | _shouldCacheImagesInMemory = YES;
20 | _diskCacheReadingOptions = 0;
21 | _maxCacheAge = kDefaultCacheMaxCacheAge;
22 | _maxCacheSize = 0;
23 | }
24 | return self;
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCoder.h"
10 |
11 | NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages";
12 |
13 | CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) {
14 | static CGColorSpaceRef colorSpace;
15 | static dispatch_once_t onceToken;
16 | dispatch_once(&onceToken, ^{
17 | colorSpace = CGColorSpaceCreateDeviceRGB();
18 | });
19 | return colorSpace;
20 | }
21 |
22 | BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) {
23 | if (!imageRef) {
24 | return NO;
25 | }
26 | CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef);
27 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone ||
28 | alphaInfo == kCGImageAlphaNoneSkipFirst ||
29 | alphaInfo == kCGImageAlphaNoneSkipLast);
30 | return hasAlpha;
31 | }
32 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 | #import "SDWebImageFrame.h"
12 |
13 | @interface SDWebImageCoderHelper : NSObject
14 |
15 | /**
16 | Return an animated image with frames array.
17 | For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the averate of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work.
18 | For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering.
19 |
20 | @param frames The frames array. If no frames or frames is empty, return nil
21 | @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit)
22 | */
23 | + (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames;
24 |
25 | /**
26 | Return frames array from an animated image.
27 | For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage.
28 | For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array.
29 |
30 | @param animatedImage A animated image. If it's not animated, return nil
31 | @return The frames array
32 | */
33 | + (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage;
34 |
35 | #if SD_UIKIT || SD_WATCH
36 | /**
37 | Convert an EXIF image orientation to an iOS one.
38 |
39 | @param exifOrientation EXIF orientation
40 | @return iOS orientation
41 | */
42 | + (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation;
43 | /**
44 | Convert an iOS orientation to an EXIF image orientation.
45 |
46 | @param imageOrientation iOS orientation
47 | @return EXIF orientation
48 | */
49 | + (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation;
50 | #endif
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCoder.h"
11 |
12 | /**
13 | Global object holding the array of coders, so that we avoid passing them from object to object.
14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority.
15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data.
16 | That way, users can add their custom coders while preserving our existing prebuilt ones
17 |
18 | Note: the `coders` getter will return the coders in their reversed order
19 | Example:
20 | - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`)
21 | - calling `coders` will return `@[WebPCoder, IOCoder]`
22 | - call `[addCoder:[MyCrazyCoder new]]`
23 | - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]`
24 |
25 | Coders
26 | ------
27 | A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding
28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat`
29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES.
30 | That means that coder can decode that data / encode to that format
31 | */
32 | @interface SDWebImageCodersManager : NSObject
33 |
34 | /**
35 | Shared reusable instance
36 | */
37 | + (nonnull instancetype)sharedInstance;
38 |
39 | /**
40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority
41 | */
42 | @property (nonatomic, strong, readwrite, nullable) NSArray* coders;
43 |
44 | /**
45 | Add a new coder to the end of coders array. Which has the highest priority.
46 |
47 | @param coder coder
48 | */
49 | - (void)addCoder:(nonnull id)coder;
50 |
51 | /**
52 | Remove a coder in the coders array.
53 |
54 | @param coder coder
55 | */
56 | - (void)removeCoder:(nonnull id)coder;
57 |
58 | @end
59 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCodersManager.h"
10 | #import "SDWebImageImageIOCoder.h"
11 | #import "SDWebImageGIFCoder.h"
12 | #ifdef SD_WEBP
13 | #import "SDWebImageWebPCoder.h"
14 | #endif
15 |
16 | @interface SDWebImageCodersManager ()
17 |
18 | @property (nonatomic, strong, nonnull) NSMutableArray* mutableCoders;
19 | @property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue;
20 |
21 | @end
22 |
23 | @implementation SDWebImageCodersManager
24 |
25 | + (nonnull instancetype)sharedInstance {
26 | static dispatch_once_t once;
27 | static id instance;
28 | dispatch_once(&once, ^{
29 | instance = [self new];
30 | });
31 | return instance;
32 | }
33 |
34 | - (instancetype)init {
35 | if (self = [super init]) {
36 | // initialize with default coders
37 | _mutableCoders = [@[[SDWebImageImageIOCoder sharedCoder]] mutableCopy];
38 | #ifdef SD_WEBP
39 | [_mutableCoders addObject:[SDWebImageWebPCoder sharedCoder]];
40 | #endif
41 | _mutableCodersAccessQueue = dispatch_queue_create("com.hackemist.SDWebImageCodersManager", DISPATCH_QUEUE_CONCURRENT);
42 | }
43 | return self;
44 | }
45 |
46 | - (void)dealloc {
47 | SDDispatchQueueRelease(_mutableCodersAccessQueue);
48 | }
49 |
50 | #pragma mark - Coder IO operations
51 |
52 | - (void)addCoder:(nonnull id)coder {
53 | if ([coder conformsToProtocol:@protocol(SDWebImageCoder)]) {
54 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
55 | [self.mutableCoders addObject:coder];
56 | });
57 | }
58 | }
59 |
60 | - (void)removeCoder:(nonnull id)coder {
61 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
62 | [self.mutableCoders removeObject:coder];
63 | });
64 | }
65 |
66 | - (NSArray *)coders {
67 | __block NSArray *sortedCoders = nil;
68 | dispatch_sync(self.mutableCodersAccessQueue, ^{
69 | sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects];
70 | });
71 | return sortedCoders;
72 | }
73 |
74 | - (void)setCoders:(NSArray *)coders {
75 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
76 | self.mutableCoders = [coders mutableCopy];
77 | });
78 | }
79 |
80 | #pragma mark - SDWebImageCoder
81 | - (BOOL)canDecodeFromData:(NSData *)data {
82 | for (id coder in self.coders) {
83 | if ([coder canDecodeFromData:data]) {
84 | return YES;
85 | }
86 | }
87 | return NO;
88 | }
89 |
90 | - (BOOL)canEncodeToFormat:(SDImageFormat)format {
91 | for (id coder in self.coders) {
92 | if ([coder canEncodeToFormat:format]) {
93 | return YES;
94 | }
95 | }
96 | return NO;
97 | }
98 |
99 | - (UIImage *)decodedImageWithData:(NSData *)data {
100 | if (!data) {
101 | return nil;
102 | }
103 | for (id coder in self.coders) {
104 | if ([coder canDecodeFromData:data]) {
105 | return [coder decodedImageWithData:data];
106 | }
107 | }
108 | return nil;
109 | }
110 |
111 | - (UIImage *)decompressedImageWithImage:(UIImage *)image
112 | data:(NSData *__autoreleasing _Nullable *)data
113 | options:(nullable NSDictionary*)optionsDict {
114 | if (!image) {
115 | return nil;
116 | }
117 | for (id coder in self.coders) {
118 | if ([coder canDecodeFromData:*data]) {
119 | return [coder decompressedImageWithImage:image data:data options:optionsDict];
120 | }
121 | }
122 | return nil;
123 | }
124 |
125 | - (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format {
126 | if (!image) {
127 | return nil;
128 | }
129 | for (id coder in self.coders) {
130 | if ([coder canEncodeToFormat:format]) {
131 | return [coder encodedDataWithImage:image format:format];
132 | }
133 | }
134 | return nil;
135 | }
136 |
137 | @end
138 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCompat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Jamie Pinkham
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import
11 |
12 | #ifdef __OBJC_GC__
13 | #error SDWebImage does not support Objective-C Garbage Collection
14 | #endif
15 |
16 | // Apple's defines from TargetConditionals.h are a bit weird.
17 | // Seems like TARGET_OS_MAC is always defined (on all platforms).
18 | // To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms
19 | #if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH
20 | #define SD_MAC 1
21 | #else
22 | #define SD_MAC 0
23 | #endif
24 |
25 | // iOS and tvOS are very similar, UIKit exists on both platforms
26 | // Note: watchOS also has UIKit, but it's very limited
27 | #if TARGET_OS_IOS || TARGET_OS_TV
28 | #define SD_UIKIT 1
29 | #else
30 | #define SD_UIKIT 0
31 | #endif
32 |
33 | #if TARGET_OS_IOS
34 | #define SD_IOS 1
35 | #else
36 | #define SD_IOS 0
37 | #endif
38 |
39 | #if TARGET_OS_TV
40 | #define SD_TV 1
41 | #else
42 | #define SD_TV 0
43 | #endif
44 |
45 | #if TARGET_OS_WATCH
46 | #define SD_WATCH 1
47 | #else
48 | #define SD_WATCH 0
49 | #endif
50 |
51 |
52 | #if SD_MAC
53 | #import
54 | #ifndef UIImage
55 | #define UIImage NSImage
56 | #endif
57 | #ifndef UIImageView
58 | #define UIImageView NSImageView
59 | #endif
60 | #ifndef UIView
61 | #define UIView NSView
62 | #endif
63 | #else
64 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0
65 | #error SDWebImage doesn't support Deployment Target version < 5.0
66 | #endif
67 |
68 | #if SD_UIKIT
69 | #import
70 | #endif
71 | #if SD_WATCH
72 | #import
73 | #endif
74 | #endif
75 |
76 | #ifndef NS_ENUM
77 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
78 | #endif
79 |
80 | #ifndef NS_OPTIONS
81 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type
82 | #endif
83 |
84 | #if OS_OBJECT_USE_OBJC
85 | #undef SDDispatchQueueRelease
86 | #undef SDDispatchQueueSetterSementics
87 | #define SDDispatchQueueRelease(q)
88 | #define SDDispatchQueueSetterSementics strong
89 | #else
90 | #undef SDDispatchQueueRelease
91 | #undef SDDispatchQueueSetterSementics
92 | #define SDDispatchQueueRelease(q) (dispatch_release(q))
93 | #define SDDispatchQueueSetterSementics assign
94 | #endif
95 |
96 | FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image);
97 |
98 | typedef void(^SDWebImageNoParamsBlock)(void);
99 |
100 | FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain;
101 |
102 | #ifndef dispatch_queue_async_safe
103 | #define dispatch_queue_async_safe(queue, block)\
104 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\
105 | block();\
106 | } else {\
107 | dispatch_async(queue, block);\
108 | }
109 | #endif
110 |
111 | #ifndef dispatch_main_async_safe
112 | #define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block)
113 | #endif
114 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 | #import "UIImage+MultiFormat.h"
11 |
12 | #if !__has_feature(objc_arc)
13 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
14 | #endif
15 |
16 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) {
17 | if (!image) {
18 | return nil;
19 | }
20 |
21 | #if SD_MAC
22 | return image;
23 | #elif SD_UIKIT || SD_WATCH
24 | if ((image.images).count > 0) {
25 | NSMutableArray *scaledImages = [NSMutableArray array];
26 |
27 | for (UIImage *tempImage in image.images) {
28 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)];
29 | }
30 |
31 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration];
32 | if (animatedImage) {
33 | animatedImage.sd_imageLoopCount = image.sd_imageLoopCount;
34 | }
35 | return animatedImage;
36 | } else {
37 | #if SD_WATCH
38 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) {
39 | #elif SD_UIKIT
40 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
41 | #endif
42 | CGFloat scale = 1;
43 | if (key.length >= 8) {
44 | NSRange range = [key rangeOfString:@"@2x."];
45 | if (range.location != NSNotFound) {
46 | scale = 2.0;
47 | }
48 |
49 | range = [key rangeOfString:@"@3x."];
50 | if (range.location != NSNotFound) {
51 | scale = 3.0;
52 | }
53 | }
54 |
55 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation];
56 | image = scaledImage;
57 | }
58 | return image;
59 | }
60 | #endif
61 | }
62 |
63 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain";
64 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCompat.h"
11 |
12 | @interface SDWebImageFrame : NSObject
13 |
14 | // This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attension if you need animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat`
15 |
16 | /**
17 | The image of current frame. You should not set an animated image.
18 | */
19 | @property (nonatomic, strong, readonly, nonnull) UIImage *image;
20 | /**
21 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero.
22 | */
23 | @property (nonatomic, readonly, assign) NSTimeInterval duration;
24 |
25 | /**
26 | Create a frame instance with specify image and duration
27 |
28 | @param image current frame's image
29 | @param duration current frame's duration
30 | @return frame instance
31 | */
32 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageFrame.h"
10 |
11 | @interface SDWebImageFrame ()
12 |
13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image;
14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration;
15 |
16 | @end
17 |
18 | @implementation SDWebImageFrame
19 |
20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration {
21 | SDWebImageFrame *frame = [[SDWebImageFrame alloc] init];
22 | frame.image = image;
23 | frame.duration = duration;
24 |
25 | return frame;
26 | }
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCoder.h"
11 |
12 | /**
13 | Built in coder using ImageIO that supports GIF encoding/decoding
14 | @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame).
15 | @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage`
16 | @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder`
17 | @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying
18 | */
19 | @interface SDWebImageGIFCoder : NSObject
20 |
21 | + (nonnull instancetype)sharedCoder;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageCoder.h"
11 |
12 | /**
13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding.
14 |
15 | GIF
16 | Also supports static GIF (meaning will only handle the 1st frame).
17 | For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder`
18 |
19 | HEIC
20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices.
21 | Hardware works if: (iOS 11 || macOS 10.13) && (isMac || isIPhoneAndA10FusionChipAbove) && (!Simulator)
22 | */
23 | @interface SDWebImageImageIOCoder : NSObject
24 |
25 | + (nonnull instancetype)sharedCoder;
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 |
11 | @protocol SDWebImageOperation
12 |
13 | - (void)cancel;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import
10 | #import "SDWebImageManager.h"
11 |
12 | @class SDWebImagePrefetcher;
13 |
14 | @protocol SDWebImagePrefetcherDelegate
15 |
16 | @optional
17 |
18 | /**
19 | * Called when an image was prefetched.
20 | *
21 | * @param imagePrefetcher The current image prefetcher
22 | * @param imageURL The image url that was prefetched
23 | * @param finishedCount The total number of images that were prefetched (successful or not)
24 | * @param totalCount The total number of images that were to be prefetched
25 | */
26 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount;
27 |
28 | /**
29 | * Called when all images are prefetched.
30 | * @param imagePrefetcher The current image prefetcher
31 | * @param totalCount The total number of images that were prefetched (whether successful or not)
32 | * @param skippedCount The total number of images that were skipped
33 | */
34 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount;
35 |
36 | @end
37 |
38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls);
39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls);
40 |
41 | /**
42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority.
43 | */
44 | @interface SDWebImagePrefetcher : NSObject
45 |
46 | /**
47 | * The web image manager
48 | */
49 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager;
50 |
51 | /**
52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3.
53 | */
54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads;
55 |
56 | /**
57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority.
58 | */
59 | @property (nonatomic, assign) SDWebImageOptions options;
60 |
61 | /**
62 | * Queue options for Prefetcher. Defaults to Main Queue.
63 | */
64 | @property (SDDispatchQueueSetterSementics, nonatomic, nonnull) dispatch_queue_t prefetcherQueue;
65 |
66 | @property (weak, nonatomic, nullable) id delegate;
67 |
68 | /**
69 | * Return the global image prefetcher instance.
70 | */
71 | + (nonnull instancetype)sharedImagePrefetcher;
72 |
73 | /**
74 | * Allows you to instantiate a prefetcher with any arbitrary image manager.
75 | */
76 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER;
77 |
78 | /**
79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
80 | * currently one image is downloaded at a time,
81 | * and skips images for failed downloads and proceed to the next image in the list.
82 | * Any previously-running prefetch operations are canceled.
83 | *
84 | * @param urls list of URLs to prefetch
85 | */
86 | - (void)prefetchURLs:(nullable NSArray *)urls;
87 |
88 | /**
89 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching,
90 | * currently one image is downloaded at a time,
91 | * and skips images for failed downloads and proceed to the next image in the list.
92 | * Any previously-running prefetch operations are canceled.
93 | *
94 | * @param urls list of URLs to prefetch
95 | * @param progressBlock block to be called when progress updates;
96 | * first parameter is the number of completed (successful or not) requests,
97 | * second parameter is the total number of images originally requested to be prefetched
98 | * @param completionBlock block to be called when prefetching is completed
99 | * first param is the number of completed (successful or not) requests,
100 | * second parameter is the number of skipped requests
101 | */
102 | - (void)prefetchURLs:(nullable NSArray *)urls
103 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock
104 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock;
105 |
106 | /**
107 | * Remove and cancel queued list
108 | */
109 | - (void)cancelPrefetching;
110 |
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/SDWebImageWebPCoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #ifdef SD_WEBP
10 |
11 | #import
12 | #import "SDWebImageCoder.h"
13 |
14 | /**
15 | Built in coder that supports WebP and animated WebP
16 | */
17 | @interface SDWebImageWebPCoder : NSObject
18 |
19 | + (nonnull instancetype)sharedCoder;
20 |
21 | @end
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | @interface UIImage (ForceDecode)
12 |
13 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image;
14 |
15 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
16 |
17 | @end
18 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIImage+ForceDecode.h"
10 | #import "SDWebImageCodersManager.h"
11 |
12 | @implementation UIImage (ForceDecode)
13 |
14 | + (UIImage *)decodedImageWithImage:(UIImage *)image {
15 | if (!image) {
16 | return nil;
17 | }
18 | NSData *tempData;
19 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}];
20 | }
21 |
22 | + (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image {
23 | if (!image) {
24 | return nil;
25 | }
26 | NSData *tempData;
27 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}];
28 | }
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+GIF.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Laurin Brandner
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "SDWebImageCompat.h"
11 |
12 | @interface UIImage (GIF)
13 |
14 | /**
15 | * Creates an animated UIImage from an NSData.
16 | * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array.
17 | */
18 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data;
19 |
20 | /**
21 | * Checks if an UIImage instance is a GIF. Will use the `images` array.
22 | */
23 | - (BOOL)isGIF;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+GIF.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | * (c) Laurin Brandner
5 | *
6 | * For the full copyright and license information, please view the LICENSE
7 | * file that was distributed with this source code.
8 | */
9 |
10 | #import "UIImage+GIF.h"
11 | #import "SDWebImageGIFCoder.h"
12 | #import "NSImage+WebCache.h"
13 |
14 | @implementation UIImage (GIF)
15 |
16 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data {
17 | if (!data) {
18 | return nil;
19 | }
20 | return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data];
21 | }
22 |
23 | - (BOOL)isGIF {
24 | return (self.images != nil);
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 | #import "NSData+ImageContentType.h"
11 |
12 | @interface UIImage (MultiFormat)
13 |
14 | /**
15 | * UIKit:
16 | * For static image format, this value is always 0.
17 | * For animated image format, 0 means infinite looping.
18 | * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
19 | * AppKit:
20 | * NSImage currently only support animated via GIF imageRep unlike UIImage.
21 | * The getter of this property will get the loop count from GIF imageRep
22 | * The setter of this property will set the loop count from GIF imageRep
23 | */
24 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount;
25 |
26 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data;
27 | - (nullable NSData *)sd_imageData;
28 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat;
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIImage+MultiFormat.h"
10 |
11 | #import "objc/runtime.h"
12 | #import "SDWebImageCodersManager.h"
13 |
14 | @implementation UIImage (MultiFormat)
15 |
16 | #if SD_MAC
17 | - (NSUInteger)sd_imageLoopCount {
18 | NSUInteger imageLoopCount = 0;
19 | for (NSImageRep *rep in self.representations) {
20 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) {
21 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep;
22 | imageLoopCount = [[bitmapRep valueForProperty:NSImageLoopCount] unsignedIntegerValue];
23 | break;
24 | }
25 | }
26 | return imageLoopCount;
27 | }
28 |
29 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount {
30 | for (NSImageRep *rep in self.representations) {
31 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) {
32 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep;
33 | [bitmapRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)];
34 | break;
35 | }
36 | }
37 | }
38 |
39 | #else
40 |
41 | - (NSUInteger)sd_imageLoopCount {
42 | NSUInteger imageLoopCount = 0;
43 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount));
44 | if ([value isKindOfClass:[NSNumber class]]) {
45 | imageLoopCount = value.unsignedIntegerValue;
46 | }
47 | return imageLoopCount;
48 | }
49 |
50 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount {
51 | NSNumber *value = @(sd_imageLoopCount);
52 | objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
53 | }
54 | #endif
55 |
56 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data {
57 | return [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data];
58 | }
59 |
60 | - (nullable NSData *)sd_imageData {
61 | return [self sd_imageDataAsFormat:SDImageFormatUndefined];
62 | }
63 |
64 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat {
65 | NSData *imageData = nil;
66 | if (self) {
67 | imageData = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:self format:imageFormat];
68 | }
69 | return imageData;
70 | }
71 |
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+WebP.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #ifdef SD_WEBP
10 |
11 | #import "SDWebImageCompat.h"
12 |
13 | @interface UIImage (WebP)
14 |
15 | /**
16 | * Get the current WebP image loop count, the default value is 0.
17 | * For static WebP image, the value is 0.
18 | * For animated WebP image, 0 means repeat the animation indefinitely.
19 | * Note that because of the limitations of categories this property can get out of sync
20 | * if you create another instance with CGImage or other methods.
21 | * @return WebP image loop count
22 | * @deprecated use `sd_imageLoopCount` instead.
23 | */
24 | - (NSInteger)sd_webpLoopCount __deprecated_msg("Method deprecated. Use `sd_imageLoopCount` in `UIImage+MultiFormat.h`");
25 |
26 | + (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data;
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImage+WebP.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #ifdef SD_WEBP
10 |
11 | #import "UIImage+WebP.h"
12 | #import "SDWebImageWebPCoder.h"
13 | #import "UIImage+MultiFormat.h"
14 |
15 | @implementation UIImage (WebP)
16 |
17 | - (NSInteger)sd_webpLoopCount {
18 | return self.sd_imageLoopCount;
19 | }
20 |
21 | + (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data {
22 | if (!data) {
23 | return nil;
24 | }
25 | return [[SDWebImageWebPCoder sharedCoder] decodedImageWithData:data];
26 | }
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if SD_UIKIT
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | /**
16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state.
17 | */
18 | @interface UIImageView (HighlightedWebCache)
19 |
20 | /**
21 | * Set the imageView `highlightedImage` with an `url`.
22 | *
23 | * The download is asynchronous and cached.
24 | *
25 | * @param url The url for the image.
26 | */
27 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT;
28 |
29 | /**
30 | * Set the imageView `highlightedImage` with an `url` and custom options.
31 | *
32 | * The download is asynchronous and cached.
33 | *
34 | * @param url The url for the image.
35 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
36 | */
37 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
38 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT;
39 |
40 | /**
41 | * Set the imageView `highlightedImage` with an `url`.
42 | *
43 | * The download is asynchronous and cached.
44 | *
45 | * @param url The url for the image.
46 | * @param completedBlock A block called when operation has been completed. This block has no return value
47 | * and takes the requested UIImage as first parameter. In case of error the image parameter
48 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
49 | * indicating if the image was retrieved from the local cache or from the network.
50 | * The fourth parameter is the original image url.
51 | */
52 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
53 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT;
54 |
55 | /**
56 | * Set the imageView `highlightedImage` with an `url` and custom options.
57 | *
58 | * The download is asynchronous and cached.
59 | *
60 | * @param url The url for the image.
61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
62 | * @param completedBlock A block called when operation has been completed. This block has no return value
63 | * and takes the requested UIImage as first parameter. In case of error the image parameter
64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
65 | * indicating if the image was retrieved from the local cache or from the network.
66 | * The fourth parameter is the original image url.
67 | */
68 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
69 | options:(SDWebImageOptions)options
70 | completed:(nullable SDExternalCompletionBlock)completedBlock;
71 |
72 | /**
73 | * Set the imageView `highlightedImage` with an `url` and custom options.
74 | *
75 | * The download is asynchronous and cached.
76 | *
77 | * @param url The url for the image.
78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
79 | * @param progressBlock A block called while image is downloading
80 | * @note the progress block is executed on a background queue
81 | * @param completedBlock A block called when operation has been completed. This block has no return value
82 | * and takes the requested UIImage as first parameter. In case of error the image parameter
83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean
84 | * indicating if the image was retrieved from the local cache or from the network.
85 | * The fourth parameter is the original image url.
86 | */
87 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
88 | options:(SDWebImageOptions)options
89 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
90 | completed:(nullable SDExternalCompletionBlock)completedBlock;
91 |
92 | @end
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIImageView+HighlightedWebCache.h"
10 |
11 | #if SD_UIKIT
12 |
13 | #import "UIView+WebCacheOperation.h"
14 | #import "UIView+WebCache.h"
15 |
16 | @implementation UIImageView (HighlightedWebCache)
17 |
18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url {
19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil];
20 | }
21 |
22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options {
23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil];
24 | }
25 |
26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock {
27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock];
28 | }
29 |
30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock {
31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock];
32 | }
33 |
34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url
35 | options:(SDWebImageOptions)options
36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
37 | completed:(nullable SDExternalCompletionBlock)completedBlock {
38 | __weak typeof(self)weakSelf = self;
39 | [self sd_internalSetImageWithURL:url
40 | placeholderImage:nil
41 | options:options
42 | operationKey:@"UIImageViewImageOperationHighlighted"
43 | setImageBlock:^(UIImage *image, NSData *imageData) {
44 | weakSelf.highlightedImage = image;
45 | }
46 | progress:progressBlock
47 | completed:completedBlock];
48 | }
49 |
50 | @end
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "SDWebImageCompat.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "SDWebImageManager.h"
14 |
15 | @interface UIView (WebCacheOperation)
16 |
17 | /**
18 | * Set the image load operation (storage in a UIView based dictionary)
19 | *
20 | * @param operation the operation
21 | * @param key key for storing the operation
22 | */
23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key;
24 |
25 | /**
26 | * Cancel all operations for the current UIView and key
27 | *
28 | * @param key key for identifying the operations
29 | */
30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key;
31 |
32 | /**
33 | * Just remove the operations corresponding to the current UIView and key without cancelling them
34 | *
35 | * @param key key for identifying the operations
36 | */
37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key;
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SDWebImage package.
3 | * (c) Olivier Poitrey
4 | *
5 | * For the full copyright and license information, please view the LICENSE
6 | * file that was distributed with this source code.
7 | */
8 |
9 | #import "UIView+WebCacheOperation.h"
10 |
11 | #if SD_UIKIT || SD_MAC
12 |
13 | #import "objc/runtime.h"
14 |
15 | static char loadOperationKey;
16 |
17 | typedef NSMutableDictionary SDOperationsDictionary;
18 |
19 | @implementation UIView (WebCacheOperation)
20 |
21 | - (SDOperationsDictionary *)operationDictionary {
22 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey);
23 | if (operations) {
24 | return operations;
25 | }
26 | operations = [NSMutableDictionary dictionary];
27 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
28 | return operations;
29 | }
30 |
31 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key {
32 | if (key) {
33 | [self sd_cancelImageLoadOperationWithKey:key];
34 | if (operation) {
35 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
36 | operationDictionary[key] = operation;
37 | }
38 | }
39 | }
40 |
41 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key {
42 | // Cancel in progress downloader from queue
43 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
44 | id operations = operationDictionary[key];
45 | if (operations) {
46 | if ([operations isKindOfClass:[NSArray class]]) {
47 | for (id operation in operations) {
48 | if (operation) {
49 | [operation cancel];
50 | }
51 | }
52 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){
53 | [(id) operations cancel];
54 | }
55 | [operationDictionary removeObjectForKey:key];
56 | }
57 | }
58 |
59 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key {
60 | if (key) {
61 | SDOperationsDictionary *operationDictionary = [self operationDictionary];
62 | [operationDictionary removeObjectForKey:key];
63 | }
64 | }
65 |
66 | @end
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-News_coretText/Pods-News_coretText-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## SDWebImage
5 |
6 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com
7 |
8 | Permission is hereby granted, free of charge, to any person obtaining a copy
9 | of this software and associated documentation files (the "Software"), to deal
10 | in the Software without restriction, including without limitation the rights
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | copies of the Software, and to permit persons to whom the Software is furnished
13 | to do so, subject to the following conditions:
14 |
15 | The above copyright notice and this permission notice shall be included in all
16 | copies or substantial portions of the Software.
17 |
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 | THE SOFTWARE.
25 |
26 |
27 |
28 | ## libwebp
29 |
30 | Copyright (c) 2010, Google Inc. All rights reserved.
31 |
32 | Redistribution and use in source and binary forms, with or without
33 | modification, are permitted provided that the following conditions are
34 | met:
35 |
36 | * Redistributions of source code must retain the above copyright
37 | notice, this list of conditions and the following disclaimer.
38 |
39 | * Redistributions in binary form must reproduce the above copyright
40 | notice, this list of conditions and the following disclaimer in
41 | the documentation and/or other materials provided with the
42 | distribution.
43 |
44 | * Neither the name of Google nor the names of its contributors may
45 | be used to endorse or promote products derived from this software
46 | without specific prior written permission.
47 |
48 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
52 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
54 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
55 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
56 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 |
60 |
61 | Generated by CocoaPods - https://cocoapods.org
62 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-News_coretText/Pods-News_coretText-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com
18 |
19 | Permission is hereby granted, free of charge, to any person obtaining a copy
20 | of this software and associated documentation files (the "Software"), to deal
21 | in the Software without restriction, including without limitation the rights
22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 | copies of the Software, and to permit persons to whom the Software is furnished
24 | to do so, subject to the following conditions:
25 |
26 | The above copyright notice and this permission notice shall be included in all
27 | copies or substantial portions of the Software.
28 |
29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 | THE SOFTWARE.
36 |
37 |
38 | License
39 | MIT
40 | Title
41 | SDWebImage
42 | Type
43 | PSGroupSpecifier
44 |
45 |
46 | FooterText
47 | Copyright (c) 2010, Google Inc. All rights reserved.
48 |
49 | Redistribution and use in source and binary forms, with or without
50 | modification, are permitted provided that the following conditions are
51 | met:
52 |
53 | * Redistributions of source code must retain the above copyright
54 | notice, this list of conditions and the following disclaimer.
55 |
56 | * Redistributions in binary form must reproduce the above copyright
57 | notice, this list of conditions and the following disclaimer in
58 | the documentation and/or other materials provided with the
59 | distribution.
60 |
61 | * Neither the name of Google nor the names of its contributors may
62 | be used to endorse or promote products derived from this software
63 | without specific prior written permission.
64 |
65 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
67 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
68 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
69 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
70 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
71 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
72 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
73 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
75 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76 |
77 |
78 | License
79 | BSD
80 | Title
81 | libwebp
82 | Type
83 | PSGroupSpecifier
84 |
85 |
86 | FooterText
87 | Generated by CocoaPods - https://cocoapods.org
88 | Title
89 |
90 | Type
91 | PSGroupSpecifier
92 |
93 |
94 | StringsTable
95 | Acknowledgements
96 | Title
97 | Acknowledgements
98 |
99 |
100 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-News_coretText/Pods-News_coretText-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_News_coretText : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_News_coretText
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-News_coretText/Pods-News_coretText.debug.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/libwebp"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/libwebp"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/libwebp"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"libwebp" -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/libwebp/src
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/Pods-News_coretText/Pods-News_coretText.release.xcconfig:
--------------------------------------------------------------------------------
1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1
2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/libwebp"
3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/libwebp"
4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" -isystem "${PODS_ROOT}/Headers/Public/libwebp"
5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SDWebImage" -l"libwebp" -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 | USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/libwebp/src
11 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_SDWebImage : NSObject
3 | @end
4 | @implementation PodsDummy_SDWebImage
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/libwebp"
4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/libwebp"
5 | OTHER_LDFLAGS = -framework "ImageIO"
6 | PODS_BUILD_DIR = $BUILD_DIR
7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 | USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/libwebp/src
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/libwebp/libwebp-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_libwebp : NSObject
3 | @end
4 | @implementation PodsDummy_libwebp
5 | @end
6 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/libwebp/libwebp-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Pods/Target Support Files/libwebp/libwebp.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/libwebp
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/libwebp" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" "${PODS_ROOT}/Headers/Public/libwebp"
4 | PODS_BUILD_DIR = $BUILD_DIR
5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/libwebp
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/Pods/libwebp/COPYING:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, Google Inc. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in
12 | the documentation and/or other materials provided with the
13 | distribution.
14 |
15 | * Neither the name of Google nor the names of its contributors may
16 | be used to endorse or promote products derived from this software
17 | without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dec/alphai_dec.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Alpha decoder: internal header.
11 | //
12 | // Author: Urvang (urvang@google.com)
13 |
14 | #ifndef WEBP_DEC_ALPHAI_H_
15 | #define WEBP_DEC_ALPHAI_H_
16 |
17 | #include "./webpi_dec.h"
18 | #include "../utils/filters_utils.h"
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | struct VP8LDecoder; // Defined in dec/vp8li.h.
25 |
26 | typedef struct ALPHDecoder ALPHDecoder;
27 | struct ALPHDecoder {
28 | int width_;
29 | int height_;
30 | int method_;
31 | WEBP_FILTER_TYPE filter_;
32 | int pre_processing_;
33 | struct VP8LDecoder* vp8l_dec_;
34 | VP8Io io_;
35 | int use_8b_decode_; // Although alpha channel requires only 1 byte per
36 | // pixel, sometimes VP8LDecoder may need to allocate
37 | // 4 bytes per pixel internally during decode.
38 | uint8_t* output_;
39 | const uint8_t* prev_line_; // last output row (or NULL)
40 | };
41 |
42 | //------------------------------------------------------------------------------
43 | // internal functions. Not public.
44 |
45 | // Deallocate memory associated to dec->alpha_plane_ decoding
46 | void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
47 |
48 | //------------------------------------------------------------------------------
49 |
50 | #ifdef __cplusplus
51 | } // extern "C"
52 | #endif
53 |
54 | #endif /* WEBP_DEC_ALPHAI_H_ */
55 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dec/common_dec.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Definitions and macros common to encoding and decoding
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_DEC_COMMON_H_
15 | #define WEBP_DEC_COMMON_H_
16 |
17 | // intra prediction modes
18 | enum { B_DC_PRED = 0, // 4x4 modes
19 | B_TM_PRED = 1,
20 | B_VE_PRED = 2,
21 | B_HE_PRED = 3,
22 | B_RD_PRED = 4,
23 | B_VR_PRED = 5,
24 | B_LD_PRED = 6,
25 | B_VL_PRED = 7,
26 | B_HD_PRED = 8,
27 | B_HU_PRED = 9,
28 | NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED, // = 10
29 |
30 | // Luma16 or UV modes
31 | DC_PRED = B_DC_PRED, V_PRED = B_VE_PRED,
32 | H_PRED = B_HE_PRED, TM_PRED = B_TM_PRED,
33 | B_PRED = NUM_BMODES, // refined I4x4 mode
34 | NUM_PRED_MODES = 4,
35 |
36 | // special modes
37 | B_DC_PRED_NOTOP = 4,
38 | B_DC_PRED_NOLEFT = 5,
39 | B_DC_PRED_NOTOPLEFT = 6,
40 | NUM_B_DC_MODES = 7 };
41 |
42 | enum { MB_FEATURE_TREE_PROBS = 3,
43 | NUM_MB_SEGMENTS = 4,
44 | NUM_REF_LF_DELTAS = 4,
45 | NUM_MODE_LF_DELTAS = 4, // I4x4, ZERO, *, SPLIT
46 | MAX_NUM_PARTITIONS = 8,
47 | // Probabilities
48 | NUM_TYPES = 4, // 0: i16-AC, 1: i16-DC, 2:chroma-AC, 3:i4-AC
49 | NUM_BANDS = 8,
50 | NUM_CTX = 3,
51 | NUM_PROBAS = 11
52 | };
53 |
54 | #endif // WEBP_DEC_COMMON_H_
55 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dec/quant_dec.c:
--------------------------------------------------------------------------------
1 | // Copyright 2010 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Quantizer initialization
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include "./vp8i_dec.h"
15 |
16 | static WEBP_INLINE int clip(int v, int M) {
17 | return v < 0 ? 0 : v > M ? M : v;
18 | }
19 |
20 | // Paragraph 14.1
21 | static const uint8_t kDcTable[128] = {
22 | 4, 5, 6, 7, 8, 9, 10, 10,
23 | 11, 12, 13, 14, 15, 16, 17, 17,
24 | 18, 19, 20, 20, 21, 21, 22, 22,
25 | 23, 23, 24, 25, 25, 26, 27, 28,
26 | 29, 30, 31, 32, 33, 34, 35, 36,
27 | 37, 37, 38, 39, 40, 41, 42, 43,
28 | 44, 45, 46, 46, 47, 48, 49, 50,
29 | 51, 52, 53, 54, 55, 56, 57, 58,
30 | 59, 60, 61, 62, 63, 64, 65, 66,
31 | 67, 68, 69, 70, 71, 72, 73, 74,
32 | 75, 76, 76, 77, 78, 79, 80, 81,
33 | 82, 83, 84, 85, 86, 87, 88, 89,
34 | 91, 93, 95, 96, 98, 100, 101, 102,
35 | 104, 106, 108, 110, 112, 114, 116, 118,
36 | 122, 124, 126, 128, 130, 132, 134, 136,
37 | 138, 140, 143, 145, 148, 151, 154, 157
38 | };
39 |
40 | static const uint16_t kAcTable[128] = {
41 | 4, 5, 6, 7, 8, 9, 10, 11,
42 | 12, 13, 14, 15, 16, 17, 18, 19,
43 | 20, 21, 22, 23, 24, 25, 26, 27,
44 | 28, 29, 30, 31, 32, 33, 34, 35,
45 | 36, 37, 38, 39, 40, 41, 42, 43,
46 | 44, 45, 46, 47, 48, 49, 50, 51,
47 | 52, 53, 54, 55, 56, 57, 58, 60,
48 | 62, 64, 66, 68, 70, 72, 74, 76,
49 | 78, 80, 82, 84, 86, 88, 90, 92,
50 | 94, 96, 98, 100, 102, 104, 106, 108,
51 | 110, 112, 114, 116, 119, 122, 125, 128,
52 | 131, 134, 137, 140, 143, 146, 149, 152,
53 | 155, 158, 161, 164, 167, 170, 173, 177,
54 | 181, 185, 189, 193, 197, 201, 205, 209,
55 | 213, 217, 221, 225, 229, 234, 239, 245,
56 | 249, 254, 259, 264, 269, 274, 279, 284
57 | };
58 |
59 | //------------------------------------------------------------------------------
60 | // Paragraph 9.6
61 |
62 | void VP8ParseQuant(VP8Decoder* const dec) {
63 | VP8BitReader* const br = &dec->br_;
64 | const int base_q0 = VP8GetValue(br, 7);
65 | const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
66 | const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
67 | const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
68 | const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
69 | const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
70 |
71 | const VP8SegmentHeader* const hdr = &dec->segment_hdr_;
72 | int i;
73 |
74 | for (i = 0; i < NUM_MB_SEGMENTS; ++i) {
75 | int q;
76 | if (hdr->use_segment_) {
77 | q = hdr->quantizer_[i];
78 | if (!hdr->absolute_delta_) {
79 | q += base_q0;
80 | }
81 | } else {
82 | if (i > 0) {
83 | dec->dqm_[i] = dec->dqm_[0];
84 | continue;
85 | } else {
86 | q = base_q0;
87 | }
88 | }
89 | {
90 | VP8QuantMatrix* const m = &dec->dqm_[i];
91 | m->y1_mat_[0] = kDcTable[clip(q + dqy1_dc, 127)];
92 | m->y1_mat_[1] = kAcTable[clip(q + 0, 127)];
93 |
94 | m->y2_mat_[0] = kDcTable[clip(q + dqy2_dc, 127)] * 2;
95 | // For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16.
96 | // The smallest precision for that is '(x*6349) >> 12' but 16 is a good
97 | // word size.
98 | m->y2_mat_[1] = (kAcTable[clip(q + dqy2_ac, 127)] * 101581) >> 16;
99 | if (m->y2_mat_[1] < 8) m->y2_mat_[1] = 8;
100 |
101 | m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)];
102 | m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)];
103 |
104 | m->uv_quant_ = q + dquv_ac; // for dithering strength evaluation
105 | }
106 | }
107 | }
108 |
109 | //------------------------------------------------------------------------------
110 |
111 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/alpha_processing_sse41.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Utilities for processing transparent channel, SSE4.1 variant.
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include "./dsp.h"
15 |
16 | #if defined(WEBP_USE_SSE41)
17 |
18 | #include
19 |
20 | //------------------------------------------------------------------------------
21 |
22 | static int ExtractAlpha(const uint8_t* argb, int argb_stride,
23 | int width, int height,
24 | uint8_t* alpha, int alpha_stride) {
25 | // alpha_and stores an 'and' operation of all the alpha[] values. The final
26 | // value is not 0xff if any of the alpha[] is not equal to 0xff.
27 | uint32_t alpha_and = 0xff;
28 | int i, j;
29 | const __m128i all_0xff = _mm_set1_epi32(~0u);
30 | __m128i all_alphas = all_0xff;
31 |
32 | // We must be able to access 3 extra bytes after the last written byte
33 | // 'src[4 * width - 4]', because we don't know if alpha is the first or the
34 | // last byte of the quadruplet.
35 | const int limit = (width - 1) & ~15;
36 | const __m128i kCstAlpha0 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1,
37 | -1, -1, -1, -1, 12, 8, 4, 0);
38 | const __m128i kCstAlpha1 = _mm_set_epi8(-1, -1, -1, -1, -1, -1, -1, -1,
39 | 12, 8, 4, 0, -1, -1, -1, -1);
40 | const __m128i kCstAlpha2 = _mm_set_epi8(-1, -1, -1, -1, 12, 8, 4, 0,
41 | -1, -1, -1, -1, -1, -1, -1, -1);
42 | const __m128i kCstAlpha3 = _mm_set_epi8(12, 8, 4, 0, -1, -1, -1, -1,
43 | -1, -1, -1, -1, -1, -1, -1, -1);
44 | for (j = 0; j < height; ++j) {
45 | const __m128i* src = (const __m128i*)argb;
46 | for (i = 0; i < limit; i += 16) {
47 | // load 64 argb bytes
48 | const __m128i a0 = _mm_loadu_si128(src + 0);
49 | const __m128i a1 = _mm_loadu_si128(src + 1);
50 | const __m128i a2 = _mm_loadu_si128(src + 2);
51 | const __m128i a3 = _mm_loadu_si128(src + 3);
52 | const __m128i b0 = _mm_shuffle_epi8(a0, kCstAlpha0);
53 | const __m128i b1 = _mm_shuffle_epi8(a1, kCstAlpha1);
54 | const __m128i b2 = _mm_shuffle_epi8(a2, kCstAlpha2);
55 | const __m128i b3 = _mm_shuffle_epi8(a3, kCstAlpha3);
56 | const __m128i c0 = _mm_or_si128(b0, b1);
57 | const __m128i c1 = _mm_or_si128(b2, b3);
58 | const __m128i d0 = _mm_or_si128(c0, c1);
59 | // store
60 | _mm_storeu_si128((__m128i*)&alpha[i], d0);
61 | // accumulate sixteen alpha 'and' in parallel
62 | all_alphas = _mm_and_si128(all_alphas, d0);
63 | src += 4;
64 | }
65 | for (; i < width; ++i) {
66 | const uint32_t alpha_value = argb[4 * i];
67 | alpha[i] = alpha_value;
68 | alpha_and &= alpha_value;
69 | }
70 | argb += argb_stride;
71 | alpha += alpha_stride;
72 | }
73 | // Combine the sixteen alpha 'and' into an 8-bit mask.
74 | alpha_and |= 0xff00u; // pretend the upper bits [8..15] were tested ok.
75 | alpha_and &= _mm_movemask_epi8(_mm_cmpeq_epi8(all_alphas, all_0xff));
76 | return (alpha_and == 0xffffu);
77 | }
78 |
79 | //------------------------------------------------------------------------------
80 | // Entry point
81 |
82 | extern void WebPInitAlphaProcessingSSE41(void);
83 |
84 | WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE41(void) {
85 | WebPExtractAlpha = ExtractAlpha;
86 | }
87 |
88 | #else // !WEBP_USE_SSE41
89 |
90 | WEBP_DSP_INIT_STUB(WebPInitAlphaProcessingSSE41)
91 |
92 | #endif // WEBP_USE_SSE41
93 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/argb.c:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // ARGB making functions.
11 | //
12 | // Author: Djordje Pesut (djordje.pesut@imgtec.com)
13 |
14 | #include "./dsp.h"
15 |
16 | static WEBP_INLINE uint32_t MakeARGB32(int a, int r, int g, int b) {
17 | return (((uint32_t)a << 24) | (r << 16) | (g << 8) | b);
18 | }
19 |
20 | static void PackARGB(const uint8_t* a, const uint8_t* r, const uint8_t* g,
21 | const uint8_t* b, int len, uint32_t* out) {
22 | int i;
23 | for (i = 0; i < len; ++i) {
24 | out[i] = MakeARGB32(a[4 * i], r[4 * i], g[4 * i], b[4 * i]);
25 | }
26 | }
27 |
28 | static void PackRGB(const uint8_t* r, const uint8_t* g, const uint8_t* b,
29 | int len, int step, uint32_t* out) {
30 | int i, offset = 0;
31 | for (i = 0; i < len; ++i) {
32 | out[i] = MakeARGB32(0xff, r[offset], g[offset], b[offset]);
33 | offset += step;
34 | }
35 | }
36 |
37 | void (*VP8PackARGB)(const uint8_t*, const uint8_t*, const uint8_t*,
38 | const uint8_t*, int, uint32_t*);
39 | void (*VP8PackRGB)(const uint8_t*, const uint8_t*, const uint8_t*,
40 | int, int, uint32_t*);
41 |
42 | extern void VP8EncDspARGBInitMIPSdspR2(void);
43 | extern void VP8EncDspARGBInitSSE2(void);
44 |
45 | static volatile VP8CPUInfo argb_last_cpuinfo_used =
46 | (VP8CPUInfo)&argb_last_cpuinfo_used;
47 |
48 | WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInit(void) {
49 | if (argb_last_cpuinfo_used == VP8GetCPUInfo) return;
50 |
51 | VP8PackARGB = PackARGB;
52 | VP8PackRGB = PackRGB;
53 |
54 | // If defined, use CPUInfo() to overwrite some pointers with faster versions.
55 | if (VP8GetCPUInfo != NULL) {
56 | #if defined(WEBP_USE_SSE2)
57 | if (VP8GetCPUInfo(kSSE2)) {
58 | VP8EncDspARGBInitSSE2();
59 | }
60 | #endif
61 | #if defined(WEBP_USE_MIPS_DSP_R2)
62 | if (VP8GetCPUInfo(kMIPSdspR2)) {
63 | VP8EncDspARGBInitMIPSdspR2();
64 | }
65 | #endif
66 | }
67 | argb_last_cpuinfo_used = VP8GetCPUInfo;
68 | }
69 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/argb_sse2.c:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // ARGB making functions (SSE2 version).
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include "./dsp.h"
15 |
16 | #if defined(WEBP_USE_SSE2)
17 |
18 | #include
19 | #include
20 | #include
21 |
22 | static WEBP_INLINE uint32_t MakeARGB32(int a, int r, int g, int b) {
23 | return (((uint32_t)a << 24) | (r << 16) | (g << 8) | b);
24 | }
25 |
26 | static void PackARGB(const uint8_t* a, const uint8_t* r, const uint8_t* g,
27 | const uint8_t* b, int len, uint32_t* out) {
28 | if (g == r + 1) { // RGBA input order. Need to swap R and B.
29 | int i = 0;
30 | const int len_max = len & ~3; // max length processed in main loop
31 | const __m128i red_blue_mask = _mm_set1_epi32(0x00ff00ffu);
32 | assert(b == r + 2);
33 | assert(a == r + 3);
34 | for (; i < len_max; i += 4) {
35 | const __m128i A = _mm_loadu_si128((const __m128i*)(r + 4 * i));
36 | const __m128i B = _mm_and_si128(A, red_blue_mask); // R 0 B 0
37 | const __m128i C = _mm_andnot_si128(red_blue_mask, A); // 0 G 0 A
38 | const __m128i D = _mm_shufflelo_epi16(B, _MM_SHUFFLE(2, 3, 0, 1));
39 | const __m128i E = _mm_shufflehi_epi16(D, _MM_SHUFFLE(2, 3, 0, 1));
40 | const __m128i F = _mm_or_si128(E, C);
41 | _mm_storeu_si128((__m128i*)(out + i), F);
42 | }
43 | for (; i < len; ++i) {
44 | out[i] = MakeARGB32(a[4 * i], r[4 * i], g[4 * i], b[4 * i]);
45 | }
46 | } else {
47 | assert(g == b + 1);
48 | assert(r == b + 2);
49 | assert(a == b + 3);
50 | memcpy(out, b, len * 4);
51 | }
52 | }
53 |
54 | //------------------------------------------------------------------------------
55 | // Entry point
56 |
57 | extern void VP8EncDspARGBInitSSE2(void);
58 |
59 | WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInitSSE2(void) {
60 | VP8PackARGB = PackARGB;
61 | }
62 |
63 | #else // !WEBP_USE_SSE2
64 |
65 | WEBP_DSP_INIT_STUB(VP8EncDspARGBInitSSE2)
66 |
67 | #endif // WEBP_USE_SSE2
68 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/dec_sse41.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // SSE4 version of some decoding functions.
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include "./dsp.h"
15 |
16 | #if defined(WEBP_USE_SSE41)
17 |
18 | #include
19 | #include "../dec/vp8i_dec.h"
20 | #include "../utils/utils.h"
21 |
22 | static void HE16(uint8_t* dst) { // horizontal
23 | int j;
24 | const __m128i kShuffle3 = _mm_set1_epi8(3);
25 | for (j = 16; j > 0; --j) {
26 | const __m128i in = _mm_cvtsi32_si128(WebPMemToUint32(dst - 4));
27 | const __m128i values = _mm_shuffle_epi8(in, kShuffle3);
28 | _mm_storeu_si128((__m128i*)dst, values);
29 | dst += BPS;
30 | }
31 | }
32 |
33 | //------------------------------------------------------------------------------
34 | // Entry point
35 |
36 | extern void VP8DspInitSSE41(void);
37 |
38 | WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) {
39 | VP8PredLuma16[3] = HE16;
40 | }
41 |
42 | #else // !WEBP_USE_SSE41
43 |
44 | WEBP_DSP_INIT_STUB(VP8DspInitSSE41)
45 |
46 | #endif // WEBP_USE_SSE41
47 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/enc_avx2.c:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // AVX2 version of speed-critical encoding functions.
11 |
12 | #include "./dsp.h"
13 |
14 | #if defined(WEBP_USE_AVX2)
15 |
16 | #endif // WEBP_USE_AVX2
17 |
18 | //------------------------------------------------------------------------------
19 | // Entry point
20 |
21 | WEBP_DSP_INIT_STUB(VP8EncDspInitAVX2)
22 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/lossless_enc_sse41.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // SSE4.1 variant of methods for lossless encoder
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include "./dsp.h"
15 |
16 | #if defined(WEBP_USE_SSE41)
17 | #include
18 | #include
19 | #include "./lossless.h"
20 |
21 | //------------------------------------------------------------------------------
22 | // Subtract-Green Transform
23 |
24 | static void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) {
25 | int i;
26 | const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9,
27 | -1, 5, -1, 5, -1, 1, -1, 1);
28 | for (i = 0; i + 4 <= num_pixels; i += 4) {
29 | const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);
30 | const __m128i in_0g0g = _mm_shuffle_epi8(in, kCstShuffle);
31 | const __m128i out = _mm_sub_epi8(in, in_0g0g);
32 | _mm_storeu_si128((__m128i*)&argb_data[i], out);
33 | }
34 | // fallthrough and finish off with plain-C
35 | if (i != num_pixels) {
36 | VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i);
37 | }
38 | }
39 |
40 | //------------------------------------------------------------------------------
41 | // Entry point
42 |
43 | extern void VP8LEncDspInitSSE41(void);
44 |
45 | WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE41(void) {
46 | VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;
47 | }
48 |
49 | #else // !WEBP_USE_SSE41
50 |
51 | WEBP_DSP_INIT_STUB(VP8LEncDspInitSSE41)
52 |
53 | #endif // WEBP_USE_SSE41
54 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/dsp/neon.h:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // NEON common code.
11 |
12 | #ifndef WEBP_DSP_NEON_H_
13 | #define WEBP_DSP_NEON_H_
14 |
15 | #include
16 |
17 | #include "./dsp.h"
18 |
19 | // Right now, some intrinsics functions seem slower, so we disable them
20 | // everywhere except aarch64 where the inline assembly is incompatible.
21 | #if defined(__aarch64__)
22 | #define WEBP_USE_INTRINSICS // use intrinsics when possible
23 | #endif
24 |
25 | #define INIT_VECTOR2(v, a, b) do { \
26 | v.val[0] = a; \
27 | v.val[1] = b; \
28 | } while (0)
29 |
30 | #define INIT_VECTOR3(v, a, b, c) do { \
31 | v.val[0] = a; \
32 | v.val[1] = b; \
33 | v.val[2] = c; \
34 | } while (0)
35 |
36 | #define INIT_VECTOR4(v, a, b, c, d) do { \
37 | v.val[0] = a; \
38 | v.val[1] = b; \
39 | v.val[2] = c; \
40 | v.val[3] = d; \
41 | } while (0)
42 |
43 | // if using intrinsics, this flag avoids some functions that make gcc-4.6.3
44 | // crash ("internal compiler error: in immed_double_const, at emit-rtl.").
45 | // (probably similar to gcc.gnu.org/bugzilla/show_bug.cgi?id=48183)
46 | #if !(LOCAL_GCC_PREREQ(4,8) || defined(__aarch64__))
47 | #define WORK_AROUND_GCC
48 | #endif
49 |
50 | static WEBP_INLINE int32x4x4_t Transpose4x4(const int32x4x4_t rows) {
51 | uint64x2x2_t row01, row23;
52 |
53 | row01.val[0] = vreinterpretq_u64_s32(rows.val[0]);
54 | row01.val[1] = vreinterpretq_u64_s32(rows.val[1]);
55 | row23.val[0] = vreinterpretq_u64_s32(rows.val[2]);
56 | row23.val[1] = vreinterpretq_u64_s32(rows.val[3]);
57 | // Transpose 64-bit values (there's no vswp equivalent)
58 | {
59 | const uint64x1_t row0h = vget_high_u64(row01.val[0]);
60 | const uint64x1_t row2l = vget_low_u64(row23.val[0]);
61 | const uint64x1_t row1h = vget_high_u64(row01.val[1]);
62 | const uint64x1_t row3l = vget_low_u64(row23.val[1]);
63 | row01.val[0] = vcombine_u64(vget_low_u64(row01.val[0]), row2l);
64 | row23.val[0] = vcombine_u64(row0h, vget_high_u64(row23.val[0]));
65 | row01.val[1] = vcombine_u64(vget_low_u64(row01.val[1]), row3l);
66 | row23.val[1] = vcombine_u64(row1h, vget_high_u64(row23.val[1]));
67 | }
68 | {
69 | const int32x4x2_t out01 = vtrnq_s32(vreinterpretq_s32_u64(row01.val[0]),
70 | vreinterpretq_s32_u64(row01.val[1]));
71 | const int32x4x2_t out23 = vtrnq_s32(vreinterpretq_s32_u64(row23.val[0]),
72 | vreinterpretq_s32_u64(row23.val[1]));
73 | int32x4x4_t out;
74 | out.val[0] = out01.val[0];
75 | out.val[1] = out01.val[1];
76 | out.val[2] = out23.val[0];
77 | out.val[3] = out23.val[1];
78 | return out;
79 | }
80 | }
81 |
82 | #if 0 // Useful debug macro.
83 | #include
84 | #define PRINT_REG(REG, SIZE) do { \
85 | int i; \
86 | printf("%s \t[%d]: 0x", #REG, SIZE); \
87 | if (SIZE == 8) { \
88 | uint8_t _tmp[8]; \
89 | vst1_u8(_tmp, (REG)); \
90 | for (i = 0; i < 8; ++i) printf("%.2x ", _tmp[i]); \
91 | } else if (SIZE == 16) { \
92 | uint16_t _tmp[4]; \
93 | vst1_u16(_tmp, (REG)); \
94 | for (i = 0; i < 4; ++i) printf("%.4x ", _tmp[i]); \
95 | } \
96 | printf("\n"); \
97 | } while (0)
98 | #endif
99 |
100 | #endif // WEBP_DSP_NEON_H_
101 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/enc/cost_enc.h:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Cost tables for level and modes.
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_ENC_COST_H_
15 | #define WEBP_ENC_COST_H_
16 |
17 | #include
18 | #include
19 | #include "./vp8i_enc.h"
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | // On-the-fly info about the current set of residuals. Handy to avoid
26 | // passing zillions of params.
27 | typedef struct VP8Residual VP8Residual;
28 | struct VP8Residual {
29 | int first;
30 | int last;
31 | const int16_t* coeffs;
32 |
33 | int coeff_type;
34 | ProbaArray* prob;
35 | StatsArray* stats;
36 | CostArrayPtr costs;
37 | };
38 |
39 | void VP8InitResidual(int first, int coeff_type,
40 | VP8Encoder* const enc, VP8Residual* const res);
41 |
42 | int VP8RecordCoeffs(int ctx, const VP8Residual* const res);
43 |
44 | // Record proba context used.
45 | static WEBP_INLINE int VP8RecordStats(int bit, proba_t* const stats) {
46 | proba_t p = *stats;
47 | // An overflow is inbound. Note we handle this at 0xfffe0000u instead of
48 | // 0xffff0000u to make sure p + 1u does not overflow.
49 | if (p >= 0xfffe0000u) {
50 | p = ((p + 1u) >> 1) & 0x7fff7fffu; // -> divide the stats by 2.
51 | }
52 | // record bit count (lower 16 bits) and increment total count (upper 16 bits).
53 | p += 0x00010000u + bit;
54 | *stats = p;
55 | return bit;
56 | }
57 |
58 | // Cost of coding one event with probability 'proba'.
59 | static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) {
60 | return !bit ? VP8EntropyCost[proba] : VP8EntropyCost[255 - proba];
61 | }
62 |
63 | // Level cost calculations
64 | extern const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2];
65 | void VP8CalculateLevelCosts(VP8EncProba* const proba);
66 | static WEBP_INLINE int VP8LevelCost(const uint16_t* const table, int level) {
67 | return VP8LevelFixedCosts[level]
68 | + table[(level > MAX_VARIABLE_LEVEL) ? MAX_VARIABLE_LEVEL : level];
69 | }
70 |
71 | // Mode costs
72 | extern const uint16_t VP8FixedCostsUV[4];
73 | extern const uint16_t VP8FixedCostsI16[4];
74 | extern const uint16_t VP8FixedCostsI4[NUM_BMODES][NUM_BMODES][NUM_BMODES];
75 |
76 | //------------------------------------------------------------------------------
77 |
78 | #ifdef __cplusplus
79 | } // extern "C"
80 | #endif
81 |
82 | #endif /* WEBP_ENC_COST_H_ */
83 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/enc/delta_palettization_enc.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Author: Mislav Bradac (mislavm@google.com)
11 | //
12 |
13 | #ifndef WEBP_ENC_DELTA_PALETTIZATION_H_
14 | #define WEBP_ENC_DELTA_PALETTIZATION_H_
15 |
16 | #include "../webp/encode.h"
17 | #include "../enc/vp8li_enc.h"
18 |
19 | // Replaces enc->argb_[] input by a palettizable approximation of it,
20 | // and generates optimal enc->palette_[].
21 | // This function can revert enc->use_palette_ / enc->use_predict_ flag
22 | // if delta-palettization is not producing expected saving.
23 | WebPEncodingError WebPSearchOptimalDeltaPalette(VP8LEncoder* const enc);
24 |
25 | #endif // WEBP_ENC_DELTA_PALETTIZATION_H_
26 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/enc/vp8li_enc.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Lossless encoder: internal header.
11 | //
12 | // Author: Vikas Arora (vikaas.arora@gmail.com)
13 |
14 | #ifndef WEBP_ENC_VP8LI_H_
15 | #define WEBP_ENC_VP8LI_H_
16 |
17 | #include "./backward_references_enc.h"
18 | #include "./histogram_enc.h"
19 | #include "../utils/bit_writer_utils.h"
20 | #include "../webp/encode.h"
21 | #include "../webp/format_constants.h"
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | // maximum value of transform_bits_ in VP8LEncoder.
28 | #define MAX_TRANSFORM_BITS 6
29 |
30 | typedef struct {
31 | const WebPConfig* config_; // user configuration and parameters
32 | const WebPPicture* pic_; // input picture.
33 |
34 | uint32_t* argb_; // Transformed argb image data.
35 | uint32_t* argb_scratch_; // Scratch memory for argb rows
36 | // (used for prediction).
37 | uint32_t* transform_data_; // Scratch memory for transform data.
38 | uint32_t* transform_mem_; // Currently allocated memory.
39 | size_t transform_mem_size_; // Currently allocated memory size.
40 |
41 | int current_width_; // Corresponds to packed image width.
42 |
43 | // Encoding parameters derived from quality parameter.
44 | int histo_bits_;
45 | int transform_bits_; // <= MAX_TRANSFORM_BITS.
46 | int cache_bits_; // If equal to 0, don't use color cache.
47 |
48 | // Encoding parameters derived from image characteristics.
49 | int use_cross_color_;
50 | int use_subtract_green_;
51 | int use_predict_;
52 | int use_palette_;
53 | int palette_size_;
54 | uint32_t palette_[MAX_PALETTE_SIZE];
55 |
56 | // Some 'scratch' (potentially large) objects.
57 | struct VP8LBackwardRefs refs_[2]; // Backward Refs array corresponding to
58 | // LZ77 & RLE coding.
59 | VP8LHashChain hash_chain_; // HashChain data for constructing
60 | // backward references.
61 | } VP8LEncoder;
62 |
63 | //------------------------------------------------------------------------------
64 | // internal functions. Not public.
65 |
66 | // Encodes the picture.
67 | // Returns 0 if config or picture is NULL or picture doesn't have valid argb
68 | // input.
69 | int VP8LEncodeImage(const WebPConfig* const config,
70 | const WebPPicture* const picture);
71 |
72 | // Encodes the main image stream using the supplied bit writer.
73 | // If 'use_cache' is false, disables the use of color cache.
74 | WebPEncodingError VP8LEncodeStream(const WebPConfig* const config,
75 | const WebPPicture* const picture,
76 | VP8LBitWriter* const bw, int use_cache);
77 |
78 | //------------------------------------------------------------------------------
79 | // Image transforms in predictor.c.
80 |
81 | void VP8LResidualImage(int width, int height, int bits, int low_effort,
82 | uint32_t* const argb, uint32_t* const argb_scratch,
83 | uint32_t* const image, int near_lossless, int exact,
84 | int used_subtract_green);
85 |
86 | void VP8LColorSpaceTransform(int width, int height, int bits, int quality,
87 | uint32_t* const argb, uint32_t* image);
88 |
89 | //------------------------------------------------------------------------------
90 |
91 | #ifdef __cplusplus
92 | } // extern "C"
93 | #endif
94 |
95 | #endif /* WEBP_ENC_VP8LI_H_ */
96 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/mux/animi.h:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Internal header for animation related functions.
11 | //
12 | // Author: Hui Su (huisu@google.com)
13 |
14 | #ifndef WEBP_MUX_ANIMI_H_
15 | #define WEBP_MUX_ANIMI_H_
16 |
17 | #include "../webp/mux.h"
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | // Picks the optimal rectangle between two pictures, starting with initial
24 | // values of offsets and dimensions that are passed in. The initial
25 | // values will be clipped, if necessary, to make sure the rectangle is
26 | // within the canvas. "use_argb" must be true for both pictures.
27 | // Parameters:
28 | // prev_canvas, curr_canvas - (in) two input pictures to compare.
29 | // is_lossless, quality - (in) encoding settings.
30 | // x_offset, y_offset, width, height - (in/out) rectangle between the two
31 | // input pictures.
32 | // Returns true on success.
33 | int WebPAnimEncoderRefineRect(
34 | const struct WebPPicture* const prev_canvas,
35 | const struct WebPPicture* const curr_canvas,
36 | int is_lossless, float quality, int* const x_offset, int* const y_offset,
37 | int* const width, int* const height);
38 |
39 | #ifdef __cplusplus
40 | } // extern "C"
41 | #endif
42 |
43 | #endif /* WEBP_MUX_ANIMI_H_ */
44 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/color_cache_utils.c:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Color Cache for WebP Lossless
11 | //
12 | // Author: Jyrki Alakuijala (jyrki@google.com)
13 |
14 | #include
15 | #include
16 | #include
17 | #include "./color_cache_utils.h"
18 | #include "./utils.h"
19 |
20 | //------------------------------------------------------------------------------
21 | // VP8LColorCache.
22 |
23 | int VP8LColorCacheInit(VP8LColorCache* const cc, int hash_bits) {
24 | const int hash_size = 1 << hash_bits;
25 | assert(cc != NULL);
26 | assert(hash_bits > 0);
27 | cc->colors_ = (uint32_t*)WebPSafeCalloc((uint64_t)hash_size,
28 | sizeof(*cc->colors_));
29 | if (cc->colors_ == NULL) return 0;
30 | cc->hash_shift_ = 32 - hash_bits;
31 | cc->hash_bits_ = hash_bits;
32 | return 1;
33 | }
34 |
35 | void VP8LColorCacheClear(VP8LColorCache* const cc) {
36 | if (cc != NULL) {
37 | WebPSafeFree(cc->colors_);
38 | cc->colors_ = NULL;
39 | }
40 | }
41 |
42 | void VP8LColorCacheCopy(const VP8LColorCache* const src,
43 | VP8LColorCache* const dst) {
44 | assert(src != NULL);
45 | assert(dst != NULL);
46 | assert(src->hash_bits_ == dst->hash_bits_);
47 | memcpy(dst->colors_, src->colors_,
48 | ((size_t)1u << dst->hash_bits_) * sizeof(*dst->colors_));
49 | }
50 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/color_cache_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Color Cache for WebP Lossless
11 | //
12 | // Authors: Jyrki Alakuijala (jyrki@google.com)
13 | // Urvang Joshi (urvang@google.com)
14 |
15 | #ifndef WEBP_UTILS_COLOR_CACHE_H_
16 | #define WEBP_UTILS_COLOR_CACHE_H_
17 |
18 | #include "../webp/types.h"
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | // Main color cache struct.
25 | typedef struct {
26 | uint32_t *colors_; // color entries
27 | int hash_shift_; // Hash shift: 32 - hash_bits_.
28 | int hash_bits_;
29 | } VP8LColorCache;
30 |
31 | static const uint64_t kHashMul = 0x1e35a7bdull;
32 |
33 | static WEBP_INLINE int HashPix(uint32_t argb, int shift) {
34 | return (int)(((argb * kHashMul) & 0xffffffffu) >> shift);
35 | }
36 |
37 | static WEBP_INLINE uint32_t VP8LColorCacheLookup(
38 | const VP8LColorCache* const cc, uint32_t key) {
39 | assert((key >> cc->hash_bits_) == 0u);
40 | return cc->colors_[key];
41 | }
42 |
43 | static WEBP_INLINE void VP8LColorCacheSet(const VP8LColorCache* const cc,
44 | uint32_t key, uint32_t argb) {
45 | assert((key >> cc->hash_bits_) == 0u);
46 | cc->colors_[key] = argb;
47 | }
48 |
49 | static WEBP_INLINE void VP8LColorCacheInsert(const VP8LColorCache* const cc,
50 | uint32_t argb) {
51 | const int key = HashPix(argb, cc->hash_shift_);
52 | cc->colors_[key] = argb;
53 | }
54 |
55 | static WEBP_INLINE int VP8LColorCacheGetIndex(const VP8LColorCache* const cc,
56 | uint32_t argb) {
57 | return HashPix(argb, cc->hash_shift_);
58 | }
59 |
60 | // Return the key if cc contains argb, and -1 otherwise.
61 | static WEBP_INLINE int VP8LColorCacheContains(const VP8LColorCache* const cc,
62 | uint32_t argb) {
63 | const int key = HashPix(argb, cc->hash_shift_);
64 | return (cc->colors_[key] == argb) ? key : -1;
65 | }
66 |
67 | //------------------------------------------------------------------------------
68 |
69 | // Initializes the color cache with 'hash_bits' bits for the keys.
70 | // Returns false in case of memory error.
71 | int VP8LColorCacheInit(VP8LColorCache* const color_cache, int hash_bits);
72 |
73 | void VP8LColorCacheCopy(const VP8LColorCache* const src,
74 | VP8LColorCache* const dst);
75 |
76 | // Delete the memory associated to color cache.
77 | void VP8LColorCacheClear(VP8LColorCache* const color_cache);
78 |
79 | //------------------------------------------------------------------------------
80 |
81 | #ifdef __cplusplus
82 | }
83 | #endif
84 |
85 | #endif // WEBP_UTILS_COLOR_CACHE_H_
86 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/endian_inl_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2014 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Endian related functions.
11 |
12 | #ifndef WEBP_UTILS_ENDIAN_INL_H_
13 | #define WEBP_UTILS_ENDIAN_INL_H_
14 |
15 | #ifdef HAVE_CONFIG_H
16 | #include "../webp/config.h"
17 | #endif
18 |
19 | #include "../dsp/dsp.h"
20 | #include "../webp/types.h"
21 |
22 | // some endian fix (e.g.: mips-gcc doesn't define __BIG_ENDIAN__)
23 | #if !defined(WORDS_BIGENDIAN) && \
24 | (defined(__BIG_ENDIAN__) || defined(_M_PPC) || \
25 | (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)))
26 | #define WORDS_BIGENDIAN
27 | #endif
28 |
29 | #if defined(WORDS_BIGENDIAN)
30 | #define HToLE32 BSwap32
31 | #define HToLE16 BSwap16
32 | #else
33 | #define HToLE32(x) (x)
34 | #define HToLE16(x) (x)
35 | #endif
36 |
37 | #if !defined(HAVE_CONFIG_H)
38 | #if LOCAL_GCC_PREREQ(4,8) || __has_builtin(__builtin_bswap16)
39 | #define HAVE_BUILTIN_BSWAP16
40 | #endif
41 | #if LOCAL_GCC_PREREQ(4,3) || __has_builtin(__builtin_bswap32)
42 | #define HAVE_BUILTIN_BSWAP32
43 | #endif
44 | #if LOCAL_GCC_PREREQ(4,3) || __has_builtin(__builtin_bswap64)
45 | #define HAVE_BUILTIN_BSWAP64
46 | #endif
47 | #endif // !HAVE_CONFIG_H
48 |
49 | static WEBP_INLINE uint16_t BSwap16(uint16_t x) {
50 | #if defined(HAVE_BUILTIN_BSWAP16)
51 | return __builtin_bswap16(x);
52 | #elif defined(_MSC_VER)
53 | return _byteswap_ushort(x);
54 | #else
55 | // gcc will recognize a 'rorw $8, ...' here:
56 | return (x >> 8) | ((x & 0xff) << 8);
57 | #endif // HAVE_BUILTIN_BSWAP16
58 | }
59 |
60 | static WEBP_INLINE uint32_t BSwap32(uint32_t x) {
61 | #if defined(WEBP_USE_MIPS32_R2)
62 | uint32_t ret;
63 | __asm__ volatile (
64 | "wsbh %[ret], %[x] \n\t"
65 | "rotr %[ret], %[ret], 16 \n\t"
66 | : [ret]"=r"(ret)
67 | : [x]"r"(x)
68 | );
69 | return ret;
70 | #elif defined(HAVE_BUILTIN_BSWAP32)
71 | return __builtin_bswap32(x);
72 | #elif defined(__i386__) || defined(__x86_64__)
73 | uint32_t swapped_bytes;
74 | __asm__ volatile("bswap %0" : "=r"(swapped_bytes) : "0"(x));
75 | return swapped_bytes;
76 | #elif defined(_MSC_VER)
77 | return (uint32_t)_byteswap_ulong(x);
78 | #else
79 | return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24);
80 | #endif // HAVE_BUILTIN_BSWAP32
81 | }
82 |
83 | static WEBP_INLINE uint64_t BSwap64(uint64_t x) {
84 | #if defined(HAVE_BUILTIN_BSWAP64)
85 | return __builtin_bswap64(x);
86 | #elif defined(__x86_64__)
87 | uint64_t swapped_bytes;
88 | __asm__ volatile("bswapq %0" : "=r"(swapped_bytes) : "0"(x));
89 | return swapped_bytes;
90 | #elif defined(_MSC_VER)
91 | return (uint64_t)_byteswap_uint64(x);
92 | #else // generic code for swapping 64-bit values (suggested by bdb@)
93 | x = ((x & 0xffffffff00000000ull) >> 32) | ((x & 0x00000000ffffffffull) << 32);
94 | x = ((x & 0xffff0000ffff0000ull) >> 16) | ((x & 0x0000ffff0000ffffull) << 16);
95 | x = ((x & 0xff00ff00ff00ff00ull) >> 8) | ((x & 0x00ff00ff00ff00ffull) << 8);
96 | return x;
97 | #endif // HAVE_BUILTIN_BSWAP64
98 | }
99 |
100 | #endif // WEBP_UTILS_ENDIAN_INL_H_
101 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/filters_utils.c:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // filter estimation
11 | //
12 | // Author: Urvang (urvang@google.com)
13 |
14 | #include "./filters_utils.h"
15 | #include
16 | #include
17 |
18 | // -----------------------------------------------------------------------------
19 | // Quick estimate of a potentially interesting filter mode to try.
20 |
21 | #define SMAX 16
22 | #define SDIFF(a, b) (abs((a) - (b)) >> 4) // Scoring diff, in [0..SMAX)
23 |
24 | static WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) {
25 | const int g = a + b - c;
26 | return ((g & ~0xff) == 0) ? g : (g < 0) ? 0 : 255; // clip to 8bit
27 | }
28 |
29 | WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data,
30 | int width, int height, int stride) {
31 | int i, j;
32 | int bins[WEBP_FILTER_LAST][SMAX];
33 | memset(bins, 0, sizeof(bins));
34 |
35 | // We only sample every other pixels. That's enough.
36 | for (j = 2; j < height - 1; j += 2) {
37 | const uint8_t* const p = data + j * stride;
38 | int mean = p[0];
39 | for (i = 2; i < width - 1; i += 2) {
40 | const int diff0 = SDIFF(p[i], mean);
41 | const int diff1 = SDIFF(p[i], p[i - 1]);
42 | const int diff2 = SDIFF(p[i], p[i - width]);
43 | const int grad_pred =
44 | GradientPredictor(p[i - 1], p[i - width], p[i - width - 1]);
45 | const int diff3 = SDIFF(p[i], grad_pred);
46 | bins[WEBP_FILTER_NONE][diff0] = 1;
47 | bins[WEBP_FILTER_HORIZONTAL][diff1] = 1;
48 | bins[WEBP_FILTER_VERTICAL][diff2] = 1;
49 | bins[WEBP_FILTER_GRADIENT][diff3] = 1;
50 | mean = (3 * mean + p[i] + 2) >> 2;
51 | }
52 | }
53 | {
54 | int filter;
55 | WEBP_FILTER_TYPE best_filter = WEBP_FILTER_NONE;
56 | int best_score = 0x7fffffff;
57 | for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) {
58 | int score = 0;
59 | for (i = 0; i < SMAX; ++i) {
60 | if (bins[filter][i] > 0) {
61 | score += i;
62 | }
63 | }
64 | if (score < best_score) {
65 | best_score = score;
66 | best_filter = (WEBP_FILTER_TYPE)filter;
67 | }
68 | }
69 | return best_filter;
70 | }
71 | }
72 |
73 | #undef SMAX
74 | #undef SDIFF
75 |
76 | //------------------------------------------------------------------------------
77 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/filters_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Spatial prediction using various filters
11 | //
12 | // Author: Urvang (urvang@google.com)
13 |
14 | #ifndef WEBP_UTILS_FILTERS_H_
15 | #define WEBP_UTILS_FILTERS_H_
16 |
17 | #include "../webp/types.h"
18 | #include "../dsp/dsp.h"
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | // Fast estimate of a potentially good filter.
25 | WEBP_FILTER_TYPE WebPEstimateBestFilter(const uint8_t* data,
26 | int width, int height, int stride);
27 |
28 | #ifdef __cplusplus
29 | } // extern "C"
30 | #endif
31 |
32 | #endif /* WEBP_UTILS_FILTERS_H_ */
33 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/huffman_encode_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Author: Jyrki Alakuijala (jyrki@google.com)
11 | //
12 | // Entropy encoding (Huffman) for webp lossless
13 |
14 | #ifndef WEBP_UTILS_HUFFMAN_ENCODE_H_
15 | #define WEBP_UTILS_HUFFMAN_ENCODE_H_
16 |
17 | #include "../webp/types.h"
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | // Struct for holding the tree header in coded form.
24 | typedef struct {
25 | uint8_t code; // value (0..15) or escape code (16,17,18)
26 | uint8_t extra_bits; // extra bits for escape codes
27 | } HuffmanTreeToken;
28 |
29 | // Struct to represent the tree codes (depth and bits array).
30 | typedef struct {
31 | int num_symbols; // Number of symbols.
32 | uint8_t* code_lengths; // Code lengths of the symbols.
33 | uint16_t* codes; // Symbol Codes.
34 | } HuffmanTreeCode;
35 |
36 | // Struct to represent the Huffman tree.
37 | typedef struct {
38 | uint32_t total_count_; // Symbol frequency.
39 | int value_; // Symbol value.
40 | int pool_index_left_; // Index for the left sub-tree.
41 | int pool_index_right_; // Index for the right sub-tree.
42 | } HuffmanTree;
43 |
44 | // Turn the Huffman tree into a token sequence.
45 | // Returns the number of tokens used.
46 | int VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree,
47 | HuffmanTreeToken* tokens, int max_tokens);
48 |
49 | // Create an optimized tree, and tokenize it.
50 | // 'buf_rle' and 'huff_tree' are pre-allocated and the 'tree' is the constructed
51 | // huffman code tree.
52 | void VP8LCreateHuffmanTree(uint32_t* const histogram, int tree_depth_limit,
53 | uint8_t* const buf_rle, HuffmanTree* const huff_tree,
54 | HuffmanTreeCode* const tree);
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 | #endif // WEBP_UTILS_HUFFMAN_ENCODE_H_
61 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/huffman_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Utilities for building and looking up Huffman trees.
11 | //
12 | // Author: Urvang Joshi (urvang@google.com)
13 |
14 | #ifndef WEBP_UTILS_HUFFMAN_H_
15 | #define WEBP_UTILS_HUFFMAN_H_
16 |
17 | #include
18 | #include "../webp/format_constants.h"
19 | #include "../webp/types.h"
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | #define HUFFMAN_TABLE_BITS 8
26 | #define HUFFMAN_TABLE_MASK ((1 << HUFFMAN_TABLE_BITS) - 1)
27 |
28 | #define LENGTHS_TABLE_BITS 7
29 | #define LENGTHS_TABLE_MASK ((1 << LENGTHS_TABLE_BITS) - 1)
30 |
31 |
32 | // Huffman lookup table entry
33 | typedef struct {
34 | uint8_t bits; // number of bits used for this symbol
35 | uint16_t value; // symbol value or table offset
36 | } HuffmanCode;
37 |
38 | // long version for holding 32b values
39 | typedef struct {
40 | int bits; // number of bits used for this symbol,
41 | // or an impossible value if not a literal code.
42 | uint32_t value; // 32b packed ARGB value if literal,
43 | // or non-literal symbol otherwise
44 | } HuffmanCode32;
45 |
46 | #define HUFFMAN_PACKED_BITS 6
47 | #define HUFFMAN_PACKED_TABLE_SIZE (1u << HUFFMAN_PACKED_BITS)
48 |
49 | // Huffman table group.
50 | // Includes special handling for the following cases:
51 | // - is_trivial_literal: one common literal base for RED/BLUE/ALPHA (not GREEN)
52 | // - is_trivial_code: only 1 code (no bit is read from bitstream)
53 | // - use_packed_table: few enough literal symbols, so all the bit codes
54 | // can fit into a small look-up table packed_table[]
55 | // The common literal base, if applicable, is stored in 'literal_arb'.
56 | typedef struct HTreeGroup HTreeGroup;
57 | struct HTreeGroup {
58 | HuffmanCode* htrees[HUFFMAN_CODES_PER_META_CODE];
59 | int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha
60 | // Symbols are trivial (have a single code).
61 | uint32_t literal_arb; // If is_trivial_literal is true, this is the
62 | // ARGB value of the pixel, with Green channel
63 | // being set to zero.
64 | int is_trivial_code; // true if is_trivial_literal with only one code
65 | int use_packed_table; // use packed table below for short literal code
66 | // table mapping input bits to a packed values, or escape case to literal code
67 | HuffmanCode32 packed_table[HUFFMAN_PACKED_TABLE_SIZE];
68 | };
69 |
70 | // Creates the instance of HTreeGroup with specified number of tree-groups.
71 | HTreeGroup* VP8LHtreeGroupsNew(int num_htree_groups);
72 |
73 | // Releases the memory allocated for HTreeGroup.
74 | void VP8LHtreeGroupsFree(HTreeGroup* const htree_groups);
75 |
76 | // Builds Huffman lookup table assuming code lengths are in symbol order.
77 | // The 'code_lengths' is pre-allocated temporary memory buffer used for creating
78 | // the huffman table.
79 | // Returns built table size or 0 in case of error (invalid tree or
80 | // memory error).
81 | int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
82 | const int code_lengths[], int code_lengths_size);
83 |
84 | #ifdef __cplusplus
85 | } // extern "C"
86 | #endif
87 |
88 | #endif // WEBP_UTILS_HUFFMAN_H_
89 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/quant_levels_dec_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Alpha plane de-quantization utility
11 | //
12 | // Author: Vikas Arora (vikasa@google.com)
13 |
14 | #ifndef WEBP_UTILS_QUANT_LEVELS_DEC_H_
15 | #define WEBP_UTILS_QUANT_LEVELS_DEC_H_
16 |
17 | #include "../webp/types.h"
18 |
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | // Apply post-processing to input 'data' of size 'width'x'height' assuming that
24 | // the source was quantized to a reduced number of levels. 'stride' is in bytes.
25 | // Strength is in [0..100] and controls the amount of dithering applied.
26 | // Returns false in case of error (data is NULL, invalid parameters,
27 | // malloc failure, ...).
28 | int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride,
29 | int strength);
30 |
31 | #ifdef __cplusplus
32 | } // extern "C"
33 | #endif
34 |
35 | #endif /* WEBP_UTILS_QUANT_LEVELS_DEC_H_ */
36 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/quant_levels_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Alpha plane quantization utility
11 | //
12 | // Author: Vikas Arora (vikasa@google.com)
13 |
14 | #ifndef WEBP_UTILS_QUANT_LEVELS_H_
15 | #define WEBP_UTILS_QUANT_LEVELS_H_
16 |
17 | #include
18 |
19 | #include "../webp/types.h"
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | // Replace the input 'data' of size 'width'x'height' with 'num-levels'
26 | // quantized values. If not NULL, 'sse' will contain the sum of squared error.
27 | // Valid range for 'num_levels' is [2, 256].
28 | // Returns false in case of error (data is NULL, or parameters are invalid).
29 | int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,
30 | uint64_t* const sse);
31 |
32 | #ifdef __cplusplus
33 | } // extern "C"
34 | #endif
35 |
36 | #endif /* WEBP_UTILS_QUANT_LEVELS_H_ */
37 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/random_utils.c:
--------------------------------------------------------------------------------
1 | // Copyright 2013 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Pseudo-random utilities
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #include
15 | #include "./random_utils.h"
16 |
17 | //------------------------------------------------------------------------------
18 |
19 | // 31b-range values
20 | static const uint32_t kRandomTable[VP8_RANDOM_TABLE_SIZE] = {
21 | 0x0de15230, 0x03b31886, 0x775faccb, 0x1c88626a, 0x68385c55, 0x14b3b828,
22 | 0x4a85fef8, 0x49ddb84b, 0x64fcf397, 0x5c550289, 0x4a290000, 0x0d7ec1da,
23 | 0x5940b7ab, 0x5492577d, 0x4e19ca72, 0x38d38c69, 0x0c01ee65, 0x32a1755f,
24 | 0x5437f652, 0x5abb2c32, 0x0faa57b1, 0x73f533e7, 0x685feeda, 0x7563cce2,
25 | 0x6e990e83, 0x4730a7ed, 0x4fc0d9c6, 0x496b153c, 0x4f1403fa, 0x541afb0c,
26 | 0x73990b32, 0x26d7cb1c, 0x6fcc3706, 0x2cbb77d8, 0x75762f2a, 0x6425ccdd,
27 | 0x24b35461, 0x0a7d8715, 0x220414a8, 0x141ebf67, 0x56b41583, 0x73e502e3,
28 | 0x44cab16f, 0x28264d42, 0x73baaefb, 0x0a50ebed, 0x1d6ab6fb, 0x0d3ad40b,
29 | 0x35db3b68, 0x2b081e83, 0x77ce6b95, 0x5181e5f0, 0x78853bbc, 0x009f9494,
30 | 0x27e5ed3c
31 | };
32 |
33 | void VP8InitRandom(VP8Random* const rg, float dithering) {
34 | memcpy(rg->tab_, kRandomTable, sizeof(rg->tab_));
35 | rg->index1_ = 0;
36 | rg->index2_ = 31;
37 | rg->amp_ = (dithering < 0.0) ? 0
38 | : (dithering > 1.0) ? (1 << VP8_RANDOM_DITHER_FIX)
39 | : (uint32_t)((1 << VP8_RANDOM_DITHER_FIX) * dithering);
40 | }
41 |
42 | //------------------------------------------------------------------------------
43 |
44 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/random_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Pseudo-random utilities
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_UTILS_RANDOM_H_
15 | #define WEBP_UTILS_RANDOM_H_
16 |
17 | #include
18 | #include "../webp/types.h"
19 |
20 | #ifdef __cplusplus
21 | extern "C" {
22 | #endif
23 |
24 | #define VP8_RANDOM_DITHER_FIX 8 // fixed-point precision for dithering
25 | #define VP8_RANDOM_TABLE_SIZE 55
26 |
27 | typedef struct {
28 | int index1_, index2_;
29 | uint32_t tab_[VP8_RANDOM_TABLE_SIZE];
30 | int amp_;
31 | } VP8Random;
32 |
33 | // Initializes random generator with an amplitude 'dithering' in range [0..1].
34 | void VP8InitRandom(VP8Random* const rg, float dithering);
35 |
36 | // Returns a centered pseudo-random number with 'num_bits' amplitude.
37 | // (uses D.Knuth's Difference-based random generator).
38 | // 'amp' is in VP8_RANDOM_DITHER_FIX fixed-point precision.
39 | static WEBP_INLINE int VP8RandomBits2(VP8Random* const rg, int num_bits,
40 | int amp) {
41 | int diff;
42 | assert(num_bits + VP8_RANDOM_DITHER_FIX <= 31);
43 | diff = rg->tab_[rg->index1_] - rg->tab_[rg->index2_];
44 | if (diff < 0) diff += (1u << 31);
45 | rg->tab_[rg->index1_] = diff;
46 | if (++rg->index1_ == VP8_RANDOM_TABLE_SIZE) rg->index1_ = 0;
47 | if (++rg->index2_ == VP8_RANDOM_TABLE_SIZE) rg->index2_ = 0;
48 | // sign-extend, 0-center
49 | diff = (int)((uint32_t)diff << 1) >> (32 - num_bits);
50 | diff = (diff * amp) >> VP8_RANDOM_DITHER_FIX; // restrict range
51 | diff += 1 << (num_bits - 1); // shift back to 0.5-center
52 | return diff;
53 | }
54 |
55 | static WEBP_INLINE int VP8RandomBits(VP8Random* const rg, int num_bits) {
56 | return VP8RandomBits2(rg, num_bits, rg->amp_);
57 | }
58 |
59 | #ifdef __cplusplus
60 | } // extern "C"
61 | #endif
62 |
63 | #endif /* WEBP_UTILS_RANDOM_H_ */
64 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/rescaler_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Rescaling functions
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_UTILS_RESCALER_H_
15 | #define WEBP_UTILS_RESCALER_H_
16 |
17 | #ifdef __cplusplus
18 | extern "C" {
19 | #endif
20 |
21 | #include "../webp/types.h"
22 |
23 | #define WEBP_RESCALER_RFIX 32 // fixed-point precision for multiplies
24 | #define WEBP_RESCALER_ONE (1ull << WEBP_RESCALER_RFIX)
25 | #define WEBP_RESCALER_FRAC(x, y) \
26 | ((uint32_t)(((uint64_t)(x) << WEBP_RESCALER_RFIX) / (y)))
27 |
28 | // Structure used for on-the-fly rescaling
29 | typedef uint32_t rescaler_t; // type for side-buffer
30 | typedef struct WebPRescaler WebPRescaler;
31 | struct WebPRescaler {
32 | int x_expand; // true if we're expanding in the x direction
33 | int y_expand; // true if we're expanding in the y direction
34 | int num_channels; // bytes to jump between pixels
35 | uint32_t fx_scale; // fixed-point scaling factors
36 | uint32_t fy_scale; // ''
37 | uint32_t fxy_scale; // ''
38 | int y_accum; // vertical accumulator
39 | int y_add, y_sub; // vertical increments
40 | int x_add, x_sub; // horizontal increments
41 | int src_width, src_height; // source dimensions
42 | int dst_width, dst_height; // destination dimensions
43 | int src_y, dst_y; // row counters for input and output
44 | uint8_t* dst;
45 | int dst_stride;
46 | rescaler_t* irow, *frow; // work buffer
47 | };
48 |
49 | // Initialize a rescaler given scratch area 'work' and dimensions of src & dst.
50 | void WebPRescalerInit(WebPRescaler* const rescaler,
51 | int src_width, int src_height,
52 | uint8_t* const dst,
53 | int dst_width, int dst_height, int dst_stride,
54 | int num_channels,
55 | rescaler_t* const work);
56 |
57 | // If either 'scaled_width' or 'scaled_height' (but not both) is 0 the value
58 | // will be calculated preserving the aspect ratio, otherwise the values are
59 | // left unmodified. Returns true on success, false if either value is 0 after
60 | // performing the scaling calculation.
61 | int WebPRescalerGetScaledDimensions(int src_width, int src_height,
62 | int* const scaled_width,
63 | int* const scaled_height);
64 |
65 | // Returns the number of input lines needed next to produce one output line,
66 | // considering that the maximum available input lines are 'max_num_lines'.
67 | int WebPRescaleNeededLines(const WebPRescaler* const rescaler,
68 | int max_num_lines);
69 |
70 | // Import multiple rows over all channels, until at least one row is ready to
71 | // be exported. Returns the actual number of lines that were imported.
72 | int WebPRescalerImport(WebPRescaler* const rescaler, int num_rows,
73 | const uint8_t* src, int src_stride);
74 |
75 | // Export as many rows as possible. Return the numbers of rows written.
76 | int WebPRescalerExport(WebPRescaler* const rescaler);
77 |
78 | // Return true if input is finished
79 | static WEBP_INLINE
80 | int WebPRescalerInputDone(const WebPRescaler* const rescaler) {
81 | return (rescaler->src_y >= rescaler->src_height);
82 | }
83 | // Return true if output is finished
84 | static WEBP_INLINE
85 | int WebPRescalerOutputDone(const WebPRescaler* const rescaler) {
86 | return (rescaler->dst_y >= rescaler->dst_height);
87 | }
88 |
89 | // Return true if there are pending output rows ready.
90 | static WEBP_INLINE
91 | int WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) {
92 | return !WebPRescalerOutputDone(rescaler) && (rescaler->y_accum <= 0);
93 | }
94 |
95 | //------------------------------------------------------------------------------
96 |
97 | #ifdef __cplusplus
98 | } // extern "C"
99 | #endif
100 |
101 | #endif /* WEBP_UTILS_RESCALER_H_ */
102 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/utils/thread_utils.h:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Multi-threaded worker
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_UTILS_THREAD_H_
15 | #define WEBP_UTILS_THREAD_H_
16 |
17 | #ifdef HAVE_CONFIG_H
18 | #include "../webp/config.h"
19 | #endif
20 |
21 | #include "../webp/types.h"
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | // State of the worker thread object
28 | typedef enum {
29 | NOT_OK = 0, // object is unusable
30 | OK, // ready to work
31 | WORK // busy finishing the current task
32 | } WebPWorkerStatus;
33 |
34 | // Function to be called by the worker thread. Takes two opaque pointers as
35 | // arguments (data1 and data2), and should return false in case of error.
36 | typedef int (*WebPWorkerHook)(void*, void*);
37 |
38 | // Platform-dependent implementation details for the worker.
39 | typedef struct WebPWorkerImpl WebPWorkerImpl;
40 |
41 | // Synchronization object used to launch job in the worker thread
42 | typedef struct {
43 | WebPWorkerImpl* impl_;
44 | WebPWorkerStatus status_;
45 | WebPWorkerHook hook; // hook to call
46 | void* data1; // first argument passed to 'hook'
47 | void* data2; // second argument passed to 'hook'
48 | int had_error; // return value of the last call to 'hook'
49 | } WebPWorker;
50 |
51 | // The interface for all thread-worker related functions. All these functions
52 | // must be implemented.
53 | typedef struct {
54 | // Must be called first, before any other method.
55 | void (*Init)(WebPWorker* const worker);
56 | // Must be called to initialize the object and spawn the thread. Re-entrant.
57 | // Will potentially launch the thread. Returns false in case of error.
58 | int (*Reset)(WebPWorker* const worker);
59 | // Makes sure the previous work is finished. Returns true if worker->had_error
60 | // was not set and no error condition was triggered by the working thread.
61 | int (*Sync)(WebPWorker* const worker);
62 | // Triggers the thread to call hook() with data1 and data2 arguments. These
63 | // hook/data1/data2 values can be changed at any time before calling this
64 | // function, but not be changed afterward until the next call to Sync().
65 | void (*Launch)(WebPWorker* const worker);
66 | // This function is similar to Launch() except that it calls the
67 | // hook directly instead of using a thread. Convenient to bypass the thread
68 | // mechanism while still using the WebPWorker structs. Sync() must
69 | // still be called afterward (for error reporting).
70 | void (*Execute)(WebPWorker* const worker);
71 | // Kill the thread and terminate the object. To use the object again, one
72 | // must call Reset() again.
73 | void (*End)(WebPWorker* const worker);
74 | } WebPWorkerInterface;
75 |
76 | // Install a new set of threading functions, overriding the defaults. This
77 | // should be done before any workers are started, i.e., before any encoding or
78 | // decoding takes place. The contents of the interface struct are copied, it
79 | // is safe to free the corresponding memory after this call. This function is
80 | // not thread-safe. Return false in case of invalid pointer or methods.
81 | WEBP_EXTERN(int) WebPSetWorkerInterface(
82 | const WebPWorkerInterface* const winterface);
83 |
84 | // Retrieve the currently set thread worker interface.
85 | WEBP_EXTERN(const WebPWorkerInterface*) WebPGetWorkerInterface(void);
86 |
87 | //------------------------------------------------------------------------------
88 |
89 | #ifdef __cplusplus
90 | } // extern "C"
91 | #endif
92 |
93 | #endif /* WEBP_UTILS_THREAD_H_ */
94 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/webp/format_constants.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Internal header for constants related to WebP file format.
11 | //
12 | // Author: Urvang (urvang@google.com)
13 |
14 | #ifndef WEBP_WEBP_FORMAT_CONSTANTS_H_
15 | #define WEBP_WEBP_FORMAT_CONSTANTS_H_
16 |
17 | // Create fourcc of the chunk from the chunk tag characters.
18 | #define MKFOURCC(a, b, c, d) ((a) | (b) << 8 | (c) << 16 | (uint32_t)(d) << 24)
19 |
20 | // VP8 related constants.
21 | #define VP8_SIGNATURE 0x9d012a // Signature in VP8 data.
22 | #define VP8_MAX_PARTITION0_SIZE (1 << 19) // max size of mode partition
23 | #define VP8_MAX_PARTITION_SIZE (1 << 24) // max size for token partition
24 | #define VP8_FRAME_HEADER_SIZE 10 // Size of the frame header within VP8 data.
25 |
26 | // VP8L related constants.
27 | #define VP8L_SIGNATURE_SIZE 1 // VP8L signature size.
28 | #define VP8L_MAGIC_BYTE 0x2f // VP8L signature byte.
29 | #define VP8L_IMAGE_SIZE_BITS 14 // Number of bits used to store
30 | // width and height.
31 | #define VP8L_VERSION_BITS 3 // 3 bits reserved for version.
32 | #define VP8L_VERSION 0 // version 0
33 | #define VP8L_FRAME_HEADER_SIZE 5 // Size of the VP8L frame header.
34 |
35 | #define MAX_PALETTE_SIZE 256
36 | #define MAX_CACHE_BITS 11
37 | #define HUFFMAN_CODES_PER_META_CODE 5
38 | #define ARGB_BLACK 0xff000000
39 |
40 | #define DEFAULT_CODE_LENGTH 8
41 | #define MAX_ALLOWED_CODE_LENGTH 15
42 |
43 | #define NUM_LITERAL_CODES 256
44 | #define NUM_LENGTH_CODES 24
45 | #define NUM_DISTANCE_CODES 40
46 | #define CODE_LENGTH_CODES 19
47 |
48 | #define MIN_HUFFMAN_BITS 2 // min number of Huffman bits
49 | #define MAX_HUFFMAN_BITS 9 // max number of Huffman bits
50 |
51 | #define TRANSFORM_PRESENT 1 // The bit to be written when next data
52 | // to be read is a transform.
53 | #define NUM_TRANSFORMS 4 // Maximum number of allowed transform
54 | // in a bitstream.
55 | typedef enum {
56 | PREDICTOR_TRANSFORM = 0,
57 | CROSS_COLOR_TRANSFORM = 1,
58 | SUBTRACT_GREEN = 2,
59 | COLOR_INDEXING_TRANSFORM = 3
60 | } VP8LImageTransformType;
61 |
62 | // Alpha related constants.
63 | #define ALPHA_HEADER_LEN 1
64 | #define ALPHA_NO_COMPRESSION 0
65 | #define ALPHA_LOSSLESS_COMPRESSION 1
66 | #define ALPHA_PREPROCESSED_LEVELS 1
67 |
68 | // Mux related constants.
69 | #define TAG_SIZE 4 // Size of a chunk tag (e.g. "VP8L").
70 | #define CHUNK_SIZE_BYTES 4 // Size needed to store chunk's size.
71 | #define CHUNK_HEADER_SIZE 8 // Size of a chunk header.
72 | #define RIFF_HEADER_SIZE 12 // Size of the RIFF header ("RIFFnnnnWEBP").
73 | #define ANMF_CHUNK_SIZE 16 // Size of an ANMF chunk.
74 | #define ANIM_CHUNK_SIZE 6 // Size of an ANIM chunk.
75 | #define VP8X_CHUNK_SIZE 10 // Size of a VP8X chunk.
76 |
77 | #define MAX_CANVAS_SIZE (1 << 24) // 24-bit max for VP8X width/height.
78 | #define MAX_IMAGE_AREA (1ULL << 32) // 32-bit max for width x height.
79 | #define MAX_LOOP_COUNT (1 << 16) // maximum value for loop-count
80 | #define MAX_DURATION (1 << 24) // maximum duration
81 | #define MAX_POSITION_OFFSET (1 << 24) // maximum frame x/y offset
82 |
83 | // Maximum chunk payload is such that adding the header and padding won't
84 | // overflow a uint32_t.
85 | #define MAX_CHUNK_PAYLOAD (~0U - CHUNK_HEADER_SIZE - 1)
86 |
87 | #endif /* WEBP_WEBP_FORMAT_CONSTANTS_H_ */
88 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/webp/mux_types.h:
--------------------------------------------------------------------------------
1 | // Copyright 2012 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Data-types common to the mux and demux libraries.
11 | //
12 | // Author: Urvang (urvang@google.com)
13 |
14 | #ifndef WEBP_WEBP_MUX_TYPES_H_
15 | #define WEBP_WEBP_MUX_TYPES_H_
16 |
17 | #include // free()
18 | #include // memset()
19 | #include "./types.h"
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | // Note: forward declaring enumerations is not allowed in (strict) C and C++,
26 | // the types are left here for reference.
27 | // typedef enum WebPFeatureFlags WebPFeatureFlags;
28 | // typedef enum WebPMuxAnimDispose WebPMuxAnimDispose;
29 | // typedef enum WebPMuxAnimBlend WebPMuxAnimBlend;
30 | typedef struct WebPData WebPData;
31 |
32 | // VP8X Feature Flags.
33 | typedef enum WebPFeatureFlags {
34 | ANIMATION_FLAG = 0x00000002,
35 | XMP_FLAG = 0x00000004,
36 | EXIF_FLAG = 0x00000008,
37 | ALPHA_FLAG = 0x00000010,
38 | ICCP_FLAG = 0x00000020,
39 |
40 | ALL_VALID_FLAGS = 0x0000003e
41 | } WebPFeatureFlags;
42 |
43 | // Dispose method (animation only). Indicates how the area used by the current
44 | // frame is to be treated before rendering the next frame on the canvas.
45 | typedef enum WebPMuxAnimDispose {
46 | WEBP_MUX_DISPOSE_NONE, // Do not dispose.
47 | WEBP_MUX_DISPOSE_BACKGROUND // Dispose to background color.
48 | } WebPMuxAnimDispose;
49 |
50 | // Blend operation (animation only). Indicates how transparent pixels of the
51 | // current frame are blended with those of the previous canvas.
52 | typedef enum WebPMuxAnimBlend {
53 | WEBP_MUX_BLEND, // Blend.
54 | WEBP_MUX_NO_BLEND // Do not blend.
55 | } WebPMuxAnimBlend;
56 |
57 | // Data type used to describe 'raw' data, e.g., chunk data
58 | // (ICC profile, metadata) and WebP compressed image data.
59 | struct WebPData {
60 | const uint8_t* bytes;
61 | size_t size;
62 | };
63 |
64 | // Initializes the contents of the 'webp_data' object with default values.
65 | static WEBP_INLINE void WebPDataInit(WebPData* webp_data) {
66 | if (webp_data != NULL) {
67 | memset(webp_data, 0, sizeof(*webp_data));
68 | }
69 | }
70 |
71 | // Clears the contents of the 'webp_data' object by calling free(). Does not
72 | // deallocate the object itself.
73 | static WEBP_INLINE void WebPDataClear(WebPData* webp_data) {
74 | if (webp_data != NULL) {
75 | free((void*)webp_data->bytes);
76 | WebPDataInit(webp_data);
77 | }
78 | }
79 |
80 | // Allocates necessary storage for 'dst' and copies the contents of 'src'.
81 | // Returns true on success.
82 | static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) {
83 | if (src == NULL || dst == NULL) return 0;
84 | WebPDataInit(dst);
85 | if (src->bytes != NULL && src->size != 0) {
86 | dst->bytes = (uint8_t*)malloc(src->size);
87 | if (dst->bytes == NULL) return 0;
88 | memcpy((void*)dst->bytes, src->bytes, src->size);
89 | dst->size = src->size;
90 | }
91 | return 1;
92 | }
93 |
94 | #ifdef __cplusplus
95 | } // extern "C"
96 | #endif
97 |
98 | #endif /* WEBP_WEBP_MUX_TYPES_H_ */
99 |
--------------------------------------------------------------------------------
/Pods/libwebp/src/webp/types.h:
--------------------------------------------------------------------------------
1 | // Copyright 2010 Google Inc. All Rights Reserved.
2 | //
3 | // Use of this source code is governed by a BSD-style license
4 | // that can be found in the COPYING file in the root of the source
5 | // tree. An additional intellectual property rights grant can be found
6 | // in the file PATENTS. All contributing project authors may
7 | // be found in the AUTHORS file in the root of the source tree.
8 | // -----------------------------------------------------------------------------
9 | //
10 | // Common types
11 | //
12 | // Author: Skal (pascal.massimino@gmail.com)
13 |
14 | #ifndef WEBP_WEBP_TYPES_H_
15 | #define WEBP_WEBP_TYPES_H_
16 |
17 | #include // for size_t
18 |
19 | #ifndef _MSC_VER
20 | #include
21 | #if defined(__cplusplus) || !defined(__STRICT_ANSI__) || \
22 | (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
23 | #define WEBP_INLINE inline
24 | #else
25 | #define WEBP_INLINE
26 | #endif
27 | #else
28 | typedef signed char int8_t;
29 | typedef unsigned char uint8_t;
30 | typedef signed short int16_t;
31 | typedef unsigned short uint16_t;
32 | typedef signed int int32_t;
33 | typedef unsigned int uint32_t;
34 | typedef unsigned long long int uint64_t;
35 | typedef long long int int64_t;
36 | #define WEBP_INLINE __forceinline
37 | #endif /* _MSC_VER */
38 |
39 | #ifndef WEBP_EXTERN
40 | // This explicitly marks library functions and allows for changing the
41 | // signature for e.g., Windows DLL builds.
42 | # if defined(__GNUC__) && __GNUC__ >= 4
43 | # define WEBP_EXTERN(type) extern __attribute__ ((visibility ("default"))) type
44 | # else
45 | # define WEBP_EXTERN(type) extern type
46 | # endif /* __GNUC__ >= 4 */
47 | #endif /* WEBP_EXTERN */
48 |
49 | // Macro to check ABI compatibility (same major revision number)
50 | #define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))
51 |
52 | #endif /* WEBP_WEBP_TYPES_H_ */
53 |
--------------------------------------------------------------------------------