コード例 #1
0
    def new_image(self, screen_pos=(0, 0), image_path='./CartaA.png'):
        """Genero un nuevo objeto Image"""

        pos = self.coord_screen2coord_canvas(screen_pos=screen_pos)

        new_obj = Image(pos=pos, filename=image_path, parent=self)

        self.file_name = os.path.splitext(
            new_obj.get_image_filename())[0] + '.ptr'

        self.obj_list_v.append(new_obj)
        self.onEditionChanged = True

        return None
コード例 #2
0
ファイル: scene.py プロジェクト: virajshah/raytracer
 def __init__(self, camera, lights, objects, width, height):
   self.camera = camera
   self.lights = lights
   self.objects = objects
   self.width = width
   self.height = height
   self.image = Image(width, height)
コード例 #3
0
 def __init__(self, camera, blackhole, disk, width, height):
     self.camera = camera
     self.width = width
     self.height = height
     self.image = Image(width, height)
     self.blackhole = blackhole
     self.disk = disk
コード例 #4
0
    def _factory(self, module, config):
        if (module == 'cdb'):
            from modules.cdb import Cdb
            service = Cdb(config)
        elif (module == 'account'):
            from modules.account import Account
            service = Account(config)
        elif (module == 'cvm'):
            from modules.cvm import Cvm
            service = Cvm(config)
        elif (module == 'image'):
            from modules.image import Image
            service = Image(config)
        elif (module == 'lb'):
            from modules.lb import Lb
            service = Lb(config)
        elif (module == 'sec'):
            from modules.sec import Sec
            service = Sec(config)
        elif (module == 'trade'):
            from modules.trade import Trade
            service = Trade(config)
        elif (module == 'bill'):
            from modules.bill import Bill
            service = Bill(config)
        elif (module == 'monitor'):
            from modules.monitor import Monitor
            service = Monitor(config)
        elif (module == 'cdn'):
            from modules.cdn import Cdn
            service = Cdn(config)
        elif (module == 'vpc'):
            from modules.vpc import Vpc
            service = Vpc(config)
        elif (module == 'vod'):
            from modules.vod import Vod
            service = Vod(config)
        elif (module == 'yunsou'):
            from modules.yunsou import Yunsou
            service = Yunsou(config)
        elif (module == 'wenzhi'):
            from modules.wenzhi import Wenzhi
            service = Wenzhi(config)
        elif (module == 'market'):
            from modules.market import Market
            service = Market(config)
        elif (module == 'live'):
            from modules.live import Live
            service = Live(config)
        elif (module == 'eip'):
            from modules.eip import Eip
            service = Eip(config)
        else:
            raise ValueError, 'module not exists'

        return service
コード例 #5
0
    def _factory(self, module, config):
        if (module == 'cdb'):
            from modules.cdb import Cdb
            service = Cdb(config)
        elif (module == 'cvm'):
            from modules.cvm import Cvm
            service = Cvm(config)
        elif (module == 'image'):
            from modules.image import Image
            service = Image(config)
        elif (module == 'lb'):
            from modules.lb import Lb
            service = Lb(config)
        elif (module == 'sec'):
            from modules.sec import Sec
            service = Sec(config)
        elif (module == 'trade'):
            from modules.trade import Trade
            service = Trade(config)
        elif (module == 'monitor'):
            from modules.monitor import Monitor
            service = Monitor(config)
        elif (module == 'cdn'):
            from modules.cdn import Cdn
            service = Cdn(config)
        elif (module == 'vod'):
            from modules.vod import Vod
            service = Vod(config)
        elif (module == 'yunsou'):
            from modules.yunsou import Yunsou
            service = Yunsou(config)
        elif (module == 'wenzhi'):
            from src.QcloudApi.modules.wenzhi import Wenzhi
            service = Wenzhi(config)
        else:
            raise ValueError('module not exists')

        return service
コード例 #6
0
    def _factory(self, module, config):
        if (module == 'cdb'):
            from modules.cdb import Cdb
            service = Cdb(config)
        elif (module == 'account'):
            from modules.account import Account
            service = Account(config)
        elif (module == 'cvm'):
            from modules.cvm import Cvm
            service = Cvm(config)
        elif (module == 'image'):
            from modules.image import Image
            service = Image(config)
        elif (module == 'lb'):
            from modules.lb import Lb
            service = Lb(config)
        elif (module == 'sec'):
            from modules.sec import Sec
            service = Sec(config)
        elif (module == 'trade'):
            from modules.trade import Trade
            service = Trade(config)
        elif (module == 'bill'):
            from modules.bill import Bill
            service = Bill(config)
        elif (module == 'monitor'):
            from modules.monitor import Monitor
            service = Monitor(config)
        elif (module == 'cdn'):
            from modules.cdn import Cdn
            service = Cdn(config)
        elif (module == 'vpc'):
            from modules.vpc import Vpc
            service = Vpc(config)
        elif (module == 'vod'):
            from modules.vod import Vod
            service = Vod(config)
        elif (module == 'yunsou'):
            from modules.yunsou import Yunsou
            service = Yunsou(config)
        elif (module == 'wenzhi'):
            from modules.wenzhi import Wenzhi
            service = Wenzhi(config)
        elif (module == 'market'):
            from modules.market import Market
            service = Market(config)
        elif (module == 'live'):
            from modules.live import Live
            service = Live(config)
        elif (module == 'eip'):
            from modules.eip import Eip
            service = Eip(config)
        elif (module == 'cbs'):
            from modules.cbs import Cbs
            service = Cbs(config)
        elif (module == 'snapshot'):
            from modules.snapshot import Snapshot
            service = Snapshot(config)
        elif (module == 'scaling'):
            from modules.scaling import Scaling
            service = Scaling(config)
        elif (module == 'cmem'):
            from modules.cmem import Cmem
            service = Cmem(config)
        elif (module == 'tdsql'):
            from modules.tdsql import Tdsql
            service = Tdsql(config)
        elif (module == 'bm'):
            from modules.bm import Bm
            service = Bm(config)
        elif (module == 'redis'):
            from modules.redis import Redis
            service = Redis(config)
        elif (module == 'dfw'):
            from modules.dfw import Dfw
            service = Dfw(config)
        else:
            raise ValueError, 'module not exists'

        return service
コード例 #7
0
    def _factory(self, module, config):
        if (module == 'cdb'):
            from modules.cdb import Cdb
            service = Cdb(config)
        elif (module == 'account'):
            from modules.account import Account
            service = Account(config)
        elif (module == 'cvm'):
            from modules.cvm import Cvm
            service = Cvm(config)
        elif (module == 'image'):
            from modules.image import Image
            service = Image(config)
        elif (module == 'lb'):
            from modules.lb import Lb
            service = Lb(config)
        elif (module == 'sec'):
            from modules.sec import Sec
            service = Sec(config)
        elif (module == 'trade'):
            from modules.trade import Trade
            service = Trade(config)
        elif (module == 'bill'):
            from modules.bill import Bill
            service = Bill(config)
        elif (module == 'monitor'):
            from modules.monitor import Monitor
            service = Monitor(config)
        elif (module == 'cdn'):
            from modules.cdn import Cdn
            service = Cdn(config)
        elif (module == 'vpc'):
            from modules.vpc import Vpc
            service = Vpc(config)
        elif (module == 'vod'):
            from modules.vod import Vod
            service = Vod(config)
        elif (module == 'yunsou'):
            from modules.yunsou import Yunsou
            service = Yunsou(config)
        elif (module == 'wenzhi'):
            from modules.wenzhi import Wenzhi
            service = Wenzhi(config)
        elif (module == 'market'):
            from modules.market import Market
            service = Market(config)
        elif (module == 'live'):
            from modules.live import Live
            service = Live(config)
        elif (module == 'eip'):
            from modules.eip import Eip
            service = Eip(config)
        elif (module == 'cbs'):
            from modules.cbs import Cbs
            service = Cbs(config)
        elif (module == 'snapshot'):
            from modules.snapshot import Snapshot
            service = Snapshot(config)
        elif (module == 'scaling'):
            from modules.scaling import Scaling
            service = Scaling(config)
        elif (module == 'iotcloud'):
            from modules.iotcloud import IOTCLOUD
            service = IOTCLOUD(config)

        return service
コード例 #8
0
ファイル: main.py プロジェクト: glodfinch/tpldecode
try:
    ident = f.read(4)
    if checkIdent(ident):
        print 'TPL identifier found'
        count = struct.unpack('>I', f.read(4))[0]
        print 'Image count: ' + str(count)
        itoff = struct.unpack('>I', f.read(4))[0]
        print 'Image offset table byte: ' + str(itoff)
        f.seek(itoff)

        for i in range(0, count):
            imoff = struct.unpack('>I', f.read(4))[0]
            paoff = struct.unpack('>I', f.read(4))[0]
            cuoff = f.tell()
            f.seek(imoff)
            imheader = f.read(35)
            image = Image(imheader)
            print str(i) + ': ' + image.format + ' ' + str(
                image.size) + ' bytes'

            if image.size != 0:
                f.seek(image.offset)
                imdata = f.read(image.size)
                image.loadImage(imdata)
                image.saveImage('C:/output/' + str(i) + '.png')

            f.seek(cuoff)
finally:
    f.close()