MCPcopy Create free account
hub / github.com/ImageEngine/cortex / __makeIntImage

Method __makeIntImage

test/IECoreImage/ImageWriterTest.py:115–141  ·  view source on GitHub ↗
( self, dataWindow, displayWindow, dataType = IECore.UIntVectorData, maxInt = 2**32-1 )

Source from the content-addressed store, hash-verified

113 return img
114
115 def __makeIntImage( self, dataWindow, displayWindow, dataType = IECore.UIntVectorData, maxInt = 2**32-1 ) :
116
117 img = IECoreImage.ImagePrimitive( dataWindow, displayWindow )
118
119 w = dataWindow.max().x - dataWindow.min().x + 1
120 h = dataWindow.max().y - dataWindow.min().y + 1
121
122 area = w * h
123 R = dataType( area )
124 G = dataType( area )
125 B = dataType( area )
126
127 offset = 0
128 for y in range( 0, h ) :
129 for x in range( 0, w ) :
130
131 R[offset] = int( maxInt * float(x) / (w - 1) )
132 G[offset] = int( maxInt * float(y) / (h - 1) )
133 B[offset] = 0
134
135 offset = offset + 1
136
137 img["R"] = R
138 img["G"] = G
139 img["B"] = B
140
141 return img
142
143 def __makeGreyscaleImage( self, dataWindow, displayWindow ) :
144

Callers 3

testJPGMethod · 0.95
testDPXMethod · 0.95
testTIFMethod · 0.95

Calls 3

ImagePrimitiveMethod · 0.80
maxMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected