Last active
December 27, 2015 22:29
-
-
Save t-kashima/7399552 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
//画面の基本設定 | |
ofBackground(0,0,0); | |
ofEnableSmoothing(); | |
myImage.loadImage("test.jpg"); | |
ofSetColor(255, 255, 255); | |
myImage.draw(400, 400, 400, 400); | |
} | |
//-------------------------------------------------------------- | |
void testApp::update(){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::draw() | |
{ | |
unsigned char * pixels = myImage.getPixels(); | |
//画像の幅と高さを所得 | |
int w = myImage.width; | |
int h = myImage.height; | |
//画像を3ピクセル間隔でスキャン | |
for (int i = 0; i < w; i += 3){ | |
for (int j = 0; j < h; j += 3){ | |
int valueR = pixels[j * 3 * w + i * 3]; | |
int valueG = pixels[j * 3 * w + i * 3 + 1]; | |
int valueB = pixels[j * 3 * w + i * 3 + 2]; | |
ofSetColor(valueR, valueG, valueB, 255.0); | |
ofCircle(i, j, 1); | |
} | |
} | |
} | |
//-------------------------------------------------------------- | |
void testApp::keyPressed(int key){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::keyReleased(int key){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::mouseMoved(int x, int y){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::mouseDragged(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::mousePressed(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::mouseReleased(int x, int y, int button){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::windowResized(int w, int h){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::gotMessage(ofMessage msg){ | |
} | |
//-------------------------------------------------------------- | |
void testApp::dragEvent(ofDragInfo dragInfo){ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment