예제 #1
0
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
예제 #2
0
파일: mkhdr.py 프로젝트: nbn1985/general
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
예제 #3
0
파일: mkhdr.py 프로젝트: hpd/general
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
예제 #4
0
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