画图,画点,画线
This commit is contained in:
@@ -175,10 +175,10 @@ std::vector<uint8_t> generateSimpleTestImage(int width, int height, int cell_wid
|
||||
const uint8_t* color = cellColors[gridY][gridX].data();
|
||||
int index = (y * width + x) * 4;
|
||||
|
||||
imageData[index] = color[0]/10;
|
||||
imageData[index + 1] = color[1]/10;
|
||||
imageData[index + 2] = color[2]/10;
|
||||
imageData[index + 3] = color[3]/10;
|
||||
imageData[index] = color[0]/5;
|
||||
imageData[index + 1] = color[1]/3;
|
||||
imageData[index + 2] = color[2]/3;
|
||||
imageData[index + 3] = color[3]/3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1378,20 +1378,18 @@ bool TextureLoading::prepare(const vkb::ApplicationOptions& options)
|
||||
size_t dataSize = testImage.size();
|
||||
processWithVulkan(testImage.data(), width, height, rowStride, dataSize, texture_point);
|
||||
|
||||
//width = 256;
|
||||
//height = 256;
|
||||
//rowStride = width * 4;
|
||||
//auto arrowImage = generateSimpleTestImage(width, height, 80);
|
||||
//dataSize = arrowImage.size();
|
||||
//processWithVulkan(arrowImage.data(), width, height, rowStride, dataSize, texture_point);
|
||||
width = 640;
|
||||
height = 480;
|
||||
rowStride = width * 4;
|
||||
auto arrowImage = generateSimpleTestImage(width, height, 80);
|
||||
dataSize = arrowImage.size();
|
||||
processWithVulkan(arrowImage.data(), width, height, rowStride, dataSize, cam_text);
|
||||
|
||||
const char* filename = "face.png";
|
||||
std::vector<unsigned char> image; // 存储RGB数据
|
||||
unsigned w, h;
|
||||
|
||||
// 解码PNG文件
|
||||
unsigned error = lodepng::decode(image, w, h, filename, LCT_RGBA, 8);
|
||||
processWithVulkan(image.data(), w, h, w*4, image.size(), cam_text);
|
||||
//const char* filename = "face.png";
|
||||
//std::vector<unsigned char> image;
|
||||
//unsigned w, h;
|
||||
//unsigned error = lodepng::decode(image, w, h, filename, LCT_RGBA, 8);
|
||||
//processWithVulkan(image.data(), w, h, w*4, image.size(), cam_text);
|
||||
|
||||
width = 256;
|
||||
height = 256;
|
||||
@@ -1442,8 +1440,8 @@ bool TextureLoading::prepare(const vkb::ApplicationOptions& options)
|
||||
{
|
||||
nlohmann::json p = rawPoint[i];
|
||||
int index = p["id"];
|
||||
pos[pos_id++] = p["x"]/480;
|
||||
pos[pos_id++] = p["y"] / 480;
|
||||
pos[pos_id++] = p["x"]/480.f;
|
||||
pos[pos_id++] = p["y"] / 480.f;
|
||||
pos[pos_id++] = p["z"];
|
||||
}
|
||||
update_point_vertex_buffer(pos, rawPoint.size());
|
||||
|
||||
Reference in New Issue
Block a user