예제 #1
0
def testimg(rgb_file, raw_file):
	width, height = rgbimg.sizeofimage(rgb_file)
	rgb = rgbimg.longimagedata(rgb_file)
	if len(rgb) != width * height * 4:
		raise error, 'bad image length'
	raw = open(raw_file, 'r').read()
	if rgb != raw:
		raise error, 'images don\'t match for '+rgb_file+' and '+raw_file
	for depth in [1, 3, 4]:
		rgbimg.longstoimage(rgb, width, height, depth, '@.rgb')
	os.unlink('@.rgb')
예제 #2
0
def testimg(rgb_file, raw_file):
    width, height = rgbimg.sizeofimage(rgb_file)
    rgb = rgbimg.longimagedata(rgb_file)
    if len(rgb) != width * height * 4:
        raise error, 'bad image length'
    raw = open(raw_file, 'r').read()
    if rgb != raw:
        raise error, 'images don\'t match for ' + rgb_file + ' and ' + raw_file
    for depth in [1, 3, 4]:
        rgbimg.longstoimage(rgb, width, height, depth, '@.rgb')
    os.unlink('@.rgb')
예제 #3
0
def getrgbimage(name):
    """return a tuple consisting of image (in 'imgfile' format but
    using rgbimg instead) width and height"""

    import rgbimg

    try:
        sizes = rgbimg.sizeofimage(name)
    except rgbimg.error:
        name = get_qualified_path(name)
        sizes = rgbimg.sizeofimage(name)
    if verbose:
        print 'rgbimg opening test image: %s, sizes: %s' % (name, str(sizes))

    image = rgbimg.longimagedata(name)
    return (image, sizes[0], sizes[1])
예제 #4
0
def getrgbimage(name):
    """return a tuple consisting of image (in 'imgfile' format but
    using rgbimg instead) width and height"""

    import rgbimg

    try:
        sizes = rgbimg.sizeofimage(name)
    except rgbimg.error:
        name = get_qualified_path(name)
        sizes = rgbimg.sizeofimage(name)
    if verbose:
        print 'rgbimg opening test image: %s, sizes: %s' % (name, str(sizes))

    image = rgbimg.longimagedata(name)
    return (image, sizes[0], sizes[1])
예제 #5
0
파일: imgsgi.py 프로젝트: mcyril/ravel-ftn
"""
예제 #6
0
파일: imgsgi.py 프로젝트: mcyril/ravel-ftn
"""
예제 #7
0
#! /usr/bin/env python
예제 #8
0
파일: loadrgbimg.py 프로젝트: oneoy/cve-
import rgbimg
import sys

rgbimg.longimagedata(sys.argv[1])
예제 #9
0
#! /usr/bin/env python
예제 #10
0
# Testing rgbimg module