¡@

Home 

2014/10/16 ¤W¤È 08:22:54

android Programming Glossary: rgb

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

on YUV NV21 conversion to RGB According to http developer.android.com reference android graphics.. are quite a number of code on web regarding YUV NV21 to RGB conversion. However when I go through the code I doubt on the.. is as follow. public static void YUV_NV21_TO_RGB int argb byte yuv int width int height final int frameSize width..

Taking screenshot of Android OpenGL

http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl

glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer.. bitmap Bitmap.createBitmap width height Bitmap.Config.RGB_565 bitmap.setPixels data size width width 0 0 width height.. sbuf for int i 0 i size i BGR 565 to RGB 565 short v sdata i sdata i short v 0x1f 11 v 0x7e0 v 0xf800..

Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue

http://stackoverflow.com/questions/4354939/understanding-the-use-of-colormatrix-and-colormatrixcolorfilter-to-modify-a-draw

tells me that this is because it's doing the conversion on RGB values whereas for hue shifting the values should first be converted.. I would have is whether a matrix can be used to convert RGB to another color space with luminosity information such as L..

How to set text color of TextView in code?

http://stackoverflow.com/questions/4602902/how-to-set-text-color-of-textview-in-code

is just a class and text is of type TextView . Red is RGB value #FF0000 set in strings. But it shows different color rather..

Android: Coloring part of a string using TextView.setText()?

http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext

Color.rgb 158 158 158 Span to set text color to some RGB value final StyleSpan bss new StyleSpan android.graphics.Typeface.BOLD..

Extract black and white image from android camera's NV21 format

http://stackoverflow.com/questions/5272388/extract-black-and-white-image-from-android-cameras-nv21-format

I developed the following code to convert the NV21 to RGB and it is working. Converts YUV420 NV21 to RGB8888 @param data.. the NV21 to RGB and it is working. Converts YUV420 NV21 to RGB8888 @param data byte array on YUV420 NV21 format. @param width.. width pixels width @param height pixels height @return a RGB8888 pixels int array. Where each int is a pixels ARGB. public..

Understanding colors in Android! (6 chars)

http://stackoverflow.com/questions/5445085/understanding-colors-in-android-6-chars

this question If you provide 6 hex digits that means RGB 2 hex digits for each value of red green and blue . If you provide.. red green and blue . If you provide 8 hex digits it's an ARGB 2 hex digits for each value of alpha red green and blue respectively..

how to get RGB values of bitmap in android

http://stackoverflow.com/questions/5669501/how-to-get-rgb-values-of-bitmap-in-android

to get RGB values of bitmap in android I want to get RGB values of bitmap.. to get RGB values of bitmap in android I want to get RGB values of bitmap in android but I cant do this so far. My aim.. in android but I cant do this so far. My aim is to obtain RGB values for each pixel of bitmap. Is there any specific function..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

people have been trying to decode the byte array into an RGB format themselves. Seems like doing the decoding manually has.. AttributeSet attrs super context attrs rectanglePaint.setARGB 100 200 0 0 rectanglePaint.setStyle Paint.Style.FILL rectanglePaint.setStrokeWidth..

How to Get Pixel Colour in Android?

http://stackoverflow.com/questions/7807360/how-to-get-pixel-colour-in-android

return true Now what I need to do is to get the colour RGB value of the exact coordinates the user selects and later on..

Apply custom filters to camera output

http://stackoverflow.com/questions/8371055/apply-custom-filters-to-camera-output

is in YUV format which has to be converted to some sort of RGB format if you want to display it. This conversion is quite expensive.. is slow. You can try to convert data from YUV to RGB with native code and android NDK but that's quite complicated...

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

YUV RGB Image processing YUV during onPreviewFrame in android I am.. in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used.. used both function for encoding and decoding Yuv data to RGB as following public void onPreviewFrame byte data Camera camera..

How to get all image files available in sdcard in android? [duplicate]

http://stackoverflow.com/questions/10381270/how-to-get-all-image-files-available-in-sdcard-in-android

png item item pnm item item ppm item item ras item item rgb item item svg item item tif item item tiff item item xbm item..

Image processing with Android Camera

http://stackoverflow.com/questions/4373254/image-processing-with-android-camera

afterwards Thanks. android image image processing camera rgb share improve this question I found a sample application..

How to set text color of TextView in code?

http://stackoverflow.com/questions/4602902/how-to-set-text-color-of-textview-in-code

LEX uses text.setTextColor Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor.. Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor.. Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor Color.rgb..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

camera.getParameters .getPreviewSize .height final int rgb decodeYUV420SP data width height Bitmap bmp Bitmap.createBitmap.. data width height Bitmap bmp Bitmap.createBitmap rgb width height Bitmap.Config.ARGB_8888 String filename sdcard.. int width int height final int frameSize width height int rgb new int width height for int j 0 yp 0 j height j int uvp frameSize..

Android ExpandableListView with Checkbox, Controlling checked state

http://stackoverflow.com/questions/5068668/android-expandablelistview-with-checkbox-controlling-checked-state

createChildList R.layout.child_row new String shadeName rgb new int R.id.childname R.id.rgb @Override public View getChildView.. new String shadeName rgb new int R.id.childname R.id.rgb @Override public View getChildView final int groupPosition.. new HashMap child.put shadeName shades i n child.put rgb shades i n 1 secList.add child result.add secList return result..

Extract black and white image from android camera's NV21 format

http://stackoverflow.com/questions/5272388/extract-black-and-white-image-from-android-cameras-nv21-format

also called YCbCr 420 Semi Planar android android camera rgb format conversion share improve this question I developed..

how to get RGB values of bitmap in android

http://stackoverflow.com/questions/5669501/how-to-get-rgb-values-of-bitmap-in-android

for my project. Thanks android image image processing rgb share improve this question This may be slightly late but..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

private boolean isPreviewRunning false private byte rgbbuffer new byte 256 256 private int rgbints new int 256 256 protected.. false private byte rgbbuffer new byte 256 256 private int rgbints new int 256 256 protected final Paint rectanglePaint new.. and you can't do much with it until you convert it to rgb int bwCounter 0 int yuvsCounter 0 for int y 0 y 160 y System.arraycopy..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

use_size.width use_size.height void decodeYUV420SP byte rgb byte yuv420sp int width int height final int frameSize width.. g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 3 byte b 6 rgb yp 3 1 byte b 2 rgb yp 3 2 byte b 10 .. 0 b 0 else if b 262143 b 262143 rgb yp 3 byte b 6 rgb yp 3 1 byte b 2 rgb yp 3 2 byte b 10 Finally the MyRender..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

mWidth mHeight static public void decodeYUV420SP int rgba byte yuv420sp int width int height final int frameSize width.. g 262143 g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 0xff000000 r 6 0xff0000 g 2 0xff00 b 10 0xff rgba divide.. rgb yp 0xff000000 r 6 0xff0000 g 2 0xff00 b 10 0xff rgba divide 2^10 10 rgba yp r 14 0xff000000 g 6 0xff0000 b 2 0xff00..

Confusion on YUV NV21 conversion to RGB

http://stackoverflow.com/questions/12469730/confusion-on-yuv-nv21-conversion-to-rgb

on YUV NV21 conversion to RGB According to http developer.android.com reference android graphics ImageFormat.html#NV21 NV21 is the default used format... ImageFormat.html#NV21 NV21 is the default used format. There are quite a number of code on web regarding YUV NV21 to RGB conversion. However when I go through the code I doubt on the correctness of the code. The first component V should come.. common mistake or I have overlooked something Currently my implementation is as follow. public static void YUV_NV21_TO_RGB int argb byte yuv int width int height final int frameSize width height final int ii 0 final int ij 0 final int di 1 final..

Taking screenshot of Android OpenGL

http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl

buf ByteBuffer.allocateDirect size 4 buf.order ByteOrder.nativeOrder glContext.glReadPixels 0 0 width height GL10.GL_RGBA GL10.GL_UNSIGNED_BYTE buf int data new int size buf.asIntBuffer .get data buf null Bitmap bitmap Bitmap.createBitmap width.. int data new int size buf.asIntBuffer .get data buf null Bitmap bitmap Bitmap.createBitmap width height Bitmap.Config.RGB_565 bitmap.setPixels data size width width 0 0 width height data null short sdata new short size ShortBuffer sbuf ShortBuffer.wrap.. new short size ShortBuffer sbuf ShortBuffer.wrap sdata bitmap.copyPixelsToBuffer sbuf for int i 0 i size i BGR 565 to RGB 565 short v sdata i sdata i short v 0x1f 11 v 0x7e0 v 0xf800 11 sbuf.rewind bitmap.copyPixelsFromBuffer sbuf try FileOutputStream..

Understanding the Use of ColorMatrix and ColorMatrixColorFilter to Modify a Drawable's Hue

http://stackoverflow.com/questions/4354939/understanding-the-use-of-colormatrix-and-colormatrixcolorfilter-to-modify-a-draw

same problem i.e. whites gain coloring . Further reading tells me that this is because it's doing the conversion on RGB values whereas for hue shifting the values should first be converted to HSL values. So possibly I could write a class that.. a process it would be. Hmm okay so I suppose another question I would have is whether a matrix can be used to convert RGB to another color space with luminosity information such as L a b or HSL If so I could just multiply the matrix for that..

How to set text color of TextView in code?

http://stackoverflow.com/questions/4602902/how-to-set-text-color-of-textview-in-code

something like holder.text.setTextColor R.color.Red Where holder is just a class and text is of type TextView . Red is RGB value #FF0000 set in strings. But it shows different color rather then red. So I'm wandering that what kind of parameter..

Android: Coloring part of a string using TextView.setText()?

http://stackoverflow.com/questions/4897349/android-coloring-part-of-a-string-using-textview-settext

text here final ForegroundColorSpan fcs new ForegroundColorSpan Color.rgb 158 158 158 Span to set text color to some RGB value final StyleSpan bss new StyleSpan android.graphics.Typeface.BOLD Span to make text bold sb.setSpan fcs 0 4 Spannable.SPAN_INCLUSIVE_INCLUSIVE..

Extract black and white image from android camera's NV21 format

http://stackoverflow.com/questions/5272388/extract-black-and-white-image-from-android-cameras-nv21-format

camera rgb format conversion share improve this question I developed the following code to convert the NV21 to RGB and it is working. Converts YUV420 NV21 to RGB8888 @param data byte array on YUV420 NV21 format. @param width pixels width.. this question I developed the following code to convert the NV21 to RGB and it is working. Converts YUV420 NV21 to RGB8888 @param data byte array on YUV420 NV21 format. @param width pixels width @param height pixels height @return a RGB8888.. RGB8888 @param data byte array on YUV420 NV21 format. @param width pixels width @param height pixels height @return a RGB8888 pixels int array. Where each int is a pixels ARGB. public static int convertYUV420_NV21toRGB8888 byte data int width..

Understanding colors in Android! (6 chars)

http://stackoverflow.com/questions/5445085/understanding-colors-in-android-6-chars

by this right now. Thanks android colors share improve this question If you provide 6 hex digits that means RGB 2 hex digits for each value of red green and blue . If you provide 8 hex digits it's an ARGB 2 hex digits for each value.. 6 hex digits that means RGB 2 hex digits for each value of red green and blue . If you provide 8 hex digits it's an ARGB 2 hex digits for each value of alpha red green and blue respectively . So actually you're changing from R B4 G 55 B 55 to..

how to get RGB values of bitmap in android

http://stackoverflow.com/questions/5669501/how-to-get-rgb-values-of-bitmap-in-android

to get RGB values of bitmap in android I want to get RGB values of bitmap in android but I cant do this so far. My aim is to obtain.. to get RGB values of bitmap in android I want to get RGB values of bitmap in android but I cant do this so far. My aim is to obtain RGB values for each pixel of bitmap. Is there.. of bitmap in android I want to get RGB values of bitmap in android but I cant do this so far. My aim is to obtain RGB values for each pixel of bitmap. Is there any specific function for android or anything else Also I wonder that do I need..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

filed for this but don't don't what the status is on that. So people have been trying to decode the byte array into an RGB format themselves. Seems like doing the decoding manually has been kinda slow and people have had various degrees of success.. new Paint public MySurfaceView Context context AttributeSet attrs super context attrs rectanglePaint.setARGB 100 200 0 0 rectanglePaint.setStyle Paint.Style.FILL rectanglePaint.setStrokeWidth 2 mHolder getHolder mHolder.addCallback..

How to Get Pixel Colour in Android?

http://stackoverflow.com/questions/7807360/how-to-get-pixel-colour-in-android

blueValue 0 if greenValue 0 textViewCol.setText It is Red return true Now what I need to do is to get the colour RGB value of the exact coordinates the user selects and later on assign each to #FF0000 #00FF00 and #0000FF but for now please..

Apply custom filters to camera output

http://stackoverflow.com/questions/8371055/apply-custom-filters-to-camera-output

problem with performance. The byte from a camera is in YUV format which has to be converted to some sort of RGB format if you want to display it. This conversion is quite expensive operation and significantly lowers the output fps... will be low less than 8fps cause BitmapFactory.decodeByteArray is slow. You can try to convert data from YUV to RGB with native code and android NDK but that's quite complicated. The other option is to use openGL ES. You need GLSurfaceView..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

YUV RGB Image processing YUV during onPreviewFrame in android I am capturing image using SurfaceView and getting Yuv Raw preview.. Camera camera I have to perform some image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv data to RGB.. data than image preprocessing and back to Yuv data. I have used both function for encoding and decoding Yuv data to RGB as following public void onPreviewFrame byte data Camera camera Point cameraResolution configManager.getCameraResolution..

How to get all image files available in sdcard in android? [duplicate]

http://stackoverflow.com/questions/10381270/how-to-get-all-image-files-available-in-sdcard-in-android

item jpg item item jfif item item pbm item item pgm item item png item item pnm item item ppm item item ras item item rgb item item svg item item tif item item tiff item item xbm item item xpm item item xwd item string array resources Hope this..

Image processing with Android Camera

http://stackoverflow.com/questions/4373254/image-processing-with-android-camera

that decodes this to RGB and how the RGB values are used afterwards Thanks. android image image processing camera rgb share improve this question I found a sample application that translates the YUV420 into RGB and displays sort of real..

How to set text color of TextView in code?

http://stackoverflow.com/questions/4602902/how-to-set-text-color-of-textview-in-code

get the same effect of course. Color.parseColor Manual like LEX uses text.setTextColor Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor Color.rgb 200 0 0 holder.text.setTextColor.. of course. Color.parseColor Manual like LEX uses text.setTextColor Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor Color.rgb 200 0 0 holder.text.setTextColor Color.argb.. Color.parseColor Manual like LEX uses text.setTextColor Color.parseColor #FFFFFF Color.rgb and Color.argb Manual rgb Manual argb like Ganapathy uses holder.text.setTextColor Color.rgb 200 0 0 holder.text.setTextColor Color.argb 0 200 0 0..

Android - Problem whith converting preview frame to bitmap

http://stackoverflow.com/questions/4768165/android-problem-whith-converting-preview-frame-to-bitmap

width camera.getParameters .getPreviewSize .width int height camera.getParameters .getPreviewSize .height final int rgb decodeYUV420SP data width height Bitmap bmp Bitmap.createBitmap rgb width height Bitmap.Config.ARGB_8888 String filename.. .getPreviewSize .height final int rgb decodeYUV420SP data width height Bitmap bmp Bitmap.createBitmap rgb width height Bitmap.Config.ARGB_8888 String filename sdcard file index .jpg FileOutputStream out out new FileOutputStream.. this board i believe public int decodeYUV420SP byte yuv420sp int width int height final int frameSize width height int rgb new int width height for int j 0 yp 0 j height j int uvp frameSize j 1 width u 0 v 0 for int i 0 i width i yp int y 0xff..

Android ExpandableListView with Checkbox, Controlling checked state

http://stackoverflow.com/questions/5068668/android-expandablelistview-with-checkbox-controlling-checked-state

new String colorName new int R.id.childname createChildList R.layout.child_row new String shadeName rgb new int R.id.childname R.id.rgb @Override public View getChildView final int groupPosition final int childPosition boolean.. new int R.id.childname createChildList R.layout.child_row new String shadeName rgb new int R.id.childname R.id.rgb @Override public View getChildView final int groupPosition final int childPosition boolean isLastChild View convertView.. ArrayList for int n 0 n shades i .length n 2 HashMap child new HashMap child.put shadeName shades i n child.put rgb shades i n 1 secList.add child result.add secList return result android checkbox expandablelistview share improve..

Extract black and white image from android camera's NV21 format

http://stackoverflow.com/questions/5272388/extract-black-and-white-image-from-android-cameras-nv21-format

and white image extracted. EDIT Seems like that format is also called YCbCr 420 Semi Planar android android camera rgb format conversion share improve this question I developed the following code to convert the NV21 to RGB and it is working...

how to get RGB values of bitmap in android

http://stackoverflow.com/questions/5669501/how-to-get-rgb-values-of-bitmap-in-android

wonder that do I need colorMatrix function It is very important for my project. Thanks android image image processing rgb share improve this question This may be slightly late but to clear up the confusion with the use of 0xff In Java ints..

How can I manipulate the camera preview?

http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview

private SurfaceHolder mHolder private Camera mCamera private boolean isPreviewRunning false private byte rgbbuffer new byte 256 256 private int rgbints new int 256 256 protected final Paint rectanglePaint new Paint public MySurfaceView.. private Camera mCamera private boolean isPreviewRunning false private byte rgbbuffer new byte 256 256 private int rgbints new int 256 256 protected final Paint rectanglePaint new Paint public MySurfaceView Context context AttributeSet attrs.. this data value you're getting back is formatted in YUV format and you can't do much with it until you convert it to rgb int bwCounter 0 int yuvsCounter 0 for int y 0 y 160 y System.arraycopy data yuvsCounter rgbbuffer bwCounter 240 yuvsCounter..

Android Camera will not work. startPreview fails

http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails

use_size.height renderer.bindCameraTexture pixels use_size.width use_size.height void decodeYUV420SP byte rgb byte yuv420sp int width int height final int frameSize width height for int j 0 yp 0 j height j int uvp frameSize j 1 width.. else if r 262143 r 262143 if g 0 g 0 else if g 262143 g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 3 byte b 6 rgb yp 3 1 byte b 2 rgb yp 3 2 byte b 10 Finally the MyRender class public class MyRenderer implements.. r 262143 if g 0 g 0 else if g 262143 g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 3 byte b 6 rgb yp 3 1 byte b 2 rgb yp 3 2 byte b 10 Finally the MyRender class public class MyRenderer implements GLSurfaceView.Renderer..

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

http://stackoverflow.com/questions/9325861/converting-yuv-rgbimage-processing-yuv-during-onpreviewframe-in-android

Encode intArray to Yuv data encodeYUV420SP data mIntArray mWidth mHeight static public void decodeYUV420SP int rgba byte yuv420sp int width int height final int frameSize width height for int j 0 yp 0 j height j int uvp frameSize j 1 width.. if r 0 r 0 else if r 262143 r 262143 if g 0 g 0 else if g 262143 g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 0xff000000 r 6 0xff0000 g 2 0xff00 b 10 0xff rgba divide 2^10 10 rgba yp r 14 0xff000000 g 6 0xff0000 b 2 0xff00 .. if g 262143 g 262143 if b 0 b 0 else if b 262143 b 262143 rgb yp 0xff000000 r 6 0xff0000 g 2 0xff00 b 10 0xff rgba divide 2^10 10 rgba yp r 14 0xff000000 g 6 0xff0000 b 2 0xff00 static public void encodeYUV420SP_original byte yuv420sp..