Enviar búsqueda
Cargar
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
•
6 recomendaciones
•
13,914 vistas
Atsushi Tadokoro
Seguir
Educación
Tecnología
Arte y fotografía
Denunciar
Compartir
Denunciar
Compartir
1 de 64
Descargar ahora
Descargar para leer sin conexión
Recomendados
openFrameworks addonを利用する ofxControlPanel ofxOpenCv - 多摩美メディアアートII
openFrameworks addonを利用する ofxControlPanel ofxOpenCv - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks基礎 - 新規プロジェクトの作成、図形を描く 芸大グラフィクスプログラミングB
openFrameworks基礎 - 新規プロジェクトの作成、図形を描く 芸大グラフィクスプログラミングB
Atsushi Tadokoro
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B
openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B
Atsushi Tadokoro
Sbaw091013
Sbaw091013
Atsushi Tadokoro
Most Common JavaScript Mistakes
Most Common JavaScript Mistakes
Yoann Gotthilf
Recomendados
openFrameworks addonを利用する ofxControlPanel ofxOpenCv - 多摩美メディアアートII
openFrameworks addonを利用する ofxControlPanel ofxOpenCv - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks基礎 - 新規プロジェクトの作成、図形を描く 芸大グラフィクスプログラミングB
openFrameworks基礎 - 新規プロジェクトの作成、図形を描く 芸大グラフィクスプログラミングB
Atsushi Tadokoro
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
openFrameworks 動きを生みだす様々なアルゴリズム - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
openFrameworks、プログラムの制御構造の基本 - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks入門 - 多摩美メディアアートII
openFrameworks入門 - 多摩美メディアアートII
Atsushi Tadokoro
openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B
openFrameworks基礎 動きを生みだす、アニメーション入門 - 芸大グラフィックスプログラミング演習B
Atsushi Tadokoro
Sbaw091013
Sbaw091013
Atsushi Tadokoro
Most Common JavaScript Mistakes
Most Common JavaScript Mistakes
Yoann Gotthilf
Bifurcaciones (Ejemplo)
Bifurcaciones (Ejemplo)
santiagovargasm
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
SPECIA
Sbaw090630
Sbaw090630
Atsushi Tadokoro
Sbaw091027
Sbaw091027
guest1800f5b
week-24x
week-24x
KITE www.kitecolleges.com
Dsa 1
Dsa 1
Harisrasheed48
Info clasa
Info clasa
Ilinca Ostroschi
Dij
Dij
Tushar Bedke
python-geohex
python-geohex
遼 会田
JavaScript Assíncrono
JavaScript Assíncrono
Natã Barbosa
Alejandro
Alejandro
Alejandro Gomez
Антон Полухин. C++17
Антон Полухин. C++17
Sergey Platonov
Daniel snake
Daniel snake
Tefaa Salazar
C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
Meita Jayani
Metodos Numericos
Metodos Numericos
andres felipe chamorro
JavaScript
JavaScript
Aleksandr Motsjonov
Programming in C
Programming in C
Vineet Kumar Saini
Vatesh
Vatesh
vatesh
ບົດລາຍງານ Honda gl09
ບົດລາຍງານ Honda gl09
kesukei
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
Atsushi Tadokoro
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
Atsushi Tadokoro
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
Atsushi Tadokoro
Más contenido relacionado
La actualidad más candente
Bifurcaciones (Ejemplo)
Bifurcaciones (Ejemplo)
santiagovargasm
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
SPECIA
Sbaw090630
Sbaw090630
Atsushi Tadokoro
Sbaw091027
Sbaw091027
guest1800f5b
week-24x
week-24x
KITE www.kitecolleges.com
Dsa 1
Dsa 1
Harisrasheed48
Info clasa
Info clasa
Ilinca Ostroschi
Dij
Dij
Tushar Bedke
python-geohex
python-geohex
遼 会田
JavaScript Assíncrono
JavaScript Assíncrono
Natã Barbosa
Alejandro
Alejandro
Alejandro Gomez
Антон Полухин. C++17
Антон Полухин. C++17
Sergey Platonov
Daniel snake
Daniel snake
Tefaa Salazar
C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
Meita Jayani
Metodos Numericos
Metodos Numericos
andres felipe chamorro
JavaScript
JavaScript
Aleksandr Motsjonov
Programming in C
Programming in C
Vineet Kumar Saini
Vatesh
Vatesh
vatesh
ບົດລາຍງານ Honda gl09
ບົດລາຍງານ Honda gl09
kesukei
La actualidad más candente
(19)
Bifurcaciones (Ejemplo)
Bifurcaciones (Ejemplo)
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Второй экрана для “Еды". Владимир Павликов. Kelnik. 29.01.2014
Sbaw090630
Sbaw090630
Sbaw091027
Sbaw091027
week-24x
week-24x
Dsa 1
Dsa 1
Info clasa
Info clasa
Dij
Dij
python-geohex
python-geohex
JavaScript Assíncrono
JavaScript Assíncrono
Alejandro
Alejandro
Антон Полухин. C++17
Антон Полухин. C++17
Daniel snake
Daniel snake
C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
Metodos Numericos
Metodos Numericos
JavaScript
JavaScript
Programming in C
Programming in C
Vatesh
Vatesh
ບົດລາຍງານ Honda gl09
ບົດລາຍງານ Honda gl09
Más de Atsushi Tadokoro
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
Atsushi Tadokoro
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
Atsushi Tadokoro
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
Atsushi Tadokoro
coma Creators session vol.2
coma Creators session vol.2
Atsushi Tadokoro
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
Atsushi Tadokoro
Interactive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
Atsushi Tadokoro
Interactive Music II Processing基本
Interactive Music II Processing基本
Atsushi Tadokoro
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Atsushi Tadokoro
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Atsushi Tadokoro
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Atsushi Tadokoro
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
Atsushi Tadokoro
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
Atsushi Tadokoro
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
Atsushi Tadokoro
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Atsushi Tadokoro
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
Atsushi Tadokoro
Tamabi media131118
Tamabi media131118
Atsushi Tadokoro
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Atsushi Tadokoro
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Atsushi Tadokoro
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
Atsushi Tadokoro
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
Atsushi Tadokoro
Más de Atsushi Tadokoro
(20)
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
coma Creators session vol.2
coma Creators session vol.2
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
Interactive Music II Processing基本
Interactive Music II Processing基本
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
Tamabi media131118
Tamabi media131118
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
openFrameworks 外部ファイルを利用する - 画像、動画 - 多摩美メディアアートII
1.
2.
‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣ ‣
3.
‣ ‣ http://goo.gl/T5sov
4.
‣ ‣ ‣
5.
‣
6.
‣
7.
‣ ‣
8.
‣ ‣
9.
‣
R G B A R G B A R R G B R G B R G B K K K K K K K K K
10.
‣ ‣ //ofImage ofImage myImage; // myImage.loadImage("
"); ! // myImage.draw(float x, float y, float w, float h);
11.
‣ ‣ ‣
12.
‣ #pragma once #include "ofMain.h" class
testApp : public ofBaseApp{ ! public: ! void setup(); ! void update(); ! void draw(); ! //ofImage ! ofImage myImage; };
13.
‣ #include "testApp.h" void testApp::setup(){ !
ofBackground(0, 0, 0); ! ! // ! myImage.loadImage("t_hero.png"); ! } void testApp::update(){ } void testApp::draw(){ ! // ! int left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ! // ! myImage.draw(left, top); }
14.
‣
15.
‣ ‣ ‣ unsigned char *
pixels = rioImage.getPixels(); ‣
16.
‣ ‣ ‣ ‣ ‣ ‣
17.
‣ #include "testApp.h" void testApp::setup(){ !
ofBackground(0, 0, 0); ! ! // ! myImage.loadImage("t_hero.png"); } void testApp::update(){ } void testApp::draw(){ ! // ! int left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! ! // ! unsigned char * pixels = myImage.getPixels();
18.
‣ !
//20 Rect ! int skip = 20; ! for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! int brightness = pixels[j*myImage.width + i]; ! ! ! ofSetColor(brightness, brightness, brightness); ! ! ! ofRect(i, j, skip, skip);! ! ! } ! } }
19.
‣
20.
‣ ‣ ‣
21.
‣ void testApp::draw(){ ! // !
int left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! ! // ! unsigned char * pixels = myImage.getPixels(); ! //10 Rect ! int skip = 12; ! ofSetColor(0, 0, 0); ! for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! int brightness = pixels[j*myImage.width + i]; ! ! ! // (%) ! ! ! float pct = 1.0 - brightness / 255.0f; ! ! ! // ! ! ! ofCircle(i, j, pct * skip * 0.5); ! ! } ! } }
22.
‣
23.
‣
24.
‣ void testApp::draw(){ ! int
left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! unsigned char * pixels = myImage.getPixels(); ! int skip = 8; ! ofSetColor(255, 255, 255); ! ofSetLineWidth(3); ! for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! int brightness = pixels[j*myImage.width + i]; ! ! ! float pct = 1.0 - brightness / 255.0f; ! ! ! // ! ! ! ofPushMatrix(); ! ! ! ofTranslate(i, j); ! ! ! ofRotateZ(pct * 90); ! ! ! ofLine(-skip, 0, skip, 0); ! ! ! ofPopMatrix(); ! ! } ! } }
25.
‣
26.
‣
27.
‣ ‣ ‣ ‣
28.
‣ #include "testApp.h" void testApp::setup(){ !
ofBackground(255, 255, 255); ! // ! myImage.loadImage("t_hero.png"); ! ! //8 ! pixelString = " .-+*a&@"; ! } void testApp::update(){! } void testApp::draw(){ ! int left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! unsigned char * pixels = myImage.getPixels(); ! int skip = 6; ! ofSetColor(0, 0, 0);
29.
‣ ! !
for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! int brightness = pixels[j*myImage.width + i]; ! ! ! float pct = 1.0 - brightness / 255.0f; ! ! ! // ! ! ! string str = pixelString.substr(int(pct * 8),1); ! ! ! // ! ! ! ofDrawBitmapString(str, i, j); ! ! } ! } }
30.
‣
31.
‣ ‣
R G B R G B R G B ‣ ‣ ‣ ‣
32.
‣ void testApp::draw(){ ! // !
int left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! ! // ! unsigned char * pixels = myImage.getPixels(); ! //10 Rect ! int skip = 10; ! for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! //RGB ! ! ! int r = pixels[j * myImage.width * 3 + i * 3]; ! ! ! int g = pixels[j * myImage.width * 3 + i * 3 + 1]; ! ! ! int b = pixels[j * myImage.width * 3 + i * 3 + 2]; ! ! ! // ! ! ! ofSetColor(r, g, b); ! ! ! ofRect(i, j, skip, skip);! ! ! } ! } }
33.
‣
34.
‣ ‣ ‣ ‣
35.
‣ void testApp::draw(){ ! int
left = (ofGetWidth() - myImage.width) / 2; ! int top = (ofGetHeight() - myImage.height) / 2; ! ofTranslate(left, top); ! unsigned char * pixels = myImage.getPixels(); ! int skip = 8; ! for (int i = 0; i < myImage.width; i = i + skip){ ! ! for (int j = 0; j < myImage.height; j = j + skip){ ! ! ! int r = pixels[j * myImage.width * 3 + i * 3]; ! ! ! int g = pixels[j * myImage.width * 3 + i * 3 + 1]; ! ! ! int b = pixels[j * myImage.width * 3 + i * 3 + 2]; ! ! ! int brightness = (r + g + b) / 3.0f * 255.0f; ! ! ! float pct = 1.0 - (r + g + b) / 3.0f / 255.0f; ! ! ! // ! ! ! ofSetColor(r, g, b); ! ! ! ofPushMatrix(); ! ! ! ofTranslate(i, j); ! ! ! ofRotateZ(pct * 360); ! ! ! ofLine(-pct*skip*4, 0, pct*skip*4, 0); ! ! ! ofPopMatrix(); ! ! } ! } }
36.
‣
37.
‣ ‣
38.
‣ ‣ ‣ ‣
39.
‣
40.
‣ #pragma once #include "ofMain.h" class
testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); ! // ofVideoGrabber myVideo; };
41.
‣ #include "testApp.h" void testApp::setup(){ !
ofSetFrameRate(60); ! ofBackground(0, 0, 0); ! //640x480 pixel myVideo.initGrabber(640, 480, true); } void testApp::update(){ ! // myVideo.update(); } void testApp::draw(){ ! // ! int left = (ofGetWidth() - myVideo.width) / 2; ! int top = (ofGetHeight() - myVideo.height) / 2; ! ofTranslate(left, top); ! ! // ! myVideo.draw(0, 0); }
42.
‣ ‣
43.
‣ #include "testApp.h" void testApp::setup(){ !
ofSetFrameRate(60); ! ofBackground(0, 0, 0); ! ofSetRectMode(OF_RECTMODE_CENTER); ! ! //640x480 pixel myVideo.initGrabber(800, 600, true); } void testApp::update(){ ! // myVideo.update(); } void testApp::draw(){ ! // ! int left = (ofGetWidth() - myVideo.width) / 2; ! int top = (ofGetHeight() - myVideo.height) / 2; ! ofTranslate(left, top); ! ! // ! unsigned char * pixels = myVideo.getPixels();
44.
‣ !
int skip = 12; ! for (int i = 0; i < myVideo.width; i = i + skip){ ! ! for (int j = 0; j < myVideo.height; j = j + skip){ //RGB int r = pixels[j * myVideo.width * 3 + i * 3]; ! ! ! int g = pixels[j * myVideo.width * 3 + i * 3 + 1]; ! ! ! int b = pixels[j * myVideo.width * 3 + i * 3 + 2]; ! ! ! // ! ! ! int brightness = (r + g + b) / 3.0f * 255.0f; ! ! ! float pct = (r + g + b) / 3.0f / 255.0f; ! ! ! // ! ! ! ofSetColor(255,255,255); ! ! ! ofPushMatrix(); ! ! ! ofTranslate(i, j); ! ! ! ofRotateZ(pct * 180); ! ! ! ofRect(0, 0, skip * pct, skip * pct); ! ! ! ofPopMatrix(); ! ! } ! } }
45.
‣
46.
‣ ‣
47.
‣ #include "testApp.h" void testApp::setup(){ !
ofSetFrameRate(60); ! ofBackground(255, 255, 255); ! ofSetRectMode(OF_RECTMODE_CENTER); ! //8 ! pixelString = " .-+*a&@"; ! //640x480 pixel myVideo.initGrabber(800, 600, true); } void testApp::update(){ ! // myVideo.update(); } void testApp::draw(){ ! // ! int left = (ofGetWidth() - myVideo.width) / 2; ! int top = (ofGetHeight() - myVideo.height) / 2; ! // ! unsigned char * pixels = myVideo.getPixels();
48.
‣ !
int skip = 8; ! ofTranslate(left, top+skip); ! ofSetColor(0, 0, 0); ! for (int i = 0; i < myVideo.width; i = i + skip){ ! ! for (int j = 0; j < myVideo.height; j = j + skip){ ! ! ! //RGB ! ! ! int r = pixels[j * myVideo.width * 3 + i * 3]; ! ! ! int g = pixels[j * myVideo.width * 3 + i * 3 + 1]; ! ! ! int b = pixels[j * myVideo.width * 3 + i * 3 + 2]; ! ! ! // ! ! ! float pct = 1.0 - (r + g + b) / 3.0f / 255.0f; ! ! ! // ! ! ! string str = pixelString.substr(int(pct * 8),1); ! ! ! // ! ! ! ofDrawBitmapString(str, i, j); ! ! } ! } }
49.
‣
50.
‣ ‣
51.
‣ ‣ ‣ ‣ http://www.ustream.tv/recorded/16077641
52.
‣ ‣
53.
‣ #pragma once #include "ofMain.h" class
testApp : public ofBaseApp { ! public: ! void setup(); ! void update(); ! void draw(); ! void keyPressed(int key); ! void mousePressed(int x, int y, int button); ! ! void reset(); ! ofImage img; ! ofImageQualityType quality; };
54.
‣ #include "testApp.h" void testApp::setup()
{ ! ofSetFrameRate(60); ! ofSetBackgroundAuto(false); ! //Jpeg ! quality = OF_IMAGE_QUALITY_WORST; ! // ! reset(); } void testApp::reset() { ! // ! img.loadImage("input.jpg"); } void testApp::update() { ! //Jpeg ! string compressedFilename = "compressed.jpg"; ! //Jpeg ! img.saveImage(compressedFilename, quality); ! ofBuffer file = ofBufferFromFile(compressedFilename); ! int fileSize = file.size();
55.
‣ !
//Jepg ! char * buffer = file.getBinaryBuffer(); ! // ! int whichByte = (int) ofRandom(fileSize); ! //ON bit ! int whichBit = ofRandom(8); ! // ( ?) ! char bitMask = 1 << whichBit; ! buffer[whichByte] |= bitMask; ! //glitch ! ofBufferToFile(compressedFilename, file); ! // ! img.loadImage(compressedFilename); } void testApp::draw() { ! //glitch ! ofSetColor(255,255,255); ! img.draw(0, 0, ofGetWidth(), ofGetHeight()); }
56.
‣ void testApp::keyPressed
(int key){ ! // ! reset(); } void testApp::mousePressed(int x, int y, int button){ ! // ! reset(); }
57.
‣
58.
‣
59.
‣ #pragma once #include "ofMain.h" class
testApp : public ofBaseApp { ! public: ! void setup(); ! void update(); ! void draw(); ! void keyPressed(int key); ! void mousePressed(int x, int y, int button); ! ! void reset();! ! ofImage img; ! ofImageQualityType quality; ! ofVideoGrabber myVideo; };
60.
‣ #include "testApp.h" void testApp::setup()
{ ! ofSetFrameRate(60); ! quality = OF_IMAGE_QUALITY_WORST; ! // ! myVideo.initGrabber(320, 240, true); ! // ofImage ! img.grabScreen(0, 0, ofGetWidth(), ofGetHeight()); } void testApp::reset() { ! // ! myVideo.update(); ! // 1 ! myVideo.draw(0, 0, ofGetWidth(), ofGetHeight()); ! // ofImage ! img.grabScreen(0, 0, ofGetWidth(), ofGetHeight()); }
61.
‣ void testApp::update() { !
//Jpeg ! string compressedFilename = "compressed.jpg"; ! //Jpeg ! img.saveImage(compressedFilename, quality); ! ofBuffer file = ofBufferFromFile(compressedFilename); ! int fileSize = file.size(); ! //Jepg ! char * buffer = file.getBinaryBuffer(); ! // ! int whichByte = (int) ofRandom(fileSize); ! //ON bit ! int whichBit = ofRandom(8); ! // ( ?) ! char bitMask = 1 << whichBit; ! buffer[whichByte] |= bitMask; ! //glitch ! ofBufferToFile(compressedFilename, file); ! // ! img.loadImage(compressedFilename);
62.
‣ !
// ! float coin = ofRandom(100); ! if (coin > 95) { ! ! reset(); ! } } void testApp::draw() { ! //glitch ! ofSetColor(255); ! img.draw(0, 0, ofGetWidth(), ofGetHeight()); } void testApp::keyPressed (int key){ ! reset(); } void testApp::mousePressed(int x, int y, int button){ ! reset(); }
63.
‣
64.
‣ ‣ ‣ ‣ ‣
Descargar ahora