Re: [Interest] Quick3D mapping of png textures onto Item 3D

2012-09-20 Thread Satya Praveen Ganapathi
Hi,

I tried with the below code to resolve the transparent area of png shown
as black shaded:-

ViewPort
{
Width:parent.width
Height:parent.height
blending:true

Quad{
effect:Effect{
texture:img.png
}
}

However, it still shows the transparent area of png file as black
shaded.

Please let me know the solution or this is a known issue in Quick3D.

Best Regards,
Satya

-Original Message-
From: interest-bounces+praveen.s=hmie.co...@qt-project.org
[mailto:interest-bounces+praveen.s=hmie.co...@qt-project.org] On Behalf
Of Ramakanthreddy_Kesireddy
Sent: Thursday, September 20, 2012 10:25 AM
To: Thomas Senyk; interest@qt-project.org
Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

Hi,

We tried with below blending property in Effect but transparent area of
the png file is
still shown as black shaded.


Quad{

Effect{
texture:img.png
blending:true
}
}

Could you please let us know if we are mssing anything in this regard.

Br,
Ramakanth

From:
interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project.
org
[interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project
.org] on behalf of Thomas Senyk [thomas.se...@pelagicore.com]
Sent: Wednesday, September 19, 2012 5:13 PM
To: interest@qt-project.org
Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

As he is using QtQuick3D, the answer is simpler:
http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro
p

:)

Greets
Thomas

On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:
 2012/9/18 Satya Praveen Ganapathi pravee...@hmie.co.in:
  ...
  However, the png image is not getting displayed properly in 3D space
i.e.
  transparent area of the png file is
  shown as black shaded.

 Most probably you simply need to enable alpha blending: In OpenGL
 terms that usually means

 a) Turn blending on: glEnable(GL_BLEND)
 b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,
 GL_ONE_MINUS_SRC_ALPHA)

 Note: Premultiplied alpha textures (refer to Wikipedia or the Qt
 docs about the same topic) are to be preferred, in which case you
 would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)

 Here is a guy who is trying /exactly/ the same thing as you:

   http://galfar.vevb.net/imaging/smf/index.php?topic=296.0

 Depending on what you are trying to achieve the function glTexEnv()
 with argument GL_BLEND might be useful too (if you want to apply alpha
 blending at the moment when applying the texture - and if you want
 that the underlying surface colour shines through). Refer to the
 (possibly outdated) FAQ:


http://www.opengl.org/archives/resources/faq/technical/transparency.htm


 How you apply all this to Qt 3D I don't know - but I'm sure there must
 be this big Enable blending switch somewhere, too - refer to the
 docs (and if not, to my little understanding you can still mix in your
 own raw OpenGL code as above, no?).

 Cheers, Oliver
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



DISCLAIMER:
This email (including any attachments) is intended for the sole use of
the intended recipient/s and may contain material that is CONFIDENTIAL
AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or
copying or distribution or forwarding of any or all of the contents in
this message is STRICTLY PROHIBITED. If you are not the intended
recipient, please contact the sender by email and delete all copies;
your cooperation in this regard is appreciated.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Quick3D mapping of png textures onto Item 3D

2012-09-20 Thread Thomas Senyk
It's working for me.
I did a fresh build from source and used an old example and it's working.
I just use the qmlviewer (don't forget the -opengl argument)


One important thing to know:
Doing blending in a generic way for a library is a quite tricky task.
To do it properly one would need to sort all surfaces by there position in the 
3D-space (and even that is not the end solution if you want to be perfect) 
which is in most cases not really necessary and would consume a lot of cpu.
So I assume that's why this is not done in QtQuick3D and therefor the blending 
isn't optically correct.
But one should definitely see the blending! (adding a blue Rectangle as 
background helps seeing it ;) )



On Thu, September 20, 2012 02:40:13 PM Satya Praveen Ganapathi wrote:
 Hi,
 
 I tried with the below code to resolve the transparent area of png shown
 as black shaded:-
 
 ViewPort
 {
 Width:parent.width
 Height:parent.height
 blending:true
 
 Quad{
 effect:Effect{
 texture:img.png
 }
 }
 
 However, it still shows the transparent area of png file as black
 shaded.
 
 Please let me know the solution or this is a known issue in Quick3D.
 
 Best Regards,
 Satya
 
 -Original Message-
 From: interest-bounces+praveen.s=hmie.co...@qt-project.org
 [mailto:interest-bounces+praveen.s=hmie.co...@qt-project.org] On Behalf
 Of Ramakanthreddy_Kesireddy
 Sent: Thursday, September 20, 2012 10:25 AM
 To: Thomas Senyk; interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D
 
 Hi,
 
 We tried with below blending property in Effect but transparent area of
 the png file is
 still shown as black shaded.
 
 
 Quad{
 
 Effect{
 texture:img.png
 blending:true
 }
 }
 
 Could you please let us know if we are mssing anything in this regard.
 
 Br,
 Ramakanth
 
 From:
 interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project.
 org
 [interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project
 .org] on behalf of Thomas Senyk [thomas.se...@pelagicore.com]
 Sent: Wednesday, September 19, 2012 5:13 PM
 To: interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D
 
 As he is using QtQuick3D, the answer is simpler:
 http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro
 p
 
 :)
 
 Greets
 Thomas
 
 On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:
  2012/9/18 Satya Praveen Ganapathi pravee...@hmie.co.in:
   ...
   However, the png image is not getting displayed properly in 3D space
 
 i.e.
 
   transparent area of the png file is
   shown as black shaded.
  
  Most probably you simply need to enable alpha blending: In OpenGL
  terms that usually means
  
  a) Turn blending on: glEnable(GL_BLEND)
  b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,
  GL_ONE_MINUS_SRC_ALPHA)
  
  Note: Premultiplied alpha textures (refer to Wikipedia or the Qt
  docs about the same topic) are to be preferred, in which case you
  would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
  
  Here is a guy who is trying /exactly/ the same thing as you:
http://galfar.vevb.net/imaging/smf/index.php?topic=296.0
  
  Depending on what you are trying to achieve the function glTexEnv()
  with argument GL_BLEND might be useful too (if you want to apply alpha
  blending at the moment when applying the texture - and if you want
  that the underlying surface colour shines through). Refer to the
 
  (possibly outdated) FAQ:
 http://www.opengl.org/archives/resources/faq/technical/transparency.htm
 
  How you apply all this to Qt 3D I don't know - but I'm sure there must
  be this big Enable blending switch somewhere, too - refer to the
  docs (and if not, to my little understanding you can still mix in your
  own raw OpenGL code as above, no?).
  
  Cheers, Oliver
  ___
  Interest mailing list
  Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest
 
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
 
 
 
 DISCLAIMER:
 This email (including any attachments) is intended for the sole use of
 the intended recipient/s and may contain material that is CONFIDENTIAL
 AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or
 copying or distribution or forwarding of any or all of the contents in
 this message is STRICTLY PROHIBITED. If you are not the intended
 recipient, please contact the sender by email and delete all copies;
 your cooperation in this regard is appreciated.
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest/
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights 

Re: [Interest] Quick3D mapping of png textures onto Item 3D

2012-09-20 Thread Satya Praveen Ganapathi
Hi,
 
Thanks for the reply.
Actually we donot have mesh for the png files..so we need to use 3D Items 
predefined(like Quad,Cylnder etc).
I suppose there is no inbuilt 3D rectangle item.
 
Can I use 2.0 instead of 1.0 in the cube example that you shared?
 
import QtQuick 1.0
import Qt3D 1.0
import Qt3D.Shapes 1.0
 
Regards,
Satya



From: Thomas Senyk [mailto:thomas.se...@pelagicore.com]
Sent: Thu 9/20/2012 2:52 PM
To: Satya Praveen Ganapathi
Cc: Ramakanthreddy_Kesireddy; interest@qt-project.org
Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D



It's working for me.
I did a fresh build from source and used an old example and it's working.
I just use the qmlviewer (don't forget the -opengl argument)


One important thing to know:
Doing blending in a generic way for a library is a quite tricky task.
To do it properly one would need to sort all surfaces by there position in the
3D-space (and even that is not the end solution if you want to be perfect)
which is in most cases not really necessary and would consume a lot of cpu.
So I assume that's why this is not done in QtQuick3D and therefor the blending
isn't optically correct.
But one should definitely see the blending! (adding a blue Rectangle as
background helps seeing it ;) )



On Thu, September 20, 2012 02:40:13 PM Satya Praveen Ganapathi wrote:
 Hi,

 I tried with the below code to resolve the transparent area of png shown
 as black shaded:-

 ViewPort
 {
 Width:parent.width
 Height:parent.height
 blending:true

 Quad{
 effect:Effect{
 texture:img.png
 }
 }

 However, it still shows the transparent area of png file as black
 shaded.

 Please let me know the solution or this is a known issue in Quick3D.

 Best Regards,
 Satya

 -Original Message-
 From: interest-bounces+praveen.s=hmie.co...@qt-project.org
 [mailto:interest-bounces+praveen.s=hmie.co...@qt-project.org] On Behalf
 Of Ramakanthreddy_Kesireddy
 Sent: Thursday, September 20, 2012 10:25 AM
 To: Thomas Senyk; interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

 Hi,

 We tried with below blending property in Effect but transparent area of
 the png file is
 still shown as black shaded.


 Quad{

 Effect{
 texture:img.png
 blending:true
 }
 }

 Could you please let us know if we are mssing anything in this regard.

 Br,
 Ramakanth
 
 From:
 interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project.
 org
 [interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project
 .org] on behalf of Thomas Senyk [thomas.se...@pelagicore.com]
 Sent: Wednesday, September 19, 2012 5:13 PM
 To: interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

 As he is using QtQuick3D, the answer is simpler:
 http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro
 p

 :)

 Greets
 Thomas

 On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:
  2012/9/18 Satya Praveen Ganapathi pravee...@hmie.co.in:
   ...
   However, the png image is not getting displayed properly in 3D space

 i.e.

   transparent area of the png file is
   shown as black shaded.
 
  Most probably you simply need to enable alpha blending: In OpenGL
  terms that usually means
 
  a) Turn blending on: glEnable(GL_BLEND)
  b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,
  GL_ONE_MINUS_SRC_ALPHA)
 
  Note: Premultiplied alpha textures (refer to Wikipedia or the Qt
  docs about the same topic) are to be preferred, in which case you
  would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
 
  Here is a guy who is trying /exactly/ the same thing as you:
http://galfar.vevb.net/imaging/smf/index.php?topic=296.0
 
  Depending on what you are trying to achieve the function glTexEnv()
  with argument GL_BLEND might be useful too (if you want to apply alpha
  blending at the moment when applying the texture - and if you want
  that the underlying surface colour shines through). Refer to the

  (possibly outdated) FAQ:
 http://www.opengl.org/archives/resources/faq/technical/transparency.htm

  How you apply all this to Qt 3D I don't know - but I'm sure there must
  be this big Enable blending switch somewhere, too - refer to the
  docs (and if not, to my little understanding you can still mix in your
  own raw OpenGL code as above, no?).
 
  Cheers, Oliver
  ___
  Interest mailing list
  Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

 

 DISCLAIMER:
 This email (including any attachments) is intended for the sole use of
 the intended recipient/s and may contain material that is CONFIDENTIAL
 AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or
 

Re: [Interest] Quick3D mapping of png textures onto Item 3D

2012-09-20 Thread Satya Praveen Ganapathi
The example which you have sent is working only till the animation
completes.

 

When I use QtQuick2.0 in the example shared without any animation, the
blending doesnot works and the total .png is black in color.

 

Could you please let me know how to fix this issue in QtQuick3D.

 

Br,

Satya

 

From: Satya Praveen Ganapathi 
Sent: Thursday, September 20, 2012 4:20 PM
To: Thomas Senyk
Cc: Ramakanthreddy_Kesireddy; interest@qt-project.org
Subject: RE: [Interest] Quick3D mapping of png textures onto Item 3D

 

Hi,

 

Thanks for the reply.

Actually we donot have mesh for the png files..so we need to use 3D
Items predefined(like Quad,Cylnder etc).

I suppose there is no inbuilt 3D rectangle item.

 

Can I use 2.0 instead of 1.0 in the cube example that you shared?

 

import QtQuick 1.0
import Qt3D 1.0
import Qt3D.Shapes 1.0

 

Regards,

Satya



From: Thomas Senyk [mailto:thomas.se...@pelagicore.com]
Sent: Thu 9/20/2012 2:52 PM
To: Satya Praveen Ganapathi
Cc: Ramakanthreddy_Kesireddy; interest@qt-project.org
Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

It's working for me.
I did a fresh build from source and used an old example and it's
working.
I just use the qmlviewer (don't forget the -opengl argument)


One important thing to know:
Doing blending in a generic way for a library is a quite tricky task.
To do it properly one would need to sort all surfaces by there position
in the
3D-space (and even that is not the end solution if you want to be
perfect)
which is in most cases not really necessary and would consume a lot of
cpu.
So I assume that's why this is not done in QtQuick3D and therefor the
blending
isn't optically correct.
But one should definitely see the blending! (adding a blue Rectangle as
background helps seeing it ;) )



On Thu, September 20, 2012 02:40:13 PM Satya Praveen Ganapathi wrote:
 Hi,

 I tried with the below code to resolve the transparent area of png
shown
 as black shaded:-

 ViewPort
 {
 Width:parent.width
 Height:parent.height
 blending:true

 Quad{
 effect:Effect{
 texture:img.png
 }
 }

 However, it still shows the transparent area of png file as black
 shaded.

 Please let me know the solution or this is a known issue in Quick3D.

 Best Regards,
 Satya

 -Original Message-
 From: interest-bounces+praveen.s=hmie.co...@qt-project.org
 [mailto:interest-bounces+praveen.s=hmie.co...@qt-project.org] On
Behalf
 Of Ramakanthreddy_Kesireddy
 Sent: Thursday, September 20, 2012 10:25 AM
 To: Thomas Senyk; interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

 Hi,

 We tried with below blending property in Effect but transparent area
of
 the png file is
 still shown as black shaded.


 Quad{

 Effect{
 texture:img.png
 blending:true
 }
 }

 Could you please let us know if we are mssing anything in this regard.

 Br,
 Ramakanth
 
 From:

interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project.
 org

[interest-bounces+ramakanthreddy_kesireddy=mahindrasatyam.com@qt-project
 .org] on behalf of Thomas Senyk [thomas.se...@pelagicore.com]
 Sent: Wednesday, September 19, 2012 5:13 PM
 To: interest@qt-project.org
 Subject: Re: [Interest] Quick3D mapping of png textures onto Item 3D

 As he is using QtQuick3D, the answer is simpler:

http://doc.qt.digia.com/qt-quick3d-snapshot/qml-effect.html#blending-pro
 p

 :)

 Greets
 Thomas

 On Tue, September 18, 2012 08:57:55 AM Till Oliver Knoll wrote:
  2012/9/18 Satya Praveen Ganapathi pravee...@hmie.co.in:
   ...
   However, the png image is not getting displayed properly in 3D
space

 i.e.

   transparent area of the png file is
   shown as black shaded.
 
  Most probably you simply need to enable alpha blending: In OpenGL
  terms that usually means
 
  a) Turn blending on: glEnable(GL_BLEND)
  b) Define a blend function, e.g.: glBlendFunc(GL_SRC_ALPHA,
  GL_ONE_MINUS_SRC_ALPHA)
 
  Note: Premultiplied alpha textures (refer to Wikipedia or the Qt
  docs about the same topic) are to be preferred, in which case you
  would say glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
 
  Here is a guy who is trying /exactly/ the same thing as you:
http://galfar.vevb.net/imaging/smf/index.php?topic=296.0
 
  Depending on what you are trying to achieve the function glTexEnv()
  with argument GL_BLEND might be useful too (if you want to apply
alpha
  blending at the moment when applying the texture - and if you want
  that the underlying surface colour shines through). Refer to the

  (possibly outdated) FAQ:

http://www.opengl.org/archives/resources/faq/technical/transparency.htm

  How you apply all this to Qt 3D I don't know - but I'm sure there
must
  be this big Enable blending switch somewhere, too - refer to the
  docs (and if not, to my little understanding you can still mix in
your
  own raw OpenGL code as above, no?).
 
  Cheers, Oliver
  ___
 

[Interest] How to build Qt using multiple CPU's on Mac?

2012-09-20 Thread Tony Rietwyk
Hi Everybody, 

On windows when I run nmake after configure, it uses all of my CPU's and is
finished in under 2 hours.  

On mac OSX Lion with XCode 4.3.2, when I run make after configure, it only
uses 1 CPU.   My google fu is not working and I can't find the parameter for
make to get it to use more CPU's.  

(It seems the problems forcing Qt compile to target OSX 10.6 have come back
in 4.8.3, hence my need to build Qt a few times already).  

Thanks! 

Tony. 


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to build Qt using multiple CPU's on Mac?

2012-09-20 Thread Konstantin Tokarev


20.09.2012, 17:38, Tony Rietwyk t...@rightsoft.com.au:
 Hi Everybody,

 On windows when I run nmake after configure, it uses all of my CPU's and is
 finished in under 2 hours.

 On mac OSX Lion with XCode 4.3.2, when I run make after configure, it only
 uses 1 CPU.   My google fu is not working and I can't find the parameter for
 make to get it to use more CPU's.

make -jN, where N is a number of concurrent processes.

Read man make for more details.

-- 
Regards,
Konstantin
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to build Qt using multiple CPU's on Mac?

2012-09-20 Thread Sean Harmer
On Thursday 20 September 2012 23:38:54 Tony Rietwyk wrote:
 Hi Everybody,
 
 On windows when I run nmake after configure, it uses all of my CPU's and is
 finished in under 2 hours.
 
 On mac OSX Lion with XCode 4.3.2, when I run make after configure, it only
 uses 1 CPU.   My google fu is not working and I can't find the parameter for
 make to get it to use more CPU's.
 
 (It seems the problems forcing Qt compile to target OSX 10.6 have come back
 in 4.8.3, hence my need to build Qt a few times already).

export MAKEFLAGS=-j8 $MAKEFLAGS
./configure ...
make

That way even configure will use all of your CPUs when building qmake. 
(Objviously adjust the 8 to whatever number of cores you have).

Cheers,

Sean


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Qt at the (American) Embedded Systems Conference East

2012-09-20 Thread Atlant Schmidt
Folks:

  Yesterday, I attended the trade show at the Embedded Systems Conference
  East, held annually in Boston Massachusetts. I'm glad to say that Qt had a
  booth there on the trade show floor, staffed by Digia employees.

  This year, the story being told in the Qt booth was a good one, addressing
  many of the concerns that folks have raised on these mailing lists for the
  last two years or so since Elop set fire to Nokia; it's clear the Qt picture
  finally hangs together as a whole, something it never did while Qt was
  being managed by Nokia. Qt is once again marching forwards on the
  Windows and Macintosh desktops, on Android, on iOS, on embedded
  Linux, and on VxWorks.

  Congratulations to the Qt team (including the Digia folks) and I hope the
 show was a success for you! I hope we'll have the chance to meet again
 at another ESC soon!

  Atlant



This e-mail and the information, including any attachments, it contains are 
intended to be a confidential communication only to the person or entity to 
whom it is addressed and may contain information that is privileged. If the 
reader of this message is not the intended recipient, you are hereby notified 
that any dissemination, distribution or copying of this communication is 
strictly prohibited. If you have received this communication in error, please 
immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QColor methods saturation(), value() and getHsv() are incredibly slow

2012-09-20 Thread Jochen Pernsteiner
Hello,Im playing around with an application were I use a QImage with a RGB32 format.I used the QColor method saturation() and value() to compute these values (I do notneed hue), and found out that these functions (and naturally also getHSV()) are incredibly slow.I wrote a straightforward implementation of a RGB-to-SV conversion, which on myPC is 12-15 times faster than using QColors getHSV() method.Wikipedia has a good explanation of HSV: http://en.wikipedia.org/wiki/HSL_and_HSVThe only difference between my function and the QColor method(s) is thatthe LSB of saturation is not always the same. I guess this is a rounding issue.So my question is: Are these QColor methods so slow or am I doing something wrong?(The Qt version Im using is 4.8.2 (mingw open source) on Windows XP.)My function looks like this:typedef unsigned char u8;typedef unsigned short u16;typedef unsigned long u32;//--u8 max3(u8 a, u8 b, u8 c){ u8 max = (a  b) ? a : b; max = (max  c) ? max : c; return max;}//--u8 min3(u8 a, u8 b, u8 c){ u8 min = (a  b) ? b : a; min = (min  c) ? c : min; return min;}//--u16 rgb_to_sv(u32 rgb){ u8 red = (rgb  16)  0xff; u8 green = (rgb  8)  0xff; u8 blue = rgb  0xff; u8 max = max3(red,green,blue); u8 min = min3(red,green,blue);  if(max == 0) return 0; double saturation = (double)(max - min)/max; double tmp = saturation * 255; tmp += 0.5; u8 saturation_u8 = tmp;  return (saturation_u8  8) + max; // value = max}//--
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QColor methods saturation(), value() and getHsv() are incredibly slow

2012-09-20 Thread Constantin Makshin
If you look at the code of QColor::toHsv(), you'll see that:
1) *all* calculations are done in floating point (probably to get better
accuracy, but I can't say for sure);
2) most of the time is spent calculating hue.

So no wonder your mostly-integer no-hue function is faster.

On 09/20/2012 09:19 PM, Jochen Pernsteiner wrote:
 Hello,
 
 I'm playing around with an application were I use a QImage with a RGB32
 format.
 
 I used the QColor method saturation() and value() to compute these
 values (I do not
 need hue), and found out that these functions (and naturally also
 getHSV()) are incredibly slow.
 
 I wrote a straightforward implementation of a RGB-to-SV conversion,
 which on my
 PC is 12-15 times faster than using QColor's getHSV() method.
 
 Wikipedia has a good explanation of HSV:
 http://en.wikipedia.org/wiki/HSL_and_HSV
 
 The only difference between my function and the QColor method(s) is that
 the LSB of 'saturation' is not always the same. I guess this is a
 rounding issue.
 
 So my question is:
 Are these QColor methods so slow or am I doing something wrong?
 (The Qt version I'm using is 4.8.2 (mingw open source) on Windows XP.)
 
 
 
 My function looks like this:
 
 typedef unsigned char u8;
 typedef unsigned short u16;
 typedef unsigned long u32;
 
 //--
 u8 max3(u8 a, u8 b, u8 c)
 {
   u8 max = (a  b) ? a : b;
   max = (max  c) ? max : c;
   return max;
 }
 //--
 u8 min3(u8 a, u8 b, u8 c)
 {
   u8 min = (a  b) ? b : a;
   min = (min  c) ? c : min;
   return min;
 }
 //--
 u16 rgb_to_sv(u32 rgb)
 {
   u8 red = (rgb  16)  0xff;
   u8 green = (rgb  8)  0xff;
   u8 blue = rgb  0xff;
 
   u8 max = max3(red,green,blue);
   u8 min = min3(red,green,blue);
  
   if(max == 0) return 0;
 
   double saturation = (double)(max - min)/max;
   double tmp = saturation * 255;
   tmp += 0.5;
   u8 saturation_u8 = tmp;
  
   return (saturation_u8  8) + max; // value = max
 }
 //--



signature.asc
Description: OpenPGP digital signature
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Distributing custom qt build to a group of developers

2012-09-20 Thread Adam Light
My company currently has a Subversion repository for Qt that looks like
this:
/qtbuild
  /qt
  /build
/macosx
  /install
/macosx
/win32
/win64

The /qt directory contains a git checkout of qt.
The /install subdirectories contain the compiled frameworks/dlls for both a
debug and release build of qt.
The /build/macosx directory contains all of the object files generated when
compiling. These seem to be required to be able to step into qt code using
gdb.

When a new version of Qt is released, I checkout that tag in the /qt
directory and then rebuild Qt using certain configuration settings. I then
commit all changes (the new frameworks/dlls, object files, etc.) to the
Subversion repository. Other developers at my company can then update their
Subversion checkouts so they have the new version of Qt.

This works pretty well except that it requires checking a lot of binary
files into Subversion, and both committing the files and checking them out
is very slow. The size of the working copy is also extremely large (this
can be addressed partly by using Subversion's sparse checkout feature). The
repository on the server is also quite large.

We use this process in part because some developers use not-so-powerful
machines (and/or Windows virtual machines) on which compiling Qt can take
multiple hours. Furthermore, as long as everyone runs svn update when I
build a new version of Qt, we know that we are all using the same version
and libraries.

But I wonder whether there is a better way to handle this. How do other
groups handle this? Using the binaries and/or SDK available for download is
not an option for us because we need different configuration options and we
sometimes need to patch Qt's source to fix bugs that have not bee fixed in
Qt's git repository.

Thanks for any ideas.

Adam
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Distributing custom qt build to a group of developers

2012-09-20 Thread Lincoln Ramsay
On 21/09/12 09:03, Adam Light wrote:

 This works pretty well except that it requires checking a lot of 
 binary files into Subversion, and both committing the files and 
 checking them out is very slow.
...
 Furthermore, as long as everyone runs svn update when I build a new 
 version of Qt, we know that we are all using the same version and 
 libraries.

 But I wonder whether there is a better way to handle this.

You probably want to keep the source code in svn but do you really need 
to keep the binaries there? How often do people actually need old 
binaries? I'm going to assume the answer is not very often.

Perhaps a more useful system would be to store the source code in svn 
and keep only the most recent set of binaries (in a 
non-version-controlled directory). To get new binaries you can use say, 
rsync and to get new source you'd use svn. A trivial script could fetch 
both.

And thanks to the version-controlled sources you can still build an 
older set of binaries if you need them.

-- 
Link

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest