• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Want to draw a pixel

New Here ,
Nov 28, 2006 Nov 28, 2006

Copy link to clipboard

Copied

Hi,

I want to be able to draw a pixel to a specific spot on my layer. I don't want to have to iterate through and check to see if I've hit my spot, I just want to draw it directly.

I'm currently too stupid to igure this out on my own however. :)

I tried drawing a 1-pixel rectangle, but fillMatteSuite2 isn't a member of AEGP_SuiteHandler, so I'm trying fillmattesuite1, which is. Of course, I can't get that to work either...

I've also been hunting in vain for some resources online to help out, but there really isn't much out there that I can find. Does anyone know of any other places besides the SDK to find code samples? I'd especially love to figure out how to use openGL to render, but right now, that's a wall I'd rather not bang my head against.

Thanks,
-Rich
TOPICS
SDK

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 01, 2006 Dec 01, 2006

Copy link to clipboard

Copied

To find a specific pixel, you'll need to do some pixel math.

You could MAKE FillMatteSuite2 a member of AEGP_SuiteHandler; it isn't terribly hard.

You'll also need to copy the input buffer to the output buffer, before drawing your pixel. Feel free to contact me directly with more specific questions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2006 Dec 01, 2006

Copy link to clipboard

Copied

I wound up (for the time being) just making a little function that uses FILL to make a 1 pixel rectangle at the proper pixel location. Then I made my own line drawing routine, and then a circle routine, and just finished making a bezier drawing routine. A little brute force, and nothing's anti-aliased, but hey, it works for now while I straighten out the rest of my code.

Do I need to anti-alias myself? I was really hoping there'd be some pre-baked routines for basic drawing.

It's not so bad, I guess. Having to do it on my own is certainly making me learn c++ and the SDK a bit better.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 04, 2006 Dec 04, 2006

Copy link to clipboard

Copied

I don't think you need to anti-alias yourself, though you can use our subpixel sampling callbacks, if you like.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 05, 2006 Dec 05, 2006

Copy link to clipboard

Copied

Hmmm... After much head scratching, I think I figured out the theory behind this.

I created a small 5x5 Effect_World where alpha=0 everywhere except for the center pixel (2,2) which is the correct color and alpha = 255. I then sample this at appropriate subpixel offsets, get a color value and set the pixel(s) in the destination World to that color - filling in all the integral pixels the "real" pixel overlaps with their respective samples from the mini-World.

At least that's what I'm TRYING to do.

The problem is that whatever x and y values I give to subpixel_sample(), I've found that it always samples the top left most pixel (0,0). I've verified this by changing the value for that pixel in the small source World, and seeing the according change in the sample. This is obviously incorrect behaviour, and is user-error on my part, but I can't see where.

A) Any ideas where I might be going wrong? is there something in PF_SampB besides .src that I need to set?

B) Am I going about this whole operation the wrong way to begin with?

Thanks for your help,
-Rich

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 07, 2006 Dec 07, 2006

Copy link to clipboard

Copied

LATEST
Subpixel sampling works correctly in the Shifter sample; what, if anything, are you doing differently?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines