亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? graphview.m

?? 在iPhone OS上使用用Objective-C語言開發(fā)的Demo程序
?? M
字號:
/*===== IMPORTANT =====This is sample code demonstrating API, technology or techniques in development.Although this sample code has been reviewed for technical accuracy, it is notfinal. Apple is supplying this information to help you plan for the adoption ofthe technologies and programming interfaces described herein. This informationis subject to change, and software implemented based on this sample code shouldbe tested with final operating system software and final documentation. Newerversions of this sample code may be provided with future seeds of the API ortechnology. For information about updates to this and other developerdocumentation, view the New & Updated sidebars in subsequent documentationseeds.=====================File: GraphView.mAbstract: This class is responsible for updating and drawing the accelerometerhistory of values. The history is a circular buffer implementation, with apointer moving repeatedly through the buffer, resetting to zero each time itreaches the end.Version: 1.6Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.("Apple") in consideration of your agreement to the following terms, and youruse, installation, modification or redistribution of this Apple softwareconstitutes acceptance of these terms.  If you do not agree with these terms,please do not use, install, modify or redistribute this Apple software.In consideration of your agreement to abide by the following terms, and subjectto these terms, Apple grants you a personal, non-exclusive license, underApple's copyrights in this original Apple software (the "Apple Software"), touse, reproduce, modify and redistribute the Apple Software, with or withoutmodifications, in source and/or binary forms; provided that if you redistributethe Apple Software in its entirety and without modifications, you must retainthis notice and the following text and disclaimers in all such redistributionsof the Apple Software.Neither the name, trademarks, service marks or logos of Apple Inc. may be usedto endorse or promote products derived from the Apple Software without specificprior written permission from Apple.  Except as expressly stated in this notice,no other rights or licenses, express or implied, are granted by Apple herein,including but not limited to any patent rights that may be infringed by yourderivative works or by other works in which the Apple Software may beincorporated.The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NOWARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIEDWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR INCOMBINATION WITH YOUR PRODUCTS.IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL ORCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTEGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/ORDISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OFCONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IFAPPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Copyright (C) 2008 Apple Inc. All Rights Reserved.*/#import "GraphView.h"// Constant for maximum acceleration.#define kMaxAcceleration 3.0// Constant for the high-pass filter.#define kFilteringFactor 0.1// GraphView class implementation.@implementation GraphView// Instruct the compiler to generate accessors for the property, and use the internal variable _filter for storage.@synthesize filteringEnabled=filter;- (void)updateHistoryWithX:(float)x Y:(float)y Z:(float)z {    // If filtering is active, apply a basic high-pass filter to remove the gravity influence from the accelerometer values    if (filter) {        acceleration[0] = x * kFilteringFactor + acceleration[0] * (1.0 - kFilteringFactor);        history[nextIndex][0] = x - acceleration[0];        acceleration[1] = y * kFilteringFactor + acceleration[1] * (1.0 - kFilteringFactor);        history[nextIndex][1] = y - acceleration[1];        acceleration[2] = z * kFilteringFactor + acceleration[2] * (1.0 - kFilteringFactor);        history[nextIndex][2] = z - acceleration[2];    } else {        history[nextIndex][0] = x;        history[nextIndex][1] = y;        history[nextIndex][2] = z;    }    // Advance buffer pointer to next position or reset to zero.    nextIndex = (nextIndex + 1) % kHistorySize;}- (void)setFilteringEnabled:(BOOL)enabled {    filter = enabled;    // Reset the acceleration filter.    acceleration[0] = acceleration[1] = acceleration[2] = 0.0;}- (void)drawHistory:(unsigned)axis fromIndex:(unsigned)index inContext:(CGContextRef)context bounds:(CGRect)bounds {    UIFont *font = [UIFont systemFontOfSize:12];    unsigned i;    float value, temp;        // Draw the background    CGContextSetGrayFillColor(context, 0.6, 1.0);    CGContextFillRect(context, bounds);        // Draw the intermediate lines    CGContextSetGrayStrokeColor(context, 0.5, 1.0);    CGContextBeginPath(context);    for (value = -kMaxAcceleration + 1.0; value <= kMaxAcceleration - 1.0; value += 1.0) {            if (value == 0.0) {            continue;        }        temp = roundf(bounds.origin.y + bounds.size.height / 2 + value / (2 * kMaxAcceleration) * bounds.size.height);        CGContextMoveToPoint(context, bounds.origin.x, temp);        CGContextAddLineToPoint(context, bounds.origin.x + bounds.size.width, temp);    }    CGContextStrokePath(context);        // Draw the center line    CGContextSetGrayStrokeColor(context, 1.0, 1.0);    CGContextBeginPath(context);    temp = roundf(bounds.origin.y + bounds.size.height / 2);    CGContextMoveToPoint(context, bounds.origin.x, temp);    CGContextAddLineToPoint(context, bounds.origin.x + bounds.size.width, temp);    CGContextStrokePath(context);        // Draw the top & bottom lines    CGContextSetGrayStrokeColor(context, 0.25, 1.0);    CGContextBeginPath(context);    CGContextMoveToPoint(context, bounds.origin.x, bounds.origin.y);    CGContextAddLineToPoint(context, bounds.origin.x + bounds.size.width, bounds.origin.y);    CGContextMoveToPoint(context, bounds.origin.x, bounds.origin.y + bounds.size.height);    CGContextAddLineToPoint(context, bounds.origin.x + bounds.size.width, bounds.origin.y + bounds.size.height);    CGContextStrokePath(context);        // Draw the history lines    CGContextSetRGBStrokeColor(context, (axis == 0 ? 1.0 : 0.0), (axis == 1 ? 1.0 : 0.0), (axis == 2 ? 1.0 : 0.0), 1.0);    CGContextBeginPath(context);    for (i = 0; i < kHistorySize; ++i) {        // NOTE: We need to draw upside-down as UIView referential has the Y axis going down        value = history[(index + i) % kHistorySize][axis] / -kMaxAcceleration;         if (i > 0) {            CGContextAddLineToPoint(context, bounds.origin.x + (float)i / (float)(kHistorySize - 1) * bounds.size.width,                                     bounds.origin.y + bounds.size.height / 2 + value * bounds.size.height / 2);        } else {            CGContextMoveToPoint(context, bounds.origin.x + (float)i / (float)(kHistorySize - 1) * bounds.size.width,                                  bounds.origin.y + bounds.size.height / 2 + value * bounds.size.height / 2);        }    }    CGContextStrokePath(context);        // Draw the labels    CGContextSetGrayFillColor(context, 1.0, 1.0);    CGContextSetAllowsAntialiasing(context, true);    for (value = -kMaxAcceleration; value <= kMaxAcceleration - 1.0; value += 1.0) {        temp = roundf(bounds.origin.y + bounds.size.height / 2 + value / (2 * kMaxAcceleration) * bounds.size.height);        // NOTE: We need to draw upside-down as UIView referential has the Y axis going down        [[NSString stringWithFormat:@"%+.1f", -(value >= 0.0 ? value + 1.0 : value)]          drawAtPoint:CGPointMake(bounds.origin.x + 4, temp + (value >= 0.0 ? 3 : 0)) withFont:font];     }    temp = roundf(bounds.origin.y + bounds.size.height / 2);    CGPoint sPoint = CGPointMake(bounds.origin.x + bounds.size.width - 40, temp - 16);    [[NSString stringWithFormat:@"%c Axis", 'X' + axis] drawAtPoint:sPoint withFont:font];    CGContextSetAllowsAntialiasing(context, false);}- (void)drawRect:(CGRect)clip {    CGSize size = [self bounds].size;    CGContextRef context = UIGraphicsGetCurrentContext();    unsigned index = nextIndex, i;        // Draw the X, Y & Z graphs with anti-aliasing turned off    CGContextSetAllowsAntialiasing(context, false);    CGFloat hOver3 = size.height / 3, hOver4 = size.height / 4;    for (i = 0; i < 3; ++i) {        CGRect hBounds = CGRectMake(0, (hOver3 - hOver4) / 2 + (float)i * hOver3, size.width, hOver4);        [self drawHistory:i fromIndex:index inContext:context bounds:hBounds];    }    CGContextSetAllowsAntialiasing(context, true);  }@end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲激情图片小说视频| 国产高清精品久久久久| 九九久久精品视频| 在线免费一区三区| 国产精品嫩草久久久久| 久久99国产精品久久99| 欧日韩精品视频| 国产精品色哟哟| 国产盗摄女厕一区二区三区| 欧美日本一区二区三区四区| 中文字幕在线播放不卡一区| 激情国产一区二区| 国产精品国产三级国产aⅴ入口| 久久国产日韩欧美精品| 欧美日韩国产小视频在线观看| 综合欧美一区二区三区| 成人午夜在线播放| 国产亚洲一区字幕| 国产精品综合一区二区三区| 日韩视频免费直播| 青娱乐精品视频| 7777精品伊人久久久大香线蕉完整版 | 国产精品久久久久国产精品日日| 久久成人免费电影| 欧美一二三四区在线| 一区二区高清免费观看影视大全| 99久久精品免费看国产| 国产精品萝li| 91丨九色porny丨蝌蚪| 国产精品免费网站在线观看| 成人免费毛片片v| 国产精品电影一区二区| 99在线精品视频| 亚洲女人****多毛耸耸8| 色综合久久天天综合网| 亚洲一级二级三级| 欧美日韩黄色一区二区| 日产国产高清一区二区三区 | 国产女人18毛片水真多成人如厕| 极品少妇xxxx偷拍精品少妇| 2023国产一二三区日本精品2022| 精品一区二区三区久久| 国产蜜臀av在线一区二区三区| 丰满亚洲少妇av| **网站欧美大片在线观看| av一区二区三区四区| 亚洲精品久久嫩草网站秘色| 欧美日韩一区中文字幕| 亚洲欧美视频在线观看| 欧美日韩精品一区二区三区蜜桃 | 日韩国产欧美三级| 精品国产91九色蝌蚪| 国产一区二区三区| 最新热久久免费视频| 欧美色图天堂网| 免费观看在线综合色| 国产精品色一区二区三区| 在线亚洲免费视频| 蜜臀久久99精品久久久画质超高清| 久久综合av免费| 成人网页在线观看| 亚洲国产aⅴ天堂久久| 日韩免费高清av| 成人综合在线视频| 亚洲午夜久久久久久久久久久 | 欧美伊人久久大香线蕉综合69| 亚洲综合激情另类小说区| 精品欧美乱码久久久久久1区2区| 国产91综合网| 日本怡春院一区二区| 中文字幕亚洲区| 欧美一区三区二区| 97精品久久久久中文字幕| 日韩va亚洲va欧美va久久| 国产精品第一页第二页第三页| 欧美男生操女生| www.av亚洲| 国产一区二区剧情av在线| 亚洲最新视频在线播放| 久久精品亚洲一区二区三区浴池 | 欧美日韩国产系列| 成人精品一区二区三区中文字幕| 亚洲国产美女搞黄色| 国产精品高潮久久久久无| 日韩一区二区中文字幕| 色欧美乱欧美15图片| 国产成人精品在线看| 男男gaygay亚洲| 亚洲综合视频在线| **性色生活片久久毛片| 国产色综合久久| 日韩午夜在线影院| 欧美精品久久99| 欧美在线综合视频| 91香蕉视频污在线| 国产91在线观看丝袜| 国模冰冰炮一区二区| 日韩精品亚洲一区二区三区免费| 18成人在线观看| 成人免费一区二区三区在线观看| 国产日韩欧美不卡在线| 久久久蜜臀国产一区二区| 欧美成人高清电影在线| 91麻豆精品国产综合久久久久久| 欧美亚洲愉拍一区二区| 色婷婷一区二区| 色中色一区二区| 一本在线高清不卡dvd| av在线不卡网| 色综合久久88色综合天天免费| 99精品视频在线免费观看| 波多野结衣亚洲一区| 国产v日产∨综合v精品视频| 国产一区二区三区在线看麻豆| 久久99国产精品麻豆| 久久99国产乱子伦精品免费| 狠狠色丁香婷综合久久| 韩国v欧美v日本v亚洲v| 国产美女一区二区| 国产精品一区专区| 国产成人精品1024| 成人性生交大片免费| 成人a级免费电影| 99热精品国产| 欧美视频三区在线播放| 91.com视频| 久久在线观看免费| 国产精品美女久久久久av爽李琼 | 国产精品传媒在线| 亚洲精品视频在线| 亚洲大尺度视频在线观看| 午夜精品免费在线| 国模一区二区三区白浆| 成人性视频网站| 日本久久电影网| 91精品欧美综合在线观看最新| 日韩欧美国产三级| 国产精品久久国产精麻豆99网站| 国产精品欧美一级免费| 亚洲在线视频网站| 精品一区二区三区在线观看| 国产麻豆91精品| 欧美中文字幕不卡| 精品精品欲导航| 自拍偷拍亚洲激情| 男男成人高潮片免费网站| 成人av在线影院| 91麻豆精品久久久久蜜臀| 国产欧美日韩麻豆91| 亚洲成在人线免费| 国产福利精品一区二区| 欧美午夜宅男影院| 久久久精品中文字幕麻豆发布| 亚洲精品五月天| 国产精品影音先锋| 欧美日韩成人综合| 国产精品视频在线看| 日韩高清国产一区在线| 国产91精品露脸国语对白| 欧美日本在线观看| 日韩毛片一二三区| 黄色日韩三级电影| 欧美亚洲愉拍一区二区| 国产日韩欧美综合一区| 午夜av一区二区| 91丨九色丨黑人外教| 久久精品人人做人人爽97| 亚洲已满18点击进入久久| 国内精品国产成人国产三级粉色| 91浏览器入口在线观看| 精品国产sm最大网站免费看| 亚洲欧洲综合另类| 懂色av一区二区三区免费看| 日韩欧美第一区| 亚洲va中文字幕| 色综合网站在线| 欧美成人精品1314www| 首页亚洲欧美制服丝腿| 91热门视频在线观看| 国产欧美日韩精品a在线观看| 久久国产剧场电影| 6080日韩午夜伦伦午夜伦| 一区二区在线观看免费视频播放| 国产福利一区二区三区视频在线| 日韩女优av电影在线观看| 午夜一区二区三区在线观看| 色综合一区二区三区| 国产精品久线在线观看| 成人性视频免费网站| 国产偷v国产偷v亚洲高清| 国产精品一区二区久久不卡| 欧美一级一级性生活免费录像| 亚洲成人免费影院| 欧美性生活久久| 婷婷成人激情在线网| 欧美视频一区二区| 日韩激情在线观看| 制服丝袜亚洲网站| 日本在线不卡一区| 精品盗摄一区二区三区|