()
| 46 | } |
| 47 | |
| 48 | func (s *FlattenTestSuite) TestBackground() { |
| 49 | testCases := []testCase[flattenTestCase]{ |
| 50 | // Basic background tests with 32-bpp-with-alpha.bmp |
| 51 | { |
| 52 | opts: flattenTestCase{ |
| 53 | name: "32-bpp-red-jpeg", |
| 54 | sourceFile: "test-images/bmp/32-bpp-with-alpha.bmp", |
| 55 | background: &color.Red, |
| 56 | format: imagetype.JPEG, |
| 57 | }, |
| 58 | outSize: flattenTestOutSize, |
| 59 | }, |
| 60 | { |
| 61 | opts: flattenTestCase{ |
| 62 | name: "32-bpp-red-png", |
| 63 | sourceFile: "test-images/bmp/32-bpp-with-alpha.bmp", |
| 64 | background: &color.Red, |
| 65 | format: imagetype.PNG, |
| 66 | }, |
| 67 | outSize: flattenTestOutSize, |
| 68 | }, |
| 69 | { |
| 70 | opts: flattenTestCase{ |
| 71 | name: "32-bpp-none-jpeg", |
| 72 | sourceFile: "test-images/bmp/32-bpp-with-alpha.bmp", |
| 73 | background: nil, |
| 74 | format: imagetype.JPEG, |
| 75 | }, |
| 76 | outSize: flattenTestOutSize, |
| 77 | }, |
| 78 | { |
| 79 | opts: flattenTestCase{ |
| 80 | name: "32-bpp-none-png", |
| 81 | sourceFile: "test-images/bmp/32-bpp-with-alpha.bmp", |
| 82 | background: nil, |
| 83 | format: imagetype.PNG, |
| 84 | }, |
| 85 | outSize: flattenTestOutSize, |
| 86 | }, |
| 87 | // RGB16 source should stay RGB16 |
| 88 | { |
| 89 | opts: flattenTestCase{ |
| 90 | name: "16-bpp-gray-rgb16", |
| 91 | sourceFile: "test-images/png/16-bpp.png", |
| 92 | background: &color.Gray, |
| 93 | format: imagetype.PNG, |
| 94 | }, |
| 95 | outSize: flattenTestOutSize, |
| 96 | outInterpretation: vips.InterpretationRGB16, |
| 97 | }, |
| 98 | { |
| 99 | opts: flattenTestCase{ |
| 100 | name: "16-bpp-red-rgb16", |
| 101 | sourceFile: "test-images/png/16-bpp.png", |
| 102 | background: &color.Red, |
| 103 | format: imagetype.PNG, |
| 104 | }, |
| 105 | outSize: flattenTestOutSize, |
nothing calls this directly
no test coverage detected