Time for action – developing image processing code
Thus, with ThumbnailMakerDialog at your disposal, you can develop your own code in scratch, in class ThumbnailMaker. Just make sure to implement the method processImage as this is the only method called by ThumbnailMakerDialog.
Let's develop some important methods of class ThumbnailMaker.
Write the constructor for class
ThumbnailMaker. It takesdialogas an argument. In the constructor, we only initializeself._dialog, which is an instance of classThumbnailMakerDialog. Here is the code.def __init__(self, dialog): """ Constructor for class ThumbnailMaker. """ # This dialog can be an instance of # ThumbnailMakerDialog class. Alternatively, if # you have some other way to process input,# it will be that class. Just make sure to implement # the public API methods defined in # ThumbnailMakerDialog class! self._dialog = dialogNext, write the
processImagemethod in classThumbnailMaker. The code is as follows...