Ejemplo n.º 1
0
    def save(self, fname, format):
        """
        Save the scene to a file

        @param fname: The name of the file to save the scene to
        @type fname: string

        @param format: The format in which to save the scene
        @type format: Image object or string
        """
        debugMsg("Called Scene.save()")

        if fname is None or fname == "":
            raise ValueError, "You must specify an output filename"

        if format is None or format == "":
            raise ValueError, "You must specify an image format"

        # now check the type of arguments sent in
        if __debug__:
            assert isinstance(fname, str),  "Incorrect data type; expected str"
            assert isinstance(format, str), "Incorrect data type; expected str"

        # do a check to see if the file exists
        fileCheck(fname)

        # print a warning message if get to here
        overrideWarning("Scene.save")

        return
Ejemplo n.º 2
0
    def load(self, fname):
        """
        Loads image data from file.

        @param fname: The filename from which to load image data
        @type fname: string
        """
        debugMsg("Called Image.load()")
        fileCheck(fname)
        return
Ejemplo n.º 3
0
    def load(self, fname):
        """
        Loads jpeg image data from file.

        @param fname: The filename from which to load jpeg image data
        @type fname: string
        """
        debugMsg("Called JpegImage.load()")

        # do a check to see if the file exists
        fileCheck(fname)

        # print a warning message if get to here
        overrideWarning("JpegImage.load")

        return
Ejemplo n.º 4
0
    def load(self, fname):
        """
        Loads pnm (ppm, pgm, pbm) image data from file.

        @param fname: The filename from which to load pnm image data
        @type fname: string
        """
        debugMsg("Called PnmImage.load()")

        # check to see if the file exists
        fileCheck(fname)

        self.renderer.runString("# PnmImage.load()")
        evalString = "_pnmReader.SetFileName(\"%s\")" % fname
        self.renderer.runString(evalString)
        return
Ejemplo n.º 5
0
    def load(self, fname):
        """
        Loads tiff image data from file.

        @param fname: The filename from which to load tiff image data
        @type fname: string
        """
        debugMsg("Called TiffImage.load()")

        # check to see if the file exists
        fileCheck(fname)

        self.renderer.runString("# TiffImage.load()")
        evalString = "_tiffReader.SetFileName(\"%s\")" % fname
        self.renderer.runString(evalString)
        return
Ejemplo n.º 6
0
    def load(self, fname):
        """
        Loads jpeg image data from file.

        NOT supported by this renderer module

        @param fname: The filename from which to load jpeg image data
        @type fname: string
        """
        debugMsg("Called JpegImage.load()")

        fileCheck(fname)

        # this ability not handled by this renderer module
        unsupportedError()
        
        return
Ejemplo n.º 7
0
    def load(self, fname):
        """
        Loads ps image data from file.

        B{NOT} supported by this renderer module

        @param fname: The filename from which to load ps image data
        @type fname: string
        """
        debugMsg("Called PsImage.load()")

        # this ability not handled by this renderer module
        unsupportedError("BASE")
        
        # do a check to see if the file exists
        fileCheck(fname)

        return
Ejemplo n.º 8
0
    def load(self, fname):
        """
        Loads pdf image data from file.

        B{NOT} supported by this renderer module

        @param fname: The filename from which to load pdf image data
        @type fname: string
        """
        debugMsg("Called PdfImage.load()")

        # need to check that the file exists
        fileCheck(fname)

        # this ability not handled by this renderer module
        unsupportedError()
        
        return
Ejemplo n.º 9
0
    def load(self, fname):
        """
        Loads pdf image data from file.

        B{NOT} supported by this renderer module

        @param fname: The filename from which to load pdf image data
        @type fname: string
        """
        debugMsg("Called PdfImage.load()")

        # need to check that the file exists and is readable etc here
        # *before* we add to the evalString, better to get the feedback
        # now rather than at the end of the script

        # this ability not handled by this renderer module
        unsupportedError("BASE")
        
        # do a check to see if the file exists
        fileCheck(fname)

        return