File tree Expand file tree Collapse file tree
SDWebImageAVIFCoder/Classes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88@import XCTest;
99
1010#import < SDWebImageAVIFCoder/SDImageAVIFCoder.h>
11+ #import < SDWebImageAVIFCoder/Conversion.h>
12+ #import < SDWebImageAVIFCoder/ColorSpace.h>
1113
1214static UInt8 kBlack8 [] = {0 ,0 ,0 };
1315static UInt8 kGray8 [] = {0x88 ,0x88 ,0x88 };
@@ -152,6 +154,25 @@ - (void)testSpecialTest
152154 expectedColor16: kSpecial16 expectedNumComponents16: 3 ];
153155}
154156
157+ -(void )testAllColorSpaceSupportsOutput
158+ {
159+ static avifNclxColourPrimaries const numPrimaries = AVIF_NCLX_COLOUR_PRIMARIES_EBU3213E;
160+ static avifNclxTransferCharacteristics const numTransfers = AVIF_NCLX_TRANSFER_CHARACTERISTICS_BT2100_HLG;
161+ for (avifNclxColourPrimaries primaries = 0 ; primaries < numPrimaries; ++primaries) {
162+ for (avifNclxTransferCharacteristics transfer = 0 ; transfer < numTransfers; ++transfer) {
163+ CGColorSpaceRef space = NULL ;
164+
165+ space = CreateColorSpaceRGB (primaries, transfer);
166+ XCTAssertTrue (CGColorSpaceSupportsOutput (space));
167+ CGColorSpaceRelease (space);
168+
169+ space = CreateColorSpaceMono (primaries, transfer);
170+ XCTAssertTrue (CGColorSpaceSupportsOutput (space));
171+ CGColorSpaceRelease (space);
172+ }
173+
174+ }
175+ }
155176
156177-(void )assertColor8 : (NSString *)filename img : (CGImageRef)img expectedColor : (UInt8*)expectedColor
157178{
Original file line number Diff line number Diff line change 66//
77
88#pragma once
9+ #if __has_include(<libavif/avif.h>)
10+ #import < libavif/avif.h>
11+ #else
12+ #import " avif/avif.h"
13+ #endif
14+
915CGImageRef CreateCGImageFromAVIF (avifImage * avif);
You can’t perform that action at this time.
0 commit comments