( self, dataWindow, displayWindow, withAlpha = False, dataType = IECore.FloatVectorData )
| 77 | self.assertTrue( res.value ) |
| 78 | |
| 79 | def __makeFloatImage( self, dataWindow, displayWindow, withAlpha = False, dataType = IECore.FloatVectorData ) : |
| 80 | |
| 81 | img = IECoreImage.ImagePrimitive( dataWindow, displayWindow ) |
| 82 | |
| 83 | w = dataWindow.max().x - dataWindow.min().x + 1 |
| 84 | h = dataWindow.max().y - dataWindow.min().y + 1 |
| 85 | |
| 86 | area = w * h |
| 87 | R = dataType( area ) |
| 88 | G = dataType( area ) |
| 89 | B = dataType( area ) |
| 90 | |
| 91 | if withAlpha: |
| 92 | A = dataType( area ) |
| 93 | |
| 94 | offset = 0 |
| 95 | for y in range( 0, h ) : |
| 96 | for x in range( 0, w ) : |
| 97 | |
| 98 | R[offset] = float(x) / (w - 1) |
| 99 | G[offset] = float(y) / (h - 1) |
| 100 | B[offset] = 0.0 |
| 101 | if withAlpha: |
| 102 | A[offset] = 0.5 |
| 103 | |
| 104 | offset = offset + 1 |
| 105 | |
| 106 | img["R"] = R |
| 107 | img["G"] = G |
| 108 | img["B"] = B |
| 109 | |
| 110 | if withAlpha: |
| 111 | img["A"] = A |
| 112 | |
| 113 | return img |
| 114 | |
| 115 | def __makeIntImage( self, dataWindow, displayWindow, dataType = IECore.UIntVectorData, maxInt = 2**32-1 ) : |
| 116 |
no test coverage detected