Author Topic: BETA - Image Editor plugin  (Read 51059 times)

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #30 on: April 30, 2010, 11:12:36 pm »
Sorry for all the confusion in the SVN repository !

   1 - it is true that I have removed some useless folders like the .obj
   
   2 - After removing so many files, I should have done a test check-out (I am still a newbie with SVN, and I am making mistakes...)
        I will test next time

   3 - I had last week a very heavy work schedule, and I did not have the time to update the plugin. So no opportunity to spot and / or correct the mistakes

   I have just made an update of the SVN (revision 27) - now it is working (I have tested with a fresh check-out)

   Hopefully I will have more time now, to finish the plugin.
   During the last updates, I have added some basic Image manipulation (flipping / rotating / converting to grey scale ...) This  operation are useful when editing a set of similar icons, and / or a set of icon for the same button (grey scaled can be used for disabled bitmap for example).

  I will not add new features - I think the panel is more or less complete.
  The roadmap is now:
     - correcting all the points described in todo.txt
     - finishing implementing the "rotate hue" manipulation (1 good call to wxImage::RotateHue and it is finished)
     - testing, debugging, releasing

  After a first release, I want to:
     - add possibly a configuration panel
     - add a Quick Help dialog
     - review a bit the interface, using either: wxAUI, wxFoldedPanel, hideable panels, ... the area is a bit too much cluttered with the tools to my taste

   Sebastien
 





Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #31 on: May 02, 2010, 10:43:38 pm »
Hello,

I have made updates to the XPMEditor plugin.
The main changes are in the drawing tools:
   1 - WYSIWYG (this was not the case before, since scale factors were not identical ...)
   2 - correct some inaccuracies (problems when dragging selection, copy / paste was 1 pixel too much, ...)
   3 - discovered some bugs in the process, and corrected some of them (the other are documented in the todo.txt file)
   4 - Selection frame is now inverted - the previous was blue. Not really useful when it is located on a blue rectangle...
   5 - the colour of the Grid is now customizable.

SVN is updated (revision 28 - this time I have tested it !)

One quick note: the progress seems to be slow - a drawing editor ought to be simple to program. I stumbled unto many problems, including bugs in wxWidgets (SetUserScale is innacurate).
Since the editor should be optimized for small images with big zoom factors, I have to be careful about accuracy... And it has caused me many problems (solved now), which took most of the programming time this week-end.

Sebastien
« Last Edit: May 02, 2010, 10:45:28 pm by seb_seb0 »

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #32 on: May 20, 2010, 10:08:08 pm »
Hello,

I have updated the plugin.
Here is the list of changes:

   1 - solved bug with resize selection with big zooms
   2 - Invert colours Selection / Image is now possible
   3 - Rotate Hue: from colour to colour (interface improved)
   4 - Bug solved: Undo : mask colour not saved, and resetted to black after Undo.
   5 - Moved some of the widgets to separate panels - it will make it easier to hide / show them

Next in planning, probably in this order (mainly bug solving):
Bugs to be solved:
1 - Copy / Paste:
    before copy : bitmap put in clipboard has a Mask
    after paste : bitmap does not have mask
2 - Zoom + Pen does not work good after moving selection
3 - Selection is not drawn when it is overlapping bitmap edges + zoom
4 - Redraw background: the bottom right corner is not covered when zooming out
5 - Save As: does not update the file status in the Project Manager

Improvements:
1 - improve the interface : allow to hide some widgets, to clear some drawing surface (useful mainly for laptop users, with small screens)
     Partially done - some work remains to do.
2 - Quick Help display

Regards,

Sebastien

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #33 on: May 25, 2010, 11:14:37 pm »
Hello,

the plugin is not dead.
I have solved several bugs - but currently, due to UI rework, the plugin is currently broken (nothing big, I am just in the middle of a change. Some panels are not resized correctly, hiding the controls...).
Therefore I will not commit the sources until this problem is solved.

I still have a heavy workload at work (a bit less though) so I cannot work as much as I want on this plugin.

In parallel, I have found a way to install Ubuntu 10.4 on my computer (using VirtualBox, to avoid a nasty and potentially dangerous hard disk partionning). I am currently compiling CodeBlocks (last SVN). The goal is to correct myself the most obvious Linux bugs in my plugin (and to learn the tools for programming on Linux as well ! :-) )
So far, so good, it is still compiling (thanks google & the wiki).

I will let you know when I make substancial progress (not before the 28.05 though - I have work appointments

Sebastien

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Image Editor - new plugin
« Reply #34 on: May 26, 2010, 08:51:12 am »
Hello,
[...]
In parallel, I have found a way to install Ubuntu 10.4 on my computer (using VirtualBox, to avoid a nasty and potentially dangerous hard disk partionning).

Have you tried wubi already? It uses loop-mounting, which means you can dual boot without partitioning the hard disk. I always see emulation as a last resort.

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #35 on: July 11, 2010, 08:49:39 pm »
Hello,

I am back - sorry for not giving more feedback, I was overloaded with work.

I have uploaded a working version of the plugin in the svn repository.

So here is the status:
    What is new:
      1 - interface using wxAUI (a panel is managed by wxAUIManager): it allows to move all the controls outside the painting area, for users with small screens
           The plugin will read the wxAUI configuration from CodeBlocks, and will apply the same colours.
           BTW, is there a way to know when the user made a modification to these settings (event generated by CodeBlocks) ?
      2 - Improved the colour picker, for better integration in a resizeable panel
              better size calculation
              scrollbars available
              choose automatically to draw itselft in a vertical or horizontal direction
      3 - use an improved wxFoldPanelBar (contrib lib of wxWidgets 2.8.10) to hide/show the controls
              This improved version use sizers instead of absolute X,Y calculations. Scrollbars are automatically managed
              In addition, there is the possibility to use 3 kinds of caption bars : the normal one, programmed by Jorgen Bodde, or a flat wxButton (like wxSmith) or a wxButton


     Known Bugs:
      1 - Copy / Paste:
           before copy : bitmap put in clipboard has a Mask
           after paste : bitmap does not have mask
      2 - Zoom + Pen does not work good after moving selection
      3 - Selection is not drawn when it is overlapping bitmap edges + zoom
      4 - Redraw background: the bottom right corner is not covered when zooming out

     Planned:
     1 - Tools panel is a bit too big : sizer layout to review
     2 - Implement JPG and PNG compression quality options (not too difficult, wxImage.SetOptions is straightforward)
     3 - Write some help displayed in a dialog box, for quick introduction
     4 - misc improvements which can wait (see the todo.txt)

In parallel, I am trying to install Ubuntu 10.04 on my laptop using Wubi (@ptDev : thanks for the tip !), for improved testing (It is too bad that I can currently only test Windows version.)

I have 2 questions for the Code::Blocks experts here:
     1 - XPMEditor is basically a MIME plugin (derive from cbMimePlugin).
          When opening the codeblocks project from the "Start Here" welcome page, CodeBlocks automatically opens the XPMEditorPanel.cpp file, and also the test.bmp file.
          The plugin is already loaded in Code::Blocks
          The question is : why does code::blocks opens the file "test.bmp" automatically in TEXT mode (as if the file was a source file) ? When I close it and reopen it, the XPMEditor plugin is called, as expected.
(see 1st screenshot)

     2 - I would like to display the images files that the XPMEditor can open in a specific virtual folder (such as "images" or "resources").
(see 2nd screenshot)

Regards,

Sébastien


[attachment deleted by admin]
« Last Edit: July 11, 2010, 09:00:55 pm by seb_seb0 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12195
    • Travis build status
Re: Image Editor - new plugin
« Reply #36 on: July 12, 2010, 10:02:11 am »
     2 - I would like to display the images files that the XPMEditor can open in a specific virtual folder (such as "images" or "resources").
(see 2nd screenshot)
You can define that *.bmp files can go to folder "images", somewhere in the Project menu. The menu option should be something related to file types/file associations.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: Image Editor - new plugin
« Reply #37 on: July 12, 2010, 04:18:59 pm »
Right click on project, select:
- project tree -> edit file types and categories
-> setup ad desired
Enable:
- project tree -> categorize by file types
(- project tree -> hide folder names)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #38 on: July 12, 2010, 09:50:12 pm »
Right click on project, select:
- project tree -> edit file types and categories
-> setup ad desired
Enable:
- project tree -> categorize by file types
(- project tree -> hide folder names)


Thank you, that worked.
Is it possible to add this programmaticaly ? It is not necessarily needed, since it is very simple to do, but it is for my curiosity...

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #39 on: July 12, 2010, 10:34:33 pm »
I have installed Ubuntu 10.04 on dual boot on my laptop.
I have also successfully installed Code::Blocks 10.05 on it (and it is running ! Yeah !)
Now I am fighting with the configuration (I cannot compile anything, because cb cannot find wxWidgets. I would like to help him, but I do not know myself where it is located... )

Please be patient ! Hopefully I will soon be able to test and debug my plugin on Ubuntu !

Sebastien

PS: 1st impression: it is a lot faster than on Vista (same laptop...) Code completions is much more reactive, load time of the codeblocks project took only a few seconds (against 30 seconds approximately on Vista). Do you know why there are so much differences ?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Image Editor - new plugin
« Reply #40 on: July 12, 2010, 11:03:12 pm »
You should install libwxgtk2.8-dev, this will fetch all other needed packages, except for wx-common which includes wx-config.
After installing wx-common (and libwxgtk2.8-dev), you can create a wxwidgets example with the wizard and see how wx-config can be used.

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #41 on: July 12, 2010, 11:30:23 pm »
Thank you for the tip !
I have found another solution, using "wx-config" in the command line (copied from Code::Blocks project).

The status is:
  - I have sucessfully compiled Code::Blocks (or I should say, no errors reported). I have not created the "output" directory yet, only "devel"
  - I have successfully compiled my plugin (yeah !!) with one caveat: wxDragImage is deactivated using #if #endif, I have to find another way compatible with wxGTK
    And I cannot load the plugin in code::blocks: I get the error message "this usually happens when plugin & application are built using different versions of SDK", or something like that

Solution I plan to apply:
  - finish the compilation and installation of Code::Blocks (find equivalent of "update.bat" on linux - it is certainly written somewhere on the wiki)
  - use the compiled codeblocks to load my plugin.

Or I may have done something very wrong.

Sebastien

PS: I discovered that linking with wxmsw lib does not work on linux :-)
PS2: I have installed codeblocks 10.05 using the debian packages provided by jens.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5249
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Image Editor - new plugin
« Reply #42 on: July 13, 2010, 01:22:43 am »
PS: 1st impression: it is a lot faster than on Vista (same laptop...) Code completions is much more reactive, load time of the codeblocks project took only a few seconds (against 30 seconds approximately on Vista). Do you know why there are so much differences ?
I have a similar experience about the parsing time of CodeCompletion. In the same notebook, Windows Vista is much slower than windows XP. To load the codeblocks.cbp, in Vista, it will take more than 1 minutes, but in XP, it is only 20 seconds. I'm not sure why, but surely XP is faster than Vista. Vista is too "bloat". :D

I have never used any linux like OS though.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Image Editor - new plugin
« Reply #43 on: July 13, 2010, 09:08:55 am »
The equivalent to update.bat is update.
On a console go to the directory, where the main project-file is located and run ./update.
To start your new C::B you can run it through C::B or call the wrapper-script output/run.sh, using the new executable will not work directly.

If you want, I can create a patch tht uses your plugin from inside the contrib-plugins folder and also adds it to the automake system, so you can use the "normal" linux way with ./bootstrap; ./configure [...]; make; sudo make install.
You can use automake to create a test-version of C::B in another folder than the normal C::B is by using a different --prefix when running ./configure (I do this below my homefolder and have several working versions of C::B simultaneously)

Offline seb_seb0

  • Almost regular
  • **
  • Posts: 166
Re: Image Editor - new plugin
« Reply #44 on: July 13, 2010, 11:49:54 pm »
Hello,

there are some progress:
  - I have found the "update" script and ran it. The output directory was created, as expected
  - I cannot run codeblocks from output (using "./codeblocks" command line), it complains about "libwxscintilla.so cannot be found".
    Probably a PATH equivalent not set correctly. I will try your tip regarding "--prefix" and look around on Internet for more Linux information
   
    Thank you for your proposal for doing a patch using my plugin: I prefer to find the solution to my problem, this is the best way to learn.

 On the good news :
   - I have solved the problem with wxDragImage. Now the plugin compiles without #if #endif on wxGTK
   - I have commited a XPMEditor_unix.cbp project file on the SVN (using SVN command line on Ubuntu !)
   - I have found a way to create an "Images" virtual folder in the project manager (thanks to Morten for pointing me in the good direction. I just had to look in Code::Blocks sources how it was done).
   - I have updated the code when saving and opening a file: now Image handlers are handled dynamically, this is not anymore a stupid algorithm based on hardcoded file extensions alone. This is not yet complete, but in good way.


And now I have to go to sleep. Good night !

Sébastien