15,749,346 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by tasumisra (Top 9 by date)
tasumisra
8-Feb-16 11:53am
View
this is how implementation looks like
template<typename t="">
class Image
{
public:
void create(unsigned int width, unsigned int height)
{
_imageData = boost::shared_ptr<t>(new T[width * height]);
_width = width;
_height = height;
}
T getPixel(unsigned int x, unsigned int y) const
{
return _imageData[x * y];
}
void setPixel(unsigned int x, unsigned int y, T pixel)
{
_imageData[x + _width * y] = pixel;
}
// Return a sub-region of pixels
boost::shared_ptr<Image<t> > extractRegion(const Rectangle<t>& region) const
{
boost::shared_ptr<Image<t> > im = new Image<t>();
im->create(region.Width, region.Height);
for(unsigned int y = 0; y < region.Height; y++)
{
for(unsigned int x = 0; x < region.Width; x++)
{
im->setPixel(x, y, getPixel(region.X + x, region.Y + y));
}
}
return im;
}
private:
boost::shared_ptr<t> _imageData;
unsigned int _width;
unsigned int _height;
}
tasumisra
8-Feb-16 11:03am
View
Hello Stefan,
this is pseudo code and i was only expecting indicative solution\design..
but as you pointed out few things i ll try to look into this.
Thanks
tasumisra
8-Feb-16 10:54am
View
Thank you so much Pallini,i have been waiting for your answer and i know you are champion :) can you please help me with some good tutorial\links for the same...
apart from that how to convert 16bit grey scale to 24 bit RGB ... just exploring few things around
tasumisra
8-Feb-16 6:42am
View
Thanks Aescleal,I will try this option.
tasumisra
8-Feb-16 6:34am
View
hi Kornfeld,
i am looking to optimise it for speed,basically i want to create some kind of hash table where it trying to call GetData each time...
any help would be appriciated
Thanks,
Vikas
tasumisra
8-Feb-16 6:32am
View
Basically this is a pseudo code where emphasis is on eliminating a for loop by creating some kind of lookup....
tasumisra
7-Feb-15 4:39am
View
Hello SA..
We have the documentation from provider like data structure it accepts..but what i want here the steps to be followed... so that i can update the the firmware with default settings..
tasumisra
29-Sep-13 12:18pm
View
exactly...
tasumisra
29-Sep-13 12:18pm
View
not exactly exception..its kind of exception prevention
Show More