def __init__(self,parent): GimpIOBase.__init__(self,parent) self.strokeType:int=1 # one of self.STROKE_TYPES self.closedShape:bool=True self.points:List[GimpPoint]=[] self.numFloatsPerPoint:int=1 self.numPoints:int=0
def __init__(self,parent,image:Union[None,'PIL.Image']=None): GimpIOBase.__init__(self,parent) self.width:int=0 self.height:int=0 self._tiles:Union[None,List['PIL.Image']]=None # tile PIL images self._image:Union[None,'PIL.Image']=None if image is not None: self.image=image
def __init__(self,parent): GimpIOBase.__init__(self,parent) self.name:str='' self.uniqueId:int=0 self.visible:bool=True self.linked:bool=False self.parasites:List[GimpParasite]=[] self.strokes:List[GimpStroke]=[]
def __init__(self,parent): GimpIOBase.__init__(self,parent) self.x:int=0 self.y:int=0 self.pressure:float=1.0 self.xTilt:float=0.5 self.yTilt:float=0.5 self.wheel:float=0.5 self.pointType:int=0
def __init__(self,parent,name:str='',image:Union['PIL.Image',None]=None): GimpIOBase.__init__(self,parent) self.width:int=0 self.height:int=0 self.name:str=name self._data:Union[None,bytearray]=None self._imageHierarchy:Union[GimpImageHierarchy,None]=None self._imageHierarchyPtr:Union[int,None]=None if image is not None: # this is last because image can reset values self.image=image
def __init__(self,parent,image:'PIL.Image'=None): GimpIOBase.__init__(self,parent) self.width:int=0 self.height:int=0 self.bpp:int=0 # Number of bytes per pixel given self._levelPtrs:List[int]=[] self._levels:Union[None,List[GimpImageLevel]]=None self._data:Union[None,bytearray]=None if image is not None: # NOTE: can override earlier parameters self.image=image
def __init__(self, filename: Union[None, str, BinaryIO] = None): GimpIOBase.__init__(self, self) self.dirty: bool = False # a file-changed indicator. # TODO: Not fully implemented. self._layers: Union[None, List[GimpLayer]] = None self._layerPtr: Union[None, List[int]] = [] self.channels: List[GimpChannel] = [] self._channelPtr: Union[None, List[int]] = [] self.version: Union[None, float] = None self.width: int = 0 self.height: int = 0 self.baseColorMode: int = 0 self.precision: Union[None, Precision] = None # Precision object self._data: Union[None, bytearray] = None self.filename: Union[str, None] = None if filename is not None: self.load(filename)
def __repr__(self,indent:str='')->str: """ Get a textual representation of this object """ ret=[] ret.append('Name: '+str(self.name)) ret.append('Size: '+str(self.width)+' x '+str(self.height)) ret.append(GimpIOBase.__repr__(self,indent)) return indent+(('\n'+indent).join(ret))
def __init__(self, parent, name=None, image: Union['PIL.Image', None] = None): GimpIOBase.__init__(self, parent) if name is None: name = '' self.width: int = 0 self.height: int = 0 self.colorMode: int = 0 self.name: str = name self._imageHierarchy: Union[GimpImageHierarchy, None] = None self._imageHierarchyPtr: Union[int, None] = None self._mask: Union[GimpChannel, None] = None self._maskPtr: Union[int, None] = None self._data: Union[None, bytearray] = None if image is not None: self.image = image # done last as it resets some of the above defaults
def __repr__(self, indent=''): """ Get a textual representation of this object """ ret = [] ret.append('Name: ' + str(self.name)) ret.append('Size: ' + str(self.width) + ' x ' + str(self.height)) ret.append('colorMode: ' + self.COLOR_MODES[self.colorMode]) ret.append(GimpIOBase.__repr__(self, indent)) m = self.mask if m is not None: ret.append('Mask:') ret.append(m.__repr__(indent + '\t')) return indent + (('\n' + indent).join(ret))
def __repr__(self, indent=''): """ Get a textual representation of this object """ ret = [] if self.filename is not None: ret.append('Filename: ' + self.filename) ret.append('Version: ' + str(self.version)) ret.append('Size: ' + str(self.width) + ' x ' + str(self.height)) ret.append('Base Color Mode: ' + self.COLOR_MODES[self.baseColorMode]) ret.append('Precision: ' + str(self.precision)) ret.append(GimpIOBase.__repr__(self)) if self._layerPtr: ret.append('Layers: ') for l in self.layers: ret.append(l.__repr__('\t')) if self._channelPtr: ret.append('Channels: ') for ch in self.channels: ret.append(ch.__repr__('\t')) return '\n'.join(ret)