def make_constimage(xres, yres, chans=3, format=oiio.UINT8, value=(0, 0, 0), xoffset=0, yoffset=0): spec = ImageSpec(xres, yres, chans, format) spec.x = xoffset spec.y = yoffset b = ImageBuf(spec) oiio.ImageBufAlgo.fill(b, value) return b
def ImageBufMakeConstant(xres, yres, chans=3, format=oiio.UINT8, value=(0, 0, 0), xoffset=0, yoffset=0, orientation=1, inputSpec=None): ''' Create a new Image Buffer ''' # Copy an existing input spec # Mostly to ensure that metadata makes it through if inputSpec: spec = inputSpec spec.width = xres spec.height = yres spec.nchannels = chans spec.set_format(format) # Or create a new ImageSpec else: spec = ImageSpec(xres, yres, chans, format) spec.x = xoffset spec.y = yoffset b = ImageBuf(spec) b.orientation = orientation oiio.ImageBufAlgo.fill(b, value) return b
def ImageBufMakeConstant(xres, yres, chans=3, format=oiio.UINT8, value=(0,0,0), xoffset=0, yoffset=0, orientation=1, inputSpec=None) : ''' Create a new Image Buffer ''' # Copy an existing input spec # Mostly to ensure that metadata makes it through if inputSpec: spec = inputSpec spec.width = xres spec.height = yres spec.nchannels = chans spec.set_format( format ) # Or create a new ImageSpec else: spec = ImageSpec (xres,yres,chans,format) spec.x = xoffset spec.y = yoffset b = ImageBuf (spec) b.orientation = orientation oiio.ImageBufAlgo.fill(b, value) return b
def make_constimage (xres, yres, chans=3, format=oiio.UINT8, value=(0,0,0), xoffset=0, yoffset=0) : spec = ImageSpec (xres,yres,chans,format) spec.x = xoffset spec.y = yoffset b = ImageBuf (spec) oiio.ImageBufAlgo.fill (b, value) return b