API problems with krita

Schleimer, Ben bensch128 at yahoo.com
Wed Jan 24 18:46:07 CET 2007


Hi Casper,
   The use case is that I'm implementing the image
completion algorithm which solves Ax=b where A a NxN
matrix (N=num. of pixels) of constants. b(size=N) is a
single channel of each pixel in the source image. x is
produced as a result of the operation and then needs
to be copied into the destination image.

So I am looking for an easy method to extract out all
of the pixels of a single channel without losing
precision:
KisColorSpace::extractChannelData(Q_UINT8* dst, const
Q_UINT8* src, const int numPixels, const int channel,
const KisColorInfo& dstFormat)=0;
and
KisColorSpace::extractChannelPixel(Q_UINT8* dst, const
Q_UINT8* src, const int channel, const KisColorInof&
dstFormat)=0;

Then the symmetric operation would be to inject the
channel back into the destination image:
KisColorSpace::injectChannelData(Q_UINT8* dst, const
Q_UINT8* src, const int numPixels, const int channel,
const KisColorInfo& srcFormat)=0;
and
KisColorSpace::injectChannelPixel(Q_UINT8* dst, const
Q_UINT8* src, const int channel, const KisColorInof&
srcFormat)=0;

Does this make sense? Is there functionality in krita
to do this already?

--- Casper Boemann <cbr at boemann.dk> wrote:

> Hi
> 
> can you give an example of symetrical component
> operation
> 
> There is a reason why we don't provide access to
> components - you don't know 
> what the components mean - restricting access helps
> enforce colorspace 
> independence
> 
> this said im very much interested in hearing your
> use case
> 
> best regards
> casper boemann
> 
> ----- Original Message ----- 
> From: "Schleimer, Ben" <bensch128 at yahoo.com>
> To: <kimageshop at kde.org>
> Sent: Wednesday, January 24, 2007 3:35 PM
> Subject: API problems with krita
> 
> 
> > Hi,
> >  I am in the process of building a plugin for
> krita
> > and I want to share a annoyance/ difficulity i
> found:
> > ----------------
> > KisColorSpace doesn't have any method for
> > symmetrically extracting out and putting in a
> > component of a pixel. So all symmetrical component
> > operations have to be done with with:
> >  a)
> KisPaintDevice::convertToQImage/convertFromQImage
> > - which ignores higher precision for 16bit images
> >  b) KisColorSpace::fromQColor/toQColor - same
> problem
> > as above and difficult to use.
> >
> > Ideally, KisColorSpace and KisIteratorPixelTrait
> could
> > be used together to set/get pixels from
> KisPaintDevice
> >
> > Should I file this as a bug?
> >
> >
> > Cheers,
> > Ben
> >
> > "He who writes the code gets to choose his
> license, and nobody else gets 
> > to complain" - Linus Torvalds
> > IMHO, it should read - "He who writes the code
> gets to choose his license, 
> > and everybody else complains."
> >
> >
> >
> >
> > _______________________________________________
> > kimageshop mailing list
> > kimageshop at kde.org
> > https://mail.kde.org/mailman/listinfo/kimageshop
> > 
> 
> 


 Cheers,
Ben

"He who writes the code gets to choose his license, and nobody else gets to complain" - Linus Torvalds
IMHO, it should read - "He who writes the code gets to choose his license, and everybody else complains."
 





More information about the kimageshop mailing list