¡@

Home 

2014/10/15 ¤U¤È 10:13:28

iphone Programming Glossary: rgb

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

to get the RGB values for a pixel on an image on the iphone I am writing an iPhone application and need to essentially.. to the 'eyedropper' tool in photoshop where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part.. a read only reference to data . Method 1 Writable Pixel Information I defined constants #define RGBA 4 #define RGBA_8_BIT 8 In my UIImage subclass I declared instance variables size_t bytesPerRow size_t..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like.. 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect..

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

to get the RGB values for a pixel on an image on the iphone I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool.. and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part but is there a way to convert the UIImage data into a bitmap.. by previous posts and at the bottom of this post provides a read only reference to data . Method 1 Writable Pixel Information I defined constants #define RGBA 4 #define RGBA_8_BIT 8 In my UIImage subclass I declared instance variables size_t bytesPerRow size_t byteCount size_t pixelCount CGContextRef context CGColorSpaceRef..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

CAGradientLayer gradient CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am not quite sure.. CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am not quite sure how to do this. I suppose..

How to get the RGB values for a pixel on an image on the iphone

http://stackoverflow.com/questions/144250/how-to-get-the-rgb-values-for-a-pixel-on-an-image-on-the-iphone

to get the RGB values for a pixel on an image on the iphone I am writing an iPhone application and need to essentially implement something.. something equivalent to the 'eyedropper' tool in photoshop where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part but is there a way.. of this post provides a read only reference to data . Method 1 Writable Pixel Information I defined constants #define RGBA 4 #define RGBA_8_BIT 8 In my UIImage subclass I declared instance variables size_t bytesPerRow size_t byteCount size_t..

How do I enter RGB values into Interface Builder?

http://stackoverflow.com/questions/2565008/how-do-i-enter-rgb-values-into-interface-builder

do I enter RGB values into Interface Builder How can I enter RGB or Hex color values for backgrounds in Interface Builder I can select.. do I enter RGB values into Interface Builder How can I enter RGB or Hex color values for backgrounds in Interface Builder I can select predefined colors but I would like to manually enter.. color values for backgrounds in Interface Builder I can select predefined colors but I would like to manually enter in RGB values. Where can I do this iphone cocoa touch xcode gui interface builder share improve this question Click on the..

Get Pixel color of UIImage

http://stackoverflow.com/questions/3284185/get-pixel-color-of-uiimage

Pixel color of UIImage How can I get the RGB value of a particular pixel in a UIImage iphone uiimage rgb pixel share improve this question You can't access the..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow.. CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am..

Get RGB value from UIColor presets

http://stackoverflow.com/questions/4700168/get-rgb-value-from-uicolor-presets

RGB value from UIColor presets I my application I pass RGB color value to server. My app uses UIColor predefined values like.. RGB value from UIColor presets I my application I pass RGB color value to server. My app uses UIColor predefined values like UIColor grayColor UIColor redColor . I know that I can.. but only for colors that are in RBG color space however UIColor grayColor is not. Is there any way to get RGB values for non RBG colors Thanks iphone objective c uicolor cgcolorspace share improve this question EDIT As of iOS..

How to change a particular color in an image?

http://stackoverflow.com/questions/8046643/how-to-change-a-particular-color-in-an-image

pixel share improve this question Here is the sketch of a possible solution using OpenCV Convert the image from RGB to HSV using cvCvtColor we only want to change the hue . Isolate a color with cvThreshold specifying a certain tolerance..

How to change thin image to fat image in iPhone SDK?

http://stackoverflow.com/questions/10186200/how-to-change-thin-image-to-fat-image-in-iphone-sdk

char pixels char data bytes this is where you manipulate the individual pixels assumes a 4 byte pixel consisting of rgb and alpha for PNGs without transparency use i 3 and remove int a for int i 0 i data length i 4 int r i int g i 1 int b i..

Convert image to grayscale

http://stackoverflow.com/questions/1298867/convert-image-to-grayscale

i int kRed 1 int kGreen 2 int kBlue 4 int colors kGreen int m_width i.size.width int m_height i.size.height uint32_t rgbImage uint32_t malloc m_width m_height sizeof uint32_t CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef.. sizeof uint32_t CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate rgbImage m_width m_height 8 m_width 4 colorSpace kCGBitmapByteOrder32Little kCGImageAlphaNoneSkipLast CGContextSetInterpolationQuality.. uint8_t m_imageData uint8_t malloc m_width m_height for int y 0 y m_height y for int x 0 x m_width x uint32_t rgbPixel rgbImage y m_width x uint32_t sum 0 count 0 if colors kRed sum rgbPixel 24 255 count if colors kGreen sum rgbPixel..

Objective C Find closest color (rgb) match

http://stackoverflow.com/questions/1767941/objective-c-find-closest-color-rgb-match

C Find closest color rgb match I have a predefined array of rgb values. I want to be able to compare a user defined color to my array and return.. C Find closest color rgb match I have a predefined array of rgb values. I want to be able to compare a user defined color to my array and return the closest match in Objective C. Any help.. defined color to my array and return the closest match in Objective C. Any help is greatly appreciated. iphone colors rgb match uicolor share improve this question You need to decide in what colour space you are testing. HSL is arguably a..

Objective-C RGB to HSB

http://stackoverflow.com/questions/2591013/objective-c-rgb-to-hsb

back to RGB to I can use CGContextRGBSetFillColor Are there any HSB functions Please help. iphone objective c colors rgb hsb share improve this question First please be aware that three numbers don't describe a color three numbers together..

UIImage rounded corners

http://stackoverflow.com/questions/262156/uiimage-rounded-corners

CGBitmapContextCreate NULL targetSize.width targetSize.height 8 0 colorSpace kCGImageAlphaPremultipliedLast free the rgb colorspace CGColorSpaceRelease colorSpace if mainViewContentContext NULL return NULL CGContextSetFillColorWithColor mainViewContentContext..

Converting from RGB to HSL with Objective C

http://stackoverflow.com/questions/3017553/converting-from-rgb-to-hsl-with-objective-c

and headed in the wrong direction. Does anyone know of a simple way to perform this conversion iphone objective c rgb hsl share improve this question NSColor is missing in iPhone SDK. You can use this utility to convert from RGB to HSL..

Get Pixel color of UIImage

http://stackoverflow.com/questions/3284185/get-pixel-color-of-uiimage

Pixel color of UIImage How can I get the RGB value of a particular pixel in a UIImage iphone uiimage rgb pixel share improve this question You can't access the raw data directly but by getting the CGImage of this image you..

Change background color of UIButton when Highlighted

http://stackoverflow.com/questions/4022763/change-background-color-of-uibutton-when-highlighted

CGRect rect super drawRect rect if self.highlighted YES CGContextRef ctx UIGraphicsGetCurrentContext CGColorSpaceRef rgb CGColorSpaceCreateDeviceRGB const CGFloat topGradientColorComponents CGColorGetComponents UIColor whiteColor .CGColor const.. 2 bottomGradientColorComponents 3 CGGradientRef gradient CGGradientCreateWithColorComponents rgb colors NULL sizeof colors sizeof colors 0 4 CGColorSpaceRelease rgb CGContextDrawLinearGradient ctx gradient CGPointMake.. gradient CGGradientCreateWithColorComponents rgb colors NULL sizeof colors sizeof colors 0 4 CGColorSpaceRelease rgb CGContextDrawLinearGradient ctx gradient CGPointMake 0 0 CGPointMake 0 self.bounds.size.height 0 CGGradientRelease gradient..

How to get RGB values from UIColor?

http://stackoverflow.com/questions/437113/how-to-get-rgb-values-from-uicolor

229 saturation 40 brightness 75 alpha 1 How can I retrieve RGB values from the created color object iphone rgb uicolor share improve this question const float colors CGColorGetComponents curView.backgroundColor.CGColor These links..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

CGBitmapContextCreate NULL rect.size.width rect.size.height 8 0 colorSpace kCGImageAlphaPremultipliedLast free the rgb colorspace CGColorSpaceRelease colorSpace if context NULL return NULL cerate mask CGFloat minx CGRectGetMinX rect midx..

polaroid filter from UIImage

http://stackoverflow.com/questions/5590216/polaroid-filter-from-uiimage

maxRGB double r double g double b if r g if r b return r else return b else if g b return g else return b void rgbToHsv double redIn double greenIn double blueIn double hue double saturation double value double min max delta min minRGB.. redIn double data i 255.0 greenIn double data i 1 255.0 blueIn double data i 2 255.0 alphaIn double data i 3 255.0 rgbToHsv redIn greenIn blueIn hue saturation value hue hue 0.7 if hue 360 hue 360 saturation saturation 1.3 if saturation.. on a pixel so that I can make it polaroid And third Am I on the right track Thanks in advance.. iphone image filter rgb hsv share improve this question This might be helpful from Camera taking filters from photoshop and reproducing them..

How to pull out the ARGB component from BitmapContext on iPhone?

http://stackoverflow.com/questions/561663/how-to-pull-out-the-argb-component-from-bitmapcontext-on-iphone

could not return the correct ARGB data I want. Any ideas about what's wrong with the code iphone image colors bitmap rgb share improve this question First of all you're leaking memory the pixelData memory never gets freed. For your usage..

Getting RGB pixel data from CGImage

http://stackoverflow.com/questions/6073259/getting-rgb-pixel-data-from-cgimage

to access the RGB values as integers. I think I am nearly there with this code UIImage theImage UIImage imageNamed @ rgb.png CGImageRef cgImageRef CGImageRetain theImage.CGImage CFDataRef imageData CGDataProviderCopyData CGImageGetDataProvider.. printf printf if col width 1 printf printf n Here's some sample output on two images I tried. They're both 5x3 rgb. The a.png image has an alpha channel while the b.rgb does not. a.png CGImageGetHeight 5 CGImageGetWidth 3 CGImageGetColorSpace.. some sample output on two images I tried. They're both 5x3 rgb. The a.png image has an alpha channel while the b.rgb does not. a.png CGImageGetHeight 5 CGImageGetWidth 3 CGImageGetColorSpace CGColorSpace 0x4d08ff0 kCGColorSpaceDeviceRGB..

Create image from RGB data?

http://stackoverflow.com/questions/7235991/create-image-from-rgb-data

image from RGB data I'm having real trouble with this. I have some raw rgb data values from 0 to 255 and want to display it as an image on the iphone but can't find out how to do it. Can anyone help.. some calculations and if there is an easy way to create a png or something that would be great. iphone xcode image rgb share improve this question a terribly primitive example similar to Mats' suggestion but this version uses an external.. const size_t Width 10 const size_t Height 10 const size_t Area Width Height const size_t ComponentsPerPixel 4 rgba uint8_t pixelData Area ComponentsPerPixel fill the pixels with a lovely opaque blue gradient for size_t i 0 i Area i const..

Extracting rgb from UIColor [duplicate]

http://stackoverflow.com/questions/816828/extracting-rgb-from-uicolor

rgb from UIColor duplicate This question already has an answer here How to get RGB values from UIColor 4 answers ..

How to animate images using bitmaps / rgb data in iOS

http://stackoverflow.com/questions/8959651/how-to-animate-images-using-bitmaps-rgb-data-in-ios

to animate images using bitmaps rgb data in iOS I'm programming a game on my iPhone and I have an image I want to animate say a walking person in a bitmap...