> I think Blam and I need to discuss the best way to do this more before I
> do anything anyway. I see he's already put in the image type. I'm not
> sure how the API should look from the Python side of things. On the C
> side, I think each place that currently accepts an image filename can
> just accept a pointer to an image struct, but I'm not sure how to name
> those functions. I think my first step will be to create an image class
> in the Python interface along with a constructor that makes an image from
> the output of one of the tostring methods from pygame, Numeric, PIL,
> etc.

Do we really need P3_image to be accessible in Python?
I think it would be better to use directly the image class of the PIL rather than our 
own. Here is an example of what I have in mind:

class Material:
  def from_image (image):
    if (image is a string):
      if (PIL available):
        image = load (filename)
        # C code
        self.from_string (image.to_string())
      else:
        # C code
        self.from_filename (image)
    elif (image is a PIL image):
      # C code
      self.from_string (image)
        
waiting for your feedback

-blam



-- 
Pour vous desabonner envoyez un mail a [EMAIL PROTECTED]

Reply via email to