[android-developers] Re: How to prematurely stop a long-running SQLite query?
Ok. Can you describe more about your set of words. Are they all single words? how many distinct words are there? what is the distribution of word lengths? or are they phrases rather than words? Will the size of this list change? -broc On Sep 28, 11:17 pm, mjc147 westmead...@yahoo.co.uk wrote: On Sep 28, 6:02 am, Broc Seib broc.s...@gmail.com wrote: Perhaps aTriedata structure? I can see how that would be useful when searching on prefixes, but what about when doing free text search? Also, by mechanism I was thinking more along the lines of database, flat file (like a CSV) etc rather than logical data structure. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to invert colors within a region of a bitmap
You can use a ColorMatrix in your paint brush to translate the RGBA values of your image. Here is a way of changing the hue 180 degrees (inverting color only), but preserving lightness and saturation: Canvas c = new Canvas(destBitmap); Paint p = new Paint(); float[] mx = { 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }; ColorMatrix cm = new ColorMatrix(mx); p.setColorFilter(new ColorMatrixColorFilter(cm)); c.drawBitmap(srcBitmap, 0, 0, p); If you literally want to invert the bits, and make each RGB value equal to 255 minus its original value, then the matrix would look something like this: float[] mx = { -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f }; I didn't test this. Check out the ColorMatrix class docs. -broc On Jul 17, 7:48 pm, efu ericf...@gmail.com wrote: I have a Canvas backed by a bitmap that I want to invert the color for a rectangular region. The meaning of inversion is to flip the bits of all the colors pixels. I can't seem to find an easy way to do it using the Paint class. Any suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Bitmap from Camera Preview using BitmapFactory.decodeByteArray
Max, I also was trying to crop my preview to show it in a smaller space. But it would cram the whole image into the smaller view I created. I studied some of the android source code, tried and failed at many remedies, and finally settled on a tacky compromise: 1) I created a SurfaceView that fills the whole screen, and do the mCamera.setPreviewDisplay() to its surfaceHolder as you'd expect. 2) I covered the SurfaceView with other views set with a background color, leaving a small region to show the camera preview. I am not proud. But it delivers the proper illusion. I have to then crop the image in the same place after I take the picture. I would have liked to have a ViewPort type of view where I could have just zoomed in in the surface view where I wanted. Better yet if I could apply any 2D pipeline stuff from an invisible surfaceView and put the result into a visible surface view or canvas. On May 20, 3:56 pm, Max Salley msalley@gmail.com wrote: I'm trying to show a cropped version of the preview, but show it at native resolution rather than showing the entire thing scaled down. I discuss what I'm doing more here (http://groups.google.com/group/ android-developers/t/f95804f843d3711b). On May 20, 3:50 pm, Jason Proctor ja...@particularplace.com wrote: what do you want to do with the preview? if you just want to render it, then Camera will do that for you with setPreviewDisplay(). best thing to do if you want to do anything else == don't use Camera previews :-) I think I might go the offscreen buffer route and render when I can, as FPS doesn't matter to me in the slightest. I'm looking at creating a virtual canvas to draw to, but I'm not sure what to do with the YCbCrarray that can get it into a usable form. What would you suggest I do with the array? -- jason.software.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---