oop

How to design a loader for different types of images?

丶灬走出姿态 提交于 2020-12-12 17:10:19
问题 I'm working on a side project that does matrix calculations over a large number of images. To achieve this, I'm using several different libraries (including libpng, libjpg, libtiff and easybmp) to load, maybe preprocess (i.e. grayscale or resize), and store the images. Each of these libraries stores the images differently, and this is where the issue occurs. I want to use strategy to have a base class named Image and multiple derived classes (i.e. ImagePNG, ImageBMP, etc.), and factory to

How to design a loader for different types of images?

偶尔善良 提交于 2020-12-12 17:09:34
问题 I'm working on a side project that does matrix calculations over a large number of images. To achieve this, I'm using several different libraries (including libpng, libjpg, libtiff and easybmp) to load, maybe preprocess (i.e. grayscale or resize), and store the images. Each of these libraries stores the images differently, and this is where the issue occurs. I want to use strategy to have a base class named Image and multiple derived classes (i.e. ImagePNG, ImageBMP, etc.), and factory to

How to design a loader for different types of images?

◇◆丶佛笑我妖孽 提交于 2020-12-12 17:09:32
问题 I'm working on a side project that does matrix calculations over a large number of images. To achieve this, I'm using several different libraries (including libpng, libjpg, libtiff and easybmp) to load, maybe preprocess (i.e. grayscale or resize), and store the images. Each of these libraries stores the images differently, and this is where the issue occurs. I want to use strategy to have a base class named Image and multiple derived classes (i.e. ImagePNG, ImageBMP, etc.), and factory to

tool for generating an outline/map of a C++ code - is there such thing? [duplicate]

匆匆过客 提交于 2020-12-12 12:11:17
问题 This question already has answers here : C/C++ source code visualization? [closed] (8 answers) Closed 7 years ago . I need to get into and make some modifications to a software component written in C++. I am fantasizing about generating some map of the code, that would show relationships between classes and walk me through the flow / call graph of methods. Is there a tool for this? Years ago I worked with Rational Rose modeling tool with had a feature of reverse-engineering the code and

tool for generating an outline/map of a C++ code - is there such thing? [duplicate]

99封情书 提交于 2020-12-12 12:07:50
问题 This question already has answers here : C/C++ source code visualization? [closed] (8 answers) Closed 7 years ago . I need to get into and make some modifications to a software component written in C++. I am fantasizing about generating some map of the code, that would show relationships between classes and walk me through the flow / call graph of methods. Is there a tool for this? Years ago I worked with Rational Rose modeling tool with had a feature of reverse-engineering the code and

tool for generating an outline/map of a C++ code - is there such thing? [duplicate]

流过昼夜 提交于 2020-12-12 12:06:34
问题 This question already has answers here : C/C++ source code visualization? [closed] (8 answers) Closed 7 years ago . I need to get into and make some modifications to a software component written in C++. I am fantasizing about generating some map of the code, that would show relationships between classes and walk me through the flow / call graph of methods. Is there a tool for this? Years ago I worked with Rational Rose modeling tool with had a feature of reverse-engineering the code and

How can I find other solutions of the maze in java?

心不动则不痛 提交于 2020-12-12 09:21:31
问题 I need to write a program that takes the maze in the given txt file and prints the solution paths to the console. I wrote this program as you can see below, but I can only find 1 solution. If there are more than 1 solution in the maze, I need to find all these. I have no idea what approach I should take for this. Can you give an idea, please? Here is my work: maze.txt (sent as argument) 11111111111111111 10110011000111111 11001110111001111 10110001011100111 11101111011011001 11101001011011111

How can I find other solutions of the maze in java?

允我心安 提交于 2020-12-12 09:13:22
问题 I need to write a program that takes the maze in the given txt file and prints the solution paths to the console. I wrote this program as you can see below, but I can only find 1 solution. If there are more than 1 solution in the maze, I need to find all these. I have no idea what approach I should take for this. Can you give an idea, please? Here is my work: maze.txt (sent as argument) 11111111111111111 10110011000111111 11001110111001111 10110001011100111 11101111011011001 11101001011011111

What is a function for structs like Java's instanceof?

送分小仙女□ 提交于 2020-12-08 20:11:24
问题 I'm making an OOP chat client in Rust. The module messages.rs creates and handles messages to other modules as structs: SimpleMessage and ComplexMessage structs: //! # Messages use time::SteadyTime; /// Represents a simple text message pub struct SimpleMessage<'a> { pub user: ... pub time: &'a SteadyTime<'a>, pub content: &'a str, } /// Represents attachments, like text or multimedia files. pub struct ComplexMessage<'a> { pub user: ... pub time: &'a SteadyTime<'a>, //pub content: PENDING }

What is a function for structs like Java's instanceof?

冷暖自知 提交于 2020-12-08 20:07:47
问题 I'm making an OOP chat client in Rust. The module messages.rs creates and handles messages to other modules as structs: SimpleMessage and ComplexMessage structs: //! # Messages use time::SteadyTime; /// Represents a simple text message pub struct SimpleMessage<'a> { pub user: ... pub time: &'a SteadyTime<'a>, pub content: &'a str, } /// Represents attachments, like text or multimedia files. pub struct ComplexMessage<'a> { pub user: ... pub time: &'a SteadyTime<'a>, //pub content: PENDING }