What is Picture to People ?

"Picture to People" (P2P) is a huge Computer Graphics project. It was started to create new softwares able to make 2D drawing, 3D rendering, vexel drawing, text effects, photo effects, image filtering and other complex Computer Graphics operations. It has been made from scratch, including its low level Computer Graphics libraries like Maccala. Nowadays, most final features produced for this project are released as free online tools available from its official website. This blog talks about Computer Graphics, mainly concerning Picture to People development.

"Only who makes has true knowledge. Knowledge is control. True power depends on total control. Only who makes from scratch has the real power."

Showing posts with label object-oriented programming. Show all posts
Showing posts with label object-oriented programming. Show all posts

Saturday, December 5, 2015

Picture to People platform improvements

Picture to People free graphic software portal is getting some refactoring. It helps to make the site slightly faster and easier to maintain, giving us more time to focus on new graphic effects development.

It also means the cache used in the site can bring some problems. For many pages, without a complete refresh, the mix of old and new code can cause unexpected errors.

If you have used P2P before and you get any strange error when using a P2P online tool, be sure to refresh the page pressing F5 (in Windows) or the similar command for your browser, so any cached data/files will be discarded.

 Subscribe in a reader

Tuesday, November 23, 2010

A very efficient color picker

I developed Picture to People with a very powerful log. Analyzing the log I saw that there were many errors configuring the colors when using the effects. I realized that I have really many dummy users that don't understand what a "color in HTML hexadecimal style" is.

I always tried to make P2P absolutely easy (in fact, the easiest ever), but I forgot about the colors setting. My fault. To solve this problem once for all, I developed my own color picker component in javascript.

I projected it very carefully to have all important colors and to be very direct, efficient and user friendly. You always solve a color problem with two clicks: one to call the color picker (clicking the proper icon beside any color item) and one to set the color you want. When you call the component, it appears just close to your mouse and, when you choose a color, it is just written in the related color field. Below I show you how the color picker window looks like.

I coded the picker to mark any color cell (highlighting its borders in red as you see in the image) as the mouse pass over it. It works perfectly in Firefox and Chrome. This feature doesn't work in IE because it lacks some properties as defined by W3C. Anyway, the overall operation works in all three browsers.

I will always work hard to take professional Computer Graphics the easiest way for all.

Subscribe in a reader

Tuesday, November 13, 2007

Object-Oriented Programming for all of us

Let's put vectors, pixels, curves, low level algorithms and related concepts aside for a moment.

A lot of people has been asking me about a more general subject: "You have a software with a lot of low level code. How deep are you using OOP in your project?".

Well ... I have been using OOP in personal and work projects for more than 12 years. I can really give my testimonial about the power of this approach. But how deep can you go? Which effects will you face using OO concepts in deep for low level programming?

There is no doubt about one point: if you really know how to use it, OOP makes programmers life very comfortable. Anyway, nothing is perfect: sometimes what is correct in a OO sense can be not so useful, mainly about performance.

Let's talk about a very generic situation. It's only illustrative, but can be used like an example.

Suppose you have a class "A", which have two operations (methods) "m" and "n". Consider that "A.m" has a time cost of "t", and "A.n" has a time cost of "10000t" (the methods are not necessarily static; it's just for the sake of simplicity). Now, consider that for the correct closure of the state of a object from type "A", I need to call "n" inside the implementation of "m". In this scenario, suppose it's a obligation because an "A" object needs to be correct all time and doesn't know the external environment.

It's much easier make the "A" concept like a class and let each instance of "A" take care about itself. But what about if you use "A.m" in a very inner loop in your source? For each iteration you will pay the price of calling "A.n". Maybe it's too much expensive in time and can make your system useless. In that situation, can be mandatory to break the encapsulation and try to find an algorithm that call "n" source just once (or few times) and let the inner loop run only calling "m" source. This kind of solution can have other bad consequences, but it's another subject.

The final digest is: every big and/or complex software needs a lot of planning and modeling. The "real world" problems sometimes can not be solved using just one paradigm.

In P2P I use a lot of OOP ... but a OO purist would find flaws.